diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-03-10 09:47:11 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-03-12 09:27:37 -0700 |
commit | 4d1d288b89d259f1b69eb3ed643b86d39e03f6bf (patch) | |
tree | 9752323cd2005f48107ee12060da491890420340 /source3 | |
parent | b49893776167460d921822362e1b55abdd5cc751 (diff) | |
download | samba-4d1d288b89d259f1b69eb3ed643b86d39e03f6bf.tar.gz samba-4d1d288b89d259f1b69eb3ed643b86d39e03f6bf.tar.xz samba-4d1d288b89d259f1b69eb3ed643b86d39e03f6bf.zip |
s3:smb2_lock: return RANGE_NOT_LOCKED instead of CANCELLED for logoff and tdis
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/smb2_lock.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c index 69bc09a333..5da14e9c2d 100644 --- a/source3/smbd/smb2_lock.c +++ b/source3/smbd/smb2_lock.c @@ -383,6 +383,26 @@ static bool smbd_smb2_lock_cancel(struct tevent_req *req) remove_pending_lock(state, state->blr); tevent_req_defer_callback(req, smb2req->sconn->ev_ctx); + + /* + * If the request is canceled because of logoff, tdis or close + * the status is NT_STATUS_RANGE_NOT_LOCKED instead of + * NT_STATUS_CANCELLED. + * + * Note that the close case is handled in + * cancel_pending_lock_requests_by_fid_smb2(SHUTDOWN_CLOSE) + * for now. + */ + if (!NT_STATUS_IS_OK(smb2req->session->status)) { + tevent_req_nterror(req, NT_STATUS_RANGE_NOT_LOCKED); + return true; + } + + if (!NT_STATUS_IS_OK(smb2req->tcon->status)) { + tevent_req_nterror(req, NT_STATUS_RANGE_NOT_LOCKED); + return true; + } + tevent_req_nterror(req, NT_STATUS_CANCELLED); return true; } |