From d8fb28a1c38cda0b013c617404ad4a768effb704 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 10 Nov 2016 23:51:47 +0100 Subject: ctlsock: prevent panic on invalid decrypt request --- internal/fusefrontend_reverse/rpath.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/fusefrontend_reverse') 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) } -- cgit v1.2.3