diff options
author | Sebastian Lackner | 2017-11-25 02:12:02 +0100 |
---|---|---|
committer | rfjakob | 2017-11-25 16:20:00 +0100 |
commit | 95870e841e395607a7df60a138f0fcc53a76f7b3 (patch) | |
tree | 9738158b7d39fdbdacc9e3f4c70f6d9bdb997922 | |
parent | 9f56b33e0c8701085189aa77463f1b471b70a705 (diff) |
fusefrontend: Skip gocryptfs.diriv handling when directory was deleted successfully
Fixes https://github.com/rfjakob/gocryptfs/issues/171
Steps to reproduce:
* Create a regular forward mount point
* Create a new directory in the mount point
* Manually delete the gocryptfs.diriv file from the corresponding ciphertext
directory
* Attempt to delete the directory with 'rmdir <dirname>'
Although the code explicitly checks for empty directories, it will still attempt
to move the non-existent gocryptfs.diriv file and fails with:
rmdir: failed to remove '<dirname>': No such file or directory
-rw-r--r-- | internal/fusefrontend/fs_dir.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go index b144ea4..91c899e 100644 --- a/internal/fusefrontend/fs_dir.go +++ b/internal/fusefrontend/fs_dir.go @@ -193,10 +193,7 @@ retry: if err == io.EOF { // The directory is empty tlog.Warn.Printf("Rmdir: %q: gocryptfs.diriv is missing", cPath) - err = syscall.Rmdir(cPath) - if err != nil { - return fuse.ToStatus(err) - } + return fuse.ToStatus(syscall.Rmdir(cPath)) } if err != nil { tlog.Warn.Printf("Rmdir: Readdirnames: %v", err) |