]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: use STATUS_NOTIFY_CLEANUP on smb2 logoff (explicit and implicit) and tdis
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 5169e9b20c69092d04b596f48ca0e69a46af438f)

source3/smbd/notify.c

index cb9f873894305f55758e3dacf1beeefb8f653241..c90561c96fcafbed9b9029e2d5ecb1370555e1c0 100644 (file)
@@ -354,8 +354,22 @@ static void smbd_notify_cancel_by_map(struct notify_mid_map *map)
 {
        struct smb_request *smbreq = map->req->req;
        struct smbd_server_connection *sconn = smbreq->sconn;
+       struct smbd_smb2_request *smb2req = smbreq->smb2req;
        NTSTATUS notify_status = NT_STATUS_CANCELLED;
 
+       if (smb2req != NULL) {
+               if (smb2req->session == NULL) {
+                       notify_status = STATUS_NOTIFY_CLEANUP;
+               } else if (!NT_STATUS_IS_OK(smb2req->session->status)) {
+                       notify_status = STATUS_NOTIFY_CLEANUP;
+               }
+               if (smb2req->tcon == NULL) {
+                       notify_status = STATUS_NOTIFY_CLEANUP;
+               } else if (!NT_STATUS_IS_OK(smb2req->tcon->status)) {
+                       notify_status = STATUS_NOTIFY_CLEANUP;
+               }
+       }
+
        change_notify_reply(smbreq, notify_status,
                            0, NULL, map->req->reply_fn);
        change_notify_remove_request(sconn, map->req);