aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-04-09 20:51:33 +0200
committerJakob Unterwurzacher2019-04-09 20:51:33 +0200
commit7d81494a649f3f871bfeb4bb129cbfa738fbef67 (patch)
tree597943162b0b90a89fd02e1cdf9e23f158033949
parent24036ab89f950be85aa306f5996a4ce218c48aab (diff)
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
-rw-r--r--internal/fusefrontend/fs_dir.go6
1 files 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
}
}