diff options
author | Jakob Unterwurzacher | 2018-08-11 23:26:49 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2018-08-11 23:26:49 +0200 |
commit | ec2fdc19cf9358ae7ba09c528a5807b6b0760f9b (patch) | |
tree | 1a9a26d9f70ac26f3df2c44a6e5ed6ff9108ab76 /internal/fusefrontend_reverse/rfile.go | |
parent | eaa5aecd422bc4f6b01b6257383521ad512e08f7 (diff) |
reverse mode: add --exclude option
https://github.com/rfjakob/gocryptfs/issues/235
Diffstat (limited to 'internal/fusefrontend_reverse/rfile.go')
-rw-r--r-- | internal/fusefrontend_reverse/rfile.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/fusefrontend_reverse/rfile.go b/internal/fusefrontend_reverse/rfile.go index 26756a3..7df0906 100644 --- a/internal/fusefrontend_reverse/rfile.go +++ b/internal/fusefrontend_reverse/rfile.go @@ -36,6 +36,12 @@ var inodeTable syncmap.Map // newFile decrypts and opens the path "relPath" and returns a reverseFile // object. The backing file descriptor is always read-only. func (rfs *ReverseFS) newFile(relPath string) (*reverseFile, fuse.Status) { + if rfs.isExcluded(relPath) { + // Excluded paths should have been filtered out beforehand. Better safe + // than sorry. + tlog.Warn.Printf("BUG: newFile: received excluded path %q. This should not happen.", relPath) + return nil, fuse.ENOENT + } pRelPath, err := rfs.decryptPath(relPath) if err != nil { return nil, fuse.ToStatus(err) |