diff options
author | Gerald Carter <jerry@samba.org> | 2005-05-27 13:58:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:00 -0500 |
commit | af52df2f1fde76b518bf946e396bc29869aa6964 (patch) | |
tree | 4d717fa0547d95a9bc415e78e1f12a36bf698117 /source3/smbd | |
parent | d5e79de59561e614fce79a9460c3b2caaa459673 (diff) | |
download | samba-af52df2f1fde76b518bf946e396bc29869aa6964.tar.gz samba-af52df2f1fde76b518bf946e396bc29869aa6964.tar.bz2 samba-af52df2f1fde76b518bf946e396bc29869aa6964.zip |
r7020: fixing printer ace values and getting rid of false compiler warning about unitialized variable
(This used to be commit 3a91b20e4bcc78c91932e6c4394b3f6f153b2ff5)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/sesssetup.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 9fbf0b1d51..0209dc2597 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -125,6 +125,7 @@ static NTSTATUS check_guest_password(auth_serversupplied_info **server_info) return nt_status; } + if (!make_user_info_guest(&user_info)) { (auth_context->free)(&auth_context); return NT_STATUS_NO_MEMORY; @@ -146,6 +147,7 @@ static int reply_spnego_kerberos(connection_struct *conn, int length, int bufsize, DATA_BLOB *secblob) { + int map_domainuser_to_guest = 0; DATA_BLOB ticket; char *client, *p, *domain; fstring netbios_domain_name; @@ -245,14 +247,19 @@ static int reply_spnego_kerberos(connection_struct *conn, } asprintf(&user, "%s%c%s", domain, *lp_winbind_separator(), client); - /* lookup the passwd struct, create a new user if necessary */ + if (lp_map_to_guest() == MAP_TO_GUEST_ON_VALID_DOMAIN_USER ){ + map_domainuser_to_guest == 1; + fstrcpy(user,lp_guestaccount()); + pw = smb_getpwnam( user, real_username, True ); + } else { map_username( user ); pw = smb_getpwnam( user, real_username, True ); if (!pw) { + } DEBUG(1,("Username %s is invalid on this system\n",user)); SAFE_FREE(user); SAFE_FREE(client); @@ -265,16 +272,20 @@ static int reply_spnego_kerberos(connection_struct *conn, sub_set_smb_name( real_username ); reload_services(True); - - if (!NT_STATUS_IS_OK(ret = make_server_info_pw(&server_info, real_username, pw))) + if (map_domainuser_to_guest == 1) { + make_server_info_guest(&server_info); + }else{ + if (!NT_STATUS_IS_OK(ret = make_server_info_pw(&server_info, real_username, pw))) { DEBUG(1,("make_server_info_from_pw failed!\n")); SAFE_FREE(user); SAFE_FREE(client); data_blob_free(&ap_rep); + data_blob_free(&session_key); return ERROR_NT(ret); } + } /* make_server_info_pw does not set the domain. Without this we end up * with the local netbios name in substitutions for %D. */ |