summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/fs_dir.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-02-07 14:02:09 +0100
committerJakob Unterwurzacher2016-02-07 14:02:09 +0100
commit653d4a619cb7b937d81deab4f20d3c8d4baa4898 (patch)
tree4ae1132e0a082d72fa5f008f91e451ce138ec273 /internal/fusefrontend/fs_dir.go
parent2a11906963d4e9be8876757690eee53c737dcef9 (diff)
longnames part II: Rename, Unlink, Rmdir, Mknod, Mkdir + testsv0.9-rc1
Diffstat (limited to 'internal/fusefrontend/fs_dir.go')
-rw-r--r--internal/fusefrontend/fs_dir.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go
index f1ade25..ebf7015 100644
--- a/internal/fusefrontend/fs_dir.go
+++ b/internal/fusefrontend/fs_dir.go
@@ -10,6 +10,7 @@ import (
"github.com/hanwen/go-fuse/fuse"
+ "github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/nametransform"
"github.com/rfjakob/gocryptfs/internal/toggledlog"
@@ -30,7 +31,11 @@ func (fs *FS) Mkdir(relPath string, mode uint32, context *fuse.Context) (code fu
// We need write and execute permissions to create gocryptfs.diriv
origMode := mode
mode = mode | 0300
-
+ // Create .name file to store the long file name if needed
+ err = fs.nameTransform.WriteLongName(encPath, relPath)
+ if err != nil {
+ return fuse.ToStatus(err)
+ }
// The new directory may take the place of an older one that is still in the cache
fs.nameTransform.DirIVCache.Clear()
// Create directory
@@ -151,6 +156,10 @@ func (fs *FS) Rmdir(name string, context *fuse.Context) (code fuse.Status) {
if err != nil {
toggledlog.Warn.Printf("Rmdir: Could not clean up %s: %v", tmpName, err)
}
+ err = nametransform.DeleteLongName(encPath)
+ if err != nil {
+ toggledlog.Warn.Printf("Rmdir: Could not delete long name file: %v", err)
+ }
// The now-deleted directory may have been in the DirIV cache. Clear it.
fs.nameTransform.DirIVCache.Clear()
return fuse.OK