summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-02-10 21:04:01 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-04-04 19:48:58 +1000
commit77e67163daaa670ee43ddbc4fd3fd3e8c3c38d49 (patch)
tree6b9598e0bffaa21174076c61fa840bfa47591587 /source3/smbd
parent841d0bc9e81dbe56352ac8b12e63e8257963936e (diff)
downloadsamba-77e67163daaa670ee43ddbc4fd3fd3e8c3c38d49.tar.gz
samba-77e67163daaa670ee43ddbc4fd3fd3e8c3c38d49.tar.bz2
samba-77e67163daaa670ee43ddbc4fd3fd3e8c3c38d49.zip
s3-auth consolidate create_local_token() into make_server_info_krb5()
This ensures that all callers don't need to each add builtin groups and privileges to the user's token Andrew Bartlett
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/sesssetup.c20
-rw-r--r--source3/smbd/smb2_sesssetup.c22
2 files changed, 5 insertions, 37 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index c5d44c6185..57b0b68be7 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -372,6 +372,7 @@ static void reply_spnego_kerberos(struct smb_request *req,
ret = make_server_info_krb5(mem_ctx,
user, domain, real_username, pw,
logon_info, map_domainuser_to_guest,
+ username_was_mapped,
&server_info);
if (!NT_STATUS_IS_OK(ret)) {
DEBUG(1, ("make_server_info_krb5 failed!\n"));
@@ -382,25 +383,6 @@ static void reply_spnego_kerberos(struct smb_request *req,
return;
}
- server_info->nss_token |= username_was_mapped;
-
- /* we need to build the token for the user. make_server_info_guest()
- already does this */
-
- if ( !server_info->security_token ) {
- ret = create_local_token( server_info );
- if ( !NT_STATUS_IS_OK(ret) ) {
- DEBUG(10,("failed to create local token: %s\n",
- nt_errstr(ret)));
- data_blob_free(&ap_rep);
- data_blob_free(&session_key);
- TALLOC_FREE( mem_ctx );
- TALLOC_FREE( server_info );
- reply_nterror(req, nt_status_squash(ret));
- return;
- }
- }
-
if (!is_partial_auth_vuid(sconn, sess_vuid)) {
sess_vuid = register_initial_vuid(sconn);
}
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 6649cfb59a..3668ab8851 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -237,29 +237,15 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session,
reload_services(smb2req->sconn->msg_ctx, smb2req->sconn->sock, true);
status = make_server_info_krb5(session,
- user, domain, real_username, pw,
- logon_info, map_domainuser_to_guest,
- &session->session_info);
+ user, domain, real_username, pw,
+ logon_info, map_domainuser_to_guest,
+ username_was_mapped,
+ &session->session_info);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("smb2: make_server_info_krb5 failed\n"));
goto fail;
}
-
- session->session_info->nss_token |= username_was_mapped;
-
- /* we need to build the token for the user. make_session_info_guest()
- already does this */
-
- if (!session->session_info->security_token ) {
- status = create_local_token(session->session_info);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10,("smb2: failed to create local token: %s\n",
- nt_errstr(status)));
- goto fail;
- }
- }
-
if ((in_security_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) ||
lp_server_signing() == Required) {
session->do_signing = true;