From b3c785f22edeff5f731af95ec1252517c4677451 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Wed, 26 Nov 2008 16:47:14 -0800 Subject: 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). --- source3/smbd/close.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/smbd') 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. */ -- cgit