diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-11-13 11:50:14 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-12-04 05:45:09 +0100 |
commit | a9a39953c785e76f67ce72c776b36ad1e0130ded (patch) | |
tree | 47a003d19cefa901a943c8db6090279816a7729e /source3/smbd/smb2_server.c | |
parent | c22d521d26a75a71f940088b5a01d7fa924efd88 (diff) | |
download | samba-a9a39953c785e76f67ce72c776b36ad1e0130ded.tar.gz samba-a9a39953c785e76f67ce72c776b36ad1e0130ded.tar.xz samba-a9a39953c785e76f67ce72c776b36ad1e0130ded.zip |
s3:smb2_server: allow smbd_smb2_send_break() with session == NULL and tcon == NULL
In future we want to use this for lease breaks and they're not attached
to a session.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd/smb2_server.c')
-rw-r--r-- | source3/smbd/smb2_server.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 138765e5a8..4a3ea7d425 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -2735,14 +2735,19 @@ static NTSTATUS smbd_smb2_send_break(struct smbXsrv_connection *xconn, size_t body_len) { struct smbd_smb2_send_break_state *state; - bool do_encryption = session->global->encryption_required; + bool do_encryption = false; + uint64_t session_wire_id = 0; uint64_t nonce_high = 0; uint64_t nonce_low = 0; NTSTATUS status; size_t statelen; - if (tcon->global->encryption_required) { - do_encryption = true; + if (session != NULL) { + session_wire_id = session->global->session_wire_id; + do_encryption = session->global->encryption_required; + if (tcon->global->encryption_required) { + do_encryption = true; + } } statelen = offsetof(struct smbd_smb2_send_break_state, body) + @@ -2768,7 +2773,7 @@ static NTSTATUS smbd_smb2_send_break(struct smbXsrv_connection *xconn, SIVAL(state->tf, SMB2_TF_PROTOCOL_ID, SMB2_TF_MAGIC); SBVAL(state->tf, SMB2_TF_NONCE+0, nonce_low); SBVAL(state->tf, SMB2_TF_NONCE+8, nonce_high); - SBVAL(state->tf, SMB2_TF_SESSION_ID, session->global->session_wire_id); + SBVAL(state->tf, SMB2_TF_SESSION_ID, session_wire_id); SIVAL(state->hdr, 0, SMB2_MAGIC); SSVAL(state->hdr, SMB2_HDR_LENGTH, SMB2_HDR_BODY); |