diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-05-06 21:09:47 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-05-09 01:02:16 +0200 |
commit | 49dbd380477f9987d2511ca3111af50f2bdd2859 (patch) | |
tree | 7d4b35b0d93d6b41272ef38916c943bfa3a7c0e2 /source4/smb_server/smb | |
parent | 865e9c45606e59e111470bbdb35943d8fceff814 (diff) | |
download | samba-49dbd380477f9987d2511ca3111af50f2bdd2859.tar.gz samba-49dbd380477f9987d2511ca3111af50f2bdd2859.tar.bz2 samba-49dbd380477f9987d2511ca3111af50f2bdd2859.zip |
s4:smb_server/smb: only create a new session with vuid == 0
metze
Diffstat (limited to 'source4/smb_server/smb')
-rw-r--r-- | source4/smb_server/smb/sesssetup.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/smb_server/smb/sesssetup.c b/source4/smb_server/smb/sesssetup.c index 57460fa72d..b26c1281dd 100644 --- a/source4/smb_server/smb/sesssetup.c +++ b/source4/smb_server/smb/sesssetup.c @@ -435,8 +435,7 @@ static void sesssetup_spnego(struct smbsrv_request *req, union smb_sesssetup *se vuid = SVAL(req->in.hdr,HDR_UID); /* lookup an existing session */ - smb_sess = smbsrv_session_find_sesssetup(req->smb_conn, vuid); - if (!smb_sess) { + if (vuid == 0) { struct gensec_security *gensec_ctx; status = samba_server_gensec_start(req, @@ -466,10 +465,17 @@ static void sesssetup_spnego(struct smbsrv_request *req, union smb_sesssetup *se status = NT_STATUS_INSUFFICIENT_RESOURCES; goto failed; } + } else { + smb_sess = smbsrv_session_find_sesssetup(req->smb_conn, vuid); } if (!smb_sess) { - status = NT_STATUS_ACCESS_DENIED; + status = NT_STATUS_DOS(ERRSRV, ERRbaduid); + goto failed; + } + + if (smb_sess->session_info) { + status = NT_STATUS_INVALID_PARAMETER; goto failed; } |