[SCM] Samba Shared Repository - branch v3-5-test updated

Karolin Seeger kseeger at samba.org
Thu Jan 14 07:14:05 MST 2010


The branch, v3-5-test has been updated
       via  fd04e3a... Fix bug #7033 - SMBrmdir call always returns true, even on failure to delete a directory.
      from  3b9cdab... s3: Fix a winbind segfault in "trusted_domains"

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit fd04e3a2b74dbd31c7574355c73779626c10070e
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Jan 13 14:36:37 2010 -0800

    Fix bug #7033 - SMBrmdir call always returns true, even on failure to delete a directory.
    
    There is a codepath missing to propagate back error returns from the rmdir
    POSIX call inside close_directory when delete on close is set. This means doing
    an rmdir on a Windows command line will always report success, even when the
    directory was not deleted. This fix adds that codepath back into Samba.
    
    (This fix contains both ce8dcbe91ba0252140a0e4f84ea4bc746259ddde and
    105f876eb447e6839b9b19c2d264c4a168cf0cc9 from master).
    
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/close.c |    8 ++++++--
 source3/smbd/reply.c |    8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 05c3c70..fa83e16 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -924,6 +924,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
@@ -1022,9 +1023,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)));
@@ -1042,6 +1043,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;
 }
 
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index b2d98bf..b6316aa 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -5368,8 +5368,12 @@ void reply_rmdir(struct smb_request *req)
 		goto out;
 	}
 
-	close_file(req, fsp, NORMAL_CLOSE);
-	reply_outbuf(req, 0, 0);
+	status = close_file(req, fsp, NORMAL_CLOSE);
+	if (!NT_STATUS_IS_OK(status)) {
+		reply_nterror(req, status);
+	} else {
+		reply_outbuf(req, 0, 0);
+	}
 
 	dptr_closepath(sconn, smb_dname->base_name, req->smbpid);
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list