From: Tim Prouty Date: Thu, 27 Nov 2008 00:47:14 +0000 (-0800) Subject: s3: Call fd_close from close_directory X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=b3c785f22edeff5f731af95ec1252517c4677451;p=metze%2Fsamba%2Fwip.git 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). --- diff --git a/source3/smbd/close.c b/source3/smbd/close.c index ce918ab6a325..f91f1fcf8fe1 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. */