Fix bug #7033 - SMBrmdir call always returns true, even on failure to delete a directory.
authorJeremy Allison <jra@samba.org>
Wed, 13 Jan 2010 00:50:40 +0000 (16:50 -0800)
committerJeremy Allison <jra@samba.org>
Wed, 13 Jan 2010 00:50:40 +0000 (16:50 -0800)
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.

Jeremy.

source3/smbd/reply.c

index b2d98bfbc0284fb31cb6efbe74f60dfdbd0e7006..b6316aac467cf545b364f08ef6c8a8edf236193d 100644 (file)
@@ -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);