diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-05-13 23:05:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:17:02 -0500 |
commit | 8059d0ae395604503cad3d9f197928305923e3f5 (patch) | |
tree | cd8fc84c77bf03693ba47075935ee7f235af0cbf /source/smbd/sesssetup.c | |
parent | 7945c935bf197afb61286ddeb0e579078362a1fc (diff) | |
download | samba-8059d0ae395604503cad3d9f197928305923e3f5.tar.gz samba-8059d0ae395604503cad3d9f197928305923e3f5.tar.xz samba-8059d0ae395604503cad3d9f197928305923e3f5.zip |
r15589: While trying to understand the vuid code I found that security=share is broken
right now. r14112 broke it, in 3.0.22 register_vuid for security=share returns
UID_FIELD_INVALID which in current 3_0 is turned into an error condition. This
makes sure that we only call register_vuid if sec!=share and meanwhile also
fixes a little memleak.
Then I also found a crash in smbclient with sec=share and hostmsdfs=yes.
There's another crash with sec=share when coming from w2k3, but I need sleep
now.
Someone (jerry,jra?) please review the sesssetup.c change.
Thanks,
Volker
Diffstat (limited to 'source/smbd/sesssetup.c')
-rw-r--r-- | source/smbd/sesssetup.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/source/smbd/sesssetup.c b/source/smbd/sesssetup.c index 8fe01a19b34..46acb20bdad 100644 --- a/source/smbd/sesssetup.c +++ b/source/smbd/sesssetup.c @@ -1127,20 +1127,30 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf, /* register the name and uid as being validated, so further connections to a uid can get through without a password, on the same VC */ - /* register_vuid keeps the server info */ - sess_vuid = register_vuid(server_info, session_key, nt_resp.data ? nt_resp : lm_resp, sub_user); - data_blob_free(&nt_resp); - data_blob_free(&lm_resp); - - if (sess_vuid == UID_FIELD_INVALID) { - return ERROR_NT(nt_status_squash(NT_STATUS_LOGON_FAILURE)); - } + if (lp_security() == SEC_SHARE) { + sess_vuid = UID_FIELD_INVALID; + data_blob_free(&session_key); + TALLOC_FREE(server_info); + } else { + /* register_vuid keeps the server info */ + sess_vuid = register_vuid(server_info, session_key, + nt_resp.data ? nt_resp : lm_resp, + sub_user); + if (sess_vuid == UID_FIELD_INVALID) { + data_blob_free(&nt_resp); + data_blob_free(&lm_resp); + return ERROR_NT(nt_status_squash(NT_STATUS_LOGON_FAILURE)); + } - /* current_user_info is changed on new vuid */ - reload_services( True ); + /* current_user_info is changed on new vuid */ + reload_services( True ); - sessionsetup_start_signing_engine(server_info, inbuf); + sessionsetup_start_signing_engine(server_info, inbuf); + } + data_blob_free(&nt_resp); + data_blob_free(&lm_resp); + SSVAL(outbuf,smb_uid,sess_vuid); SSVAL(inbuf,smb_uid,sess_vuid); |