diff options
author | Jakob Unterwurzacher | 2020-08-02 19:33:12 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2020-08-02 19:33:12 +0200 |
commit | 84ed139cd2cede9b773fe7892a0bc2515fc1f00f (patch) | |
tree | 9886e8fdce9450fd6232e532d5e8e939871dd2fc /internal/fusefrontend_reverse/rpath.go | |
parent | 4674bac8381838718f0defba0f2e0d9eba2a41a3 (diff) |
v2api/reverse: implement Lookup for longname
Diffstat (limited to 'internal/fusefrontend_reverse/rpath.go')
-rw-r--r-- | internal/fusefrontend_reverse/rpath.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/internal/fusefrontend_reverse/rpath.go b/internal/fusefrontend_reverse/rpath.go index 35b9361..d212dfc 100644 --- a/internal/fusefrontend_reverse/rpath.go +++ b/internal/fusefrontend_reverse/rpath.go @@ -47,11 +47,20 @@ func (rfs *RootNode) rDecryptName(cName string, dirIV []byte, pDir string) (pNam return "", err } } else if nameType == nametransform.LongNameContent { - panic("todo") - //pName, err = rfs.findLongnameParent(pDir, dirIV, cName) + dirfd, err := syscallcompat.OpenDirNofollow(rfs.args.Cipherdir, filepath.Dir(pDir)) if err != nil { return "", err } + defer syscall.Close(dirfd) + fd, err := syscallcompat.Openat(dirfd, filepath.Base(pDir), syscall.O_RDONLY|syscall.O_DIRECTORY|syscall.O_NOFOLLOW, 0) + if err != nil { + return "", err + } + var errno syscall.Errno + pName, _, errno = rfs.findLongnameParent(fd, dirIV, cName) + if errno != 0 { + return "", errno + } } else { // It makes no sense to decrypt a ".name" file. This is a virtual file // that has no representation in the plaintext filesystem. ".name" |