diff options
author | Tim Prouty <tprouty@samba.org> | 2008-11-26 16:47:14 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2008-12-09 14:51:48 -0800 |
commit | b3c785f22edeff5f731af95ec1252517c4677451 (patch) | |
tree | 012d70a40c32b21172e71e52a3f2b150a9c20c6c /source3 | |
parent | 2053f77b3c71ad40a875614b98e547fd558375ad (diff) | |
download | samba-b3c785f22edeff5f731af95ec1252517c4677451.tar.gz samba-b3c785f22edeff5f731af95ec1252517c4677451.tar.bz2 samba-b3c785f22edeff5f731af95ec1252517c4677451.zip |
s3: Call fd_close from close_directory
Some implementations of SMB_VFS_CREATE_FILE implementations actually
keep an fd open for directories just as files. In this case it is
necessary to call fd_close when closing directories. This is safe
because fd_close is a no-op when fd == -1, which is true for directory
opens originating from open.c (the default SMB_VFS_CREATE_FILE
implementation).
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/close.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c index ce918ab6a3..f91f1fcf8f 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -694,6 +694,13 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, fsp, NT_STATUS_OK); } + status = fd_close(fsp); + + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Could not close dir! fname=%s, fd=%d, err=%d=%s\n", + fsp->fsp_name, fsp->fh->fd, errno, strerror(errno))); + } + /* * Do the code common to files and directories. */ |