summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-09-22 20:25:47 +0200
committerJakob Unterwurzacher2018-09-23 12:17:59 +0200
commitbead82c9fb91cbae0290523b57eec421e5218177 (patch)
treee78f7aba235d154f3a86b0cde39688decef05abe
parentc270b21efc1d9ecbe5c913c733204f826e263747 (diff)
fusefrontend: add named parameters to openBackingDir
Named parameters make using the function easier.
-rw-r--r--internal/fusefrontend/names.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/fusefrontend/names.go b/internal/fusefrontend/names.go
index 86c87f0..5530e3e 100644
--- a/internal/fusefrontend/names.go
+++ b/internal/fusefrontend/names.go
@@ -44,17 +44,18 @@ func (fs *FS) getBackingPath(relPath string) (string, error) {
// "relPath" and returns the dirfd and the encrypted basename.
// The caller should then use Openat(dirfd, cName, ...) and friends.
// openBackingDir is secure against symlink races.
-func (fs *FS) openBackingDir(relPath string) (int, string, error) {
+func (fs *FS) openBackingDir(relPath string) (dirfd int, cName string, err error) {
cRelPath, err := fs.encryptPath(relPath)
if err != nil {
return -1, "", err
}
// Open parent dir
- dirfd, err := syscallcompat.OpenDirNofollow(fs.args.Cipherdir, filepath.Dir(cRelPath))
+ dirfd, err = syscallcompat.OpenDirNofollow(fs.args.Cipherdir, filepath.Dir(cRelPath))
if err != nil {
return -1, "", err
}
- return dirfd, filepath.Base(cRelPath), nil
+ cName = filepath.Base(cRelPath)
+ return dirfd, cName, nil
}
// encryptPath - encrypt relative plaintext path