diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-12-07 07:14:13 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:47:10 -0500 |
commit | 3edfa552a28e002dda3baa7c7117bbbe8dfccae7 (patch) | |
tree | 798b364232b941c6839560aa049c972e1af7dfd1 /source4/smb_server | |
parent | 25f82c19f6b540bcdbeeb0e9c411e05f52100392 (diff) | |
download | samba-3edfa552a28e002dda3baa7c7117bbbe8dfccae7.tar.gz samba-3edfa552a28e002dda3baa7c7117bbbe8dfccae7.tar.bz2 samba-3edfa552a28e002dda3baa7c7117bbbe8dfccae7.zip |
r12113: in SMB2 we should only allocate a new session
when the client sends UID = 0, otherwise we return
NT_STATUS_USER_SESSION_DELETED
metze
(This used to be commit 15973be48e3da0a49130911b9d3f192338c23783)
Diffstat (limited to 'source4/smb_server')
-rw-r--r-- | source4/smb_server/smb2/sesssetup.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/smb_server/smb2/sesssetup.c b/source4/smb_server/smb2/sesssetup.c index 288671ddd3..b263196165 100644 --- a/source4/smb_server/smb2/sesssetup.c +++ b/source4/smb_server/smb2/sesssetup.c @@ -29,7 +29,7 @@ static NTSTATUS smb2srv_sesssetup_backend(struct smb2srv_request *req, struct smb2_session_setup *io) { - NTSTATUS status = NT_STATUS_ACCESS_DENIED; + NTSTATUS status; struct smbsrv_session *smb_sess = NULL; struct auth_session_info *session_info = NULL; uint64_t vuid; @@ -40,8 +40,8 @@ static NTSTATUS smb2srv_sesssetup_backend(struct smb2srv_request *req, struct sm vuid = BVAL(req->in.hdr, SMB2_HDR_UID); - /* TODO: we're stricter than the SMB version till we have - * SMB2-CONTEXT test + /* + * only when we got '0' we should allocate a new session */ if (vuid == 0) { struct gensec_security *gensec_ctx; @@ -67,10 +67,10 @@ static NTSTATUS smb2srv_sesssetup_backend(struct smb2srv_request *req, struct sm /* allocate a new session */ smb_sess = smbsrv_session_new(req->smb_conn, gensec_ctx); + NT_STATUS_HAVE_NO_MEMORY(smb_sess); status = smbsrv_smb2_init_tcons(smb_sess); if (!NT_STATUS_IS_OK(status)) { - talloc_free(smb_sess); - smb_sess = NULL; + goto failed; } } else { /* lookup an existing session */ @@ -78,7 +78,7 @@ static NTSTATUS smb2srv_sesssetup_backend(struct smb2srv_request *req, struct sm } if (!smb_sess) { - return NT_STATUS_ACCESS_DENIED; + return NT_STATUS_USER_SESSION_DELETED; } if (!smb_sess->gensec_ctx) { |