From 7d81494a649f3f871bfeb4bb129cbfa738fbef67 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 9 Apr 2019 20:51:33 +0200 Subject: [PATCH] fusefrontend: get rid of last hardcoded "gocryptfs.diriv" instances Makes it easier to change the name (as some people want to): https://github.com/rfjakob/gocryptfs/issues/37 --- internal/fusefrontend/fs_dir.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go index 35aae66..773e389 100644 --- a/internal/fusefrontend/fs_dir.go +++ b/internal/fusefrontend/fs_dir.go @@ -197,7 +197,7 @@ retry: children, err := syscallcompat.Getdents(dirfd) if err == io.EOF { // The directory is empty - tlog.Warn.Printf("Rmdir: %q: gocryptfs.diriv is missing", cName) + tlog.Warn.Printf("Rmdir: %q: %s is missing", cName, nametransform.DirIVFilename) err = unix.Unlinkat(parentDirFd, cName, unix.AT_REMOVEDIR) return fuse.ToStatus(err) } @@ -222,7 +222,7 @@ retry: return fuse.ToStatus(syscall.ENOTEMPTY) } // Move "gocryptfs.diriv" to the parent dir as "gocryptfs.diriv.rmdir.XYZ" - tmpName := fmt.Sprintf("gocryptfs.diriv.rmdir.%d", cryptocore.RandUint64()) + tmpName := fmt.Sprintf("%s.rmdir.%d", nametransform.DirIVFilename, cryptocore.RandUint64()) tlog.Debug.Printf("Rmdir: Renaming %s to %s", nametransform.DirIVFilename, tmpName) // The directory is in an inconsistent state between rename and rmdir. // Protect against concurrent readers. @@ -293,7 +293,7 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f return nil, fuse.ENOENT } // Any other problem warrants an error message - tlog.Warn.Printf("OpenDir %q: could not read gocryptfs.diriv: %v", cDirName, err) + tlog.Warn.Printf("OpenDir %q: could not read %s: %v", cDirName, nametransform.DirIVFilename, err) return nil, fuse.EIO } }