summaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-11-10 23:51:47 +0100
committerJakob Unterwurzacher2016-11-10 23:51:47 +0100
commitd8fb28a1c38cda0b013c617404ad4a768effb704 (patch)
tree898a42172caa21cc34516f203b0cf2729872f67c /internal/fusefrontend_reverse
parentc2629bd9b5b814cb7abaf6ddc42bd9f1f306b30b (diff)
ctlsock: prevent panic on invalid decrypt request
Diffstat (limited to 'internal/fusefrontend_reverse')
-rw-r--r--internal/fusefrontend_reverse/rpath.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/fusefrontend_reverse/rpath.go b/internal/fusefrontend_reverse/rpath.go
index 0da40bb..edffc1e 100644
--- a/internal/fusefrontend_reverse/rpath.go
+++ b/internal/fusefrontend_reverse/rpath.go
@@ -8,6 +8,7 @@ import (
"syscall"
"github.com/rfjakob/gocryptfs/internal/nametransform"
+ "github.com/rfjakob/gocryptfs/internal/tlog"
)
// saneDir is like filepath.Dir but returns "" instead of "."
@@ -80,7 +81,9 @@ func (rfs *ReverseFS) decryptPath(relPath string) (string, error) {
return "", err
}
} else {
- panic("longname bug, .name files should have been handled earlier")
+ // It makes no sense to decrypt a ".name" file
+ tlog.Warn.Printf("decryptPath: tried to decrypt %q!? Returning EINVAL.", part)
+ return "", syscall.EINVAL
}
transformedParts = append(transformedParts, transformedPart)
}