summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-01-12 16:55:31 -0800
committerJeremy Allison <jra@samba.org>2010-01-12 16:55:31 -0800
commit105f876eb447e6839b9b19c2d264c4a168cf0cc9 (patch)
tree1fb10b8b0edef507cf801976326505f29f2c19cb /source3/smbd
parentce8dcbe91ba0252140a0e4f84ea4bc746259ddde (diff)
downloadsamba-105f876eb447e6839b9b19c2d264c4a168cf0cc9.tar.gz
samba-105f876eb447e6839b9b19c2d264c4a168cf0cc9.tar.bz2
samba-105f876eb447e6839b9b19c2d264c4a168cf0cc9.zip
Fix bug #7033 - SMBrmdir call always returns true, even on failure to delete a directory.
Argh. Missed the second (and essential) part of the fix for the above :-(. Jeremy
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/close.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index e81a2fdff6..ca1ac47fa0 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -926,6 +926,7 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
struct share_mode_lock *lck = NULL;
bool delete_dir = False;
NTSTATUS status = NT_STATUS_OK;
+ NTSTATUS status1 = NT_STATUS_OK;
/*
* NT can set delete_on_close of the last open
@@ -1025,9 +1026,9 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
fsp, NT_STATUS_OK);
}
- status = fd_close(fsp);
+ status1 = fd_close(fsp);
- if (!NT_STATUS_IS_OK(status)) {
+ if (!NT_STATUS_IS_OK(status1)) {
DEBUG(0, ("Could not close dir! fname=%s, fd=%d, err=%d=%s\n",
fsp_str_dbg(fsp), fsp->fh->fd, errno,
strerror(errno)));
@@ -1045,6 +1046,9 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
out:
TALLOC_FREE(lck);
+ if (NT_STATUS_IS_OK(status) && !NT_STATUS_IS_OK(status1)) {
+ status = status1;
+ }
return status;
}