]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: use STATUS_NOTIFY_CLEANUP when closing a smb2 directory handle
authorStefan Metzmacher <metze@samba.org>
Fri, 1 May 2015 18:02:38 +0000 (20:02 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 20 May 2015 14:34:29 +0000 (16:34 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11182

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a5981d137461e5715c92a4fb4cdeaa650f34e999)

selftest/knownfail
source3/smbd/close.c

index 8d11dfe7da72a2c33b2d47325b3730ea1e96d719..104ddbd4029771cdc40b0ca0620e9ce95aff4480 100644 (file)
 ^samba3.smb2.create.open
 ^samba3.smb2.create.leading-slash
 ^samba3.smb2.notify.valid-req
-^samba3.smb2.notify.dir
 ^samba3.smb2.notify.rec
 ^samba3.smb2.durable-open.lock-lease
 ^samba3.smb2.durable-open.reopen4
index f341c729521ae68026bd6a2db56f8c1a620cc446..3f4af6d46f74994b13965cb990a1cd02475575c0 100644 (file)
@@ -1050,6 +1050,13 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
        NTSTATUS status1 = NT_STATUS_OK;
        const struct security_token *del_nt_token = NULL;
        const struct security_unix_token *del_token = NULL;
+       NTSTATUS notify_status;
+
+       if (fsp->conn->sconn->using_smb2) {
+               notify_status = STATUS_NOTIFY_CLEANUP;
+       } else {
+               notify_status = NT_STATUS_OK;
+       }
 
        /*
         * NT can set delete_on_close of the last open
@@ -1159,8 +1166,8 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
                 * now fail as the directory has been deleted.
                 */
 
-               if(NT_STATUS_IS_OK(status)) {
-                       remove_pending_change_notify_requests_by_fid(fsp, NT_STATUS_DELETE_PENDING);
+               if (NT_STATUS_IS_OK(status)) {
+                       notify_status = NT_STATUS_DELETE_PENDING;
                }
        } else {
                if (!del_share_mode(lck, fsp)) {
@@ -1169,10 +1176,10 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
                }
 
                TALLOC_FREE(lck);
-               remove_pending_change_notify_requests_by_fid(
-                       fsp, NT_STATUS_OK);
        }
 
+       remove_pending_change_notify_requests_by_fid(fsp, notify_status);
+
        status1 = fd_close(fsp);
 
        if (!NT_STATUS_IS_OK(status1)) {