summaryrefslogtreecommitdiff
path: root/source3/smbd/notify.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-12-21 14:47:06 +0100
committerJeremy Allison <jra@samba.org>2017-12-21 19:12:09 +0100
commitcfaba684785529d656138df454165aa08a775a01 (patch)
tree9f08838419e7e1b9f120feca194485f06f4b5674 /source3/smbd/notify.c
parentf60af3b61c4a374d7d1c575049a932d1824489b6 (diff)
downloadsamba-cfaba684785529d656138df454165aa08a775a01.tar.gz
s3:smbd: return the correct error for cancelled SMB2 notifies on expired sessions
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13197 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd/notify.c')
-rw-r--r--source3/smbd/notify.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c
index f64185dc2d2..add59089187 100644
--- a/source3/smbd/notify.c
+++ b/source3/smbd/notify.c
@@ -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;