]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: return the correct error for cancelled SMB2 notifies on expired sessions
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Dec 2017 13:47:06 +0000 (14:47 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 8 Mar 2018 20:55:22 +0000 (21:55 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13197

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/notify.c

index f64185dc2d24d12f3e1b0c93fe58ae5d39ab6f4f..add59089187e0eb1984c46a718dbbbb5e75714f9 100644 (file)
@@ -391,12 +391,21 @@ static void smbd_notify_cancel_by_map(struct notify_mid_map *map)
        NTSTATUS notify_status = NT_STATUS_CANCELLED;
 
        if (smb2req != NULL) {
+               NTSTATUS sstatus;
+
                if (smb2req->session == NULL) {
-                       notify_status = STATUS_NOTIFY_CLEANUP;
-               } else if (!NT_STATUS_IS_OK(smb2req->session->status)) {
-                       notify_status = STATUS_NOTIFY_CLEANUP;
+                       sstatus = NT_STATUS_USER_SESSION_DELETED;
+               } else {
+                       sstatus = smb2req->session->status;
                }
-               if (smb2req->tcon == NULL) {
+
+               if (NT_STATUS_EQUAL(sstatus, NT_STATUS_NETWORK_SESSION_EXPIRED)) {
+                       sstatus = NT_STATUS_OK;
+               }
+
+               if (!NT_STATUS_IS_OK(sstatus)) {
+                       notify_status = STATUS_NOTIFY_CLEANUP;
+               } else if (smb2req->tcon == NULL) {
                        notify_status = STATUS_NOTIFY_CLEANUP;
                } else if (!NT_STATUS_IS_OK(smb2req->tcon->status)) {
                        notify_status = STATUS_NOTIFY_CLEANUP;