fusefrontend_reverse: fix fd leak in GetAttr

Fixes https://github.com/rfjakob/gocryptfs/issues/184
This commit is contained in:
Jakob Unterwurzacher 2017-12-07 09:01:12 +01:00
parent 87736eb833
commit 48bd59f388
1 changed files with 1 additions and 0 deletions

View File

@ -161,6 +161,7 @@ func (rfs *ReverseFS) GetAttr(relPath string, context *fuse.Context) (*fuse.Attr
if err != nil {
return nil, fuse.ToStatus(err)
}
syscall.Close(dirFd)
// Instead of risking an inode number collision, we return an error.
if st.Ino > inoBaseMin {
tlog.Warn.Printf("GetAttr %q: backing file inode number %d crosses reserved space, max=%d. Returning EOVERFLOW.",