aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse/rpath.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-08-15 17:31:25 +0200
committerJakob Unterwurzacher2020-08-15 17:31:45 +0200
commit94e8fc12ea5756a130e7ac9ed67ddd519b5f3a22 (patch)
tree44186807f71db8c555af23f8969f8f1456c955f9 /internal/fusefrontend_reverse/rpath.go
parent15b0b4a5fd268b421ddc347e4417b2538a540922 (diff)
v2api/reverse: finish -exclude
Tests pass now.
Diffstat (limited to 'internal/fusefrontend_reverse/rpath.go')
-rw-r--r--internal/fusefrontend_reverse/rpath.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/internal/fusefrontend_reverse/rpath.go b/internal/fusefrontend_reverse/rpath.go
index 1e44638..f29bbf5 100644
--- a/internal/fusefrontend_reverse/rpath.go
+++ b/internal/fusefrontend_reverse/rpath.go
@@ -100,25 +100,24 @@ func (rn *RootNode) decryptPath(cPath string) (string, error) {
// and returns the fd to the directory and the decrypted name of the
// target file. The fd/name pair is intended for use with fchownat and
// friends.
-func (rn *RootNode) openBackingDir(cPath string) (dirfd int, pName string, err error) {
+func (rn *RootNode) openBackingDir(cPath string) (dirfd int, pPath string, err error) {
defer func() {
- tlog.Debug.Printf("openBackingDir %q -> %d %q %v\n", cPath, dirfd, pName, err)
+ tlog.Debug.Printf("openBackingDir %q -> %d %q %v\n", cPath, dirfd, pPath, err)
}()
dirfd = -1
- pRelPath, err := rn.decryptPath(cPath)
+ pPath, err = rn.decryptPath(cPath)
if err != nil {
return
}
- if rn.isExcludedPlain(pRelPath) {
+ if rn.isExcludedPlain(pPath) {
err = syscall.EPERM
return
}
// Open directory, safe against symlink races
- pDir := filepath.Dir(pRelPath)
+ pDir := filepath.Dir(pPath)
dirfd, err = syscallcompat.OpenDirNofollow(rn.args.Cipherdir, pDir)
if err != nil {
return
}
- pName = filepath.Base(pRelPath)
- return dirfd, pName, nil
+ return dirfd, pPath, nil
}