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)
committerJeremy Allison <jra@samba.org>
Wed, 6 May 2015 20:33:19 +0000 (22:33 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/notify.c

index 4f4ca2fab8f9a97a55cddf54eec876d75e94acc7..b3079d2c07805d9e087216d15f8eb5f2b8fc44b9 100644 (file)
@@ -379,8 +379,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);