summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_sesssetup.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-02-21 10:25:52 +0100
committerAndrew Bartlett <abartlet@samba.org>2011-02-22 16:20:10 +1100
commit2e69e894566d32001120d76d7ba58cdacb56d279 (patch)
tree2ac3ab5945d6bc9ed9ac4757c05dd8a72057e1ec /source3/smbd/smb2_sesssetup.c
parent985c7da604ac30e67ee4b5a829935074900d6f26 (diff)
downloadsamba-2e69e894566d32001120d76d7ba58cdacb56d279.tar.gz
samba-2e69e894566d32001120d76d7ba58cdacb56d279.tar.bz2
samba-2e69e894566d32001120d76d7ba58cdacb56d279.zip
s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
These variables, of type struct auth_serversupplied_info were poorly named when added into 2001, and in good consistant practice, this has extended all over the codebase in the years since. The structure is also not ideal for it's current purpose. Originally intended to convey the results of the authentication modules, it really describes all the essential attributes of a session. This rename will reduce the volume of a future patch to replaced these with a struct auth_session_info, with auth_serversupplied_info confined to the lower levels of the auth subsystem, and then eliminated. (The new structure will be the output of create_local_token(), and the change in struct definition will ensure that this is always run, populating local groups and privileges). Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/smbd/smb2_sesssetup.c')
-rw-r--r--source3/smbd/smb2_sesssetup.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 7d029151bc..d1ebe9b673 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -146,20 +146,20 @@ static int smbd_smb2_session_destructor(struct smbd_smb2_session *session)
return 0;
}
-static NTSTATUS setup_ntlmssp_server_info(struct smbd_smb2_session *session,
+static NTSTATUS setup_ntlmssp_session_info(struct smbd_smb2_session *session,
NTSTATUS status)
{
if (NT_STATUS_IS_OK(status)) {
- status = auth_ntlmssp_steal_server_info(session,
+ status = auth_ntlmssp_steal_session_info(session,
session->auth_ntlmssp_state,
- &session->server_info);
+ &session->session_info);
} else {
- /* Note that this server_info won't have a session
+ /* Note that this session_info won't have a session
* key. But for map to guest, that's exactly the right
* thing - we can't reasonably guess the key the
* client wants, as the password was wrong */
status = do_map_to_guest(status,
- &session->server_info,
+ &session->session_info,
auth_ntlmssp_get_username(session->auth_ntlmssp_state),
auth_ntlmssp_get_domain(session->auth_ntlmssp_state));
}
@@ -236,20 +236,20 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session,
status = make_server_info_krb5(session,
user, domain, real_username, pw,
logon_info, map_domainuser_to_guest,
- &session->server_info);
+ &session->session_info);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("smb2: make_server_info_krb5 failed\n"));
goto fail;
}
- session->server_info->nss_token |= username_was_mapped;
+ session->session_info->nss_token |= username_was_mapped;
- /* we need to build the token for the user. make_server_info_guest()
+ /* we need to build the token for the user. make_session_info_guest()
already does this */
- if (!session->server_info->security_token ) {
- status = create_local_token(session->server_info);
+ 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)));
@@ -262,7 +262,7 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session,
session->do_signing = true;
}
- if (session->server_info->guest) {
+ if (session->session_info->guest) {
/* we map anonymous to guest internally */
*out_session_flags |= SMB2_SESSION_FLAG_IS_GUEST;
*out_session_flags |= SMB2_SESSION_FLAG_IS_NULL;
@@ -270,19 +270,19 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session,
session->do_signing = false;
}
- data_blob_free(&session->server_info->user_session_key);
- session->server_info->user_session_key =
+ data_blob_free(&session->session_info->user_session_key);
+ session->session_info->user_session_key =
data_blob_talloc(
- session->server_info,
+ session->session_info,
session_key.data,
session_key.length);
if (session_key.length > 0) {
- if (session->server_info->user_session_key.data == NULL) {
+ if (session->session_info->user_session_key.data == NULL) {
status = NT_STATUS_NO_MEMORY;
goto fail;
}
}
- session->session_key = session->server_info->user_session_key;
+ session->session_key = session->session_info->user_session_key;
session->compat_vuser = talloc_zero(session, user_struct);
if (session->compat_vuser == NULL) {
@@ -291,19 +291,19 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session,
}
session->compat_vuser->auth_ntlmssp_state = NULL;
session->compat_vuser->homes_snum = -1;
- session->compat_vuser->server_info = session->server_info;
+ session->compat_vuser->session_info = session->session_info;
session->compat_vuser->session_keystr = NULL;
session->compat_vuser->vuid = session->vuid;
DLIST_ADD(session->sconn->smb1.sessions.validated_users, session->compat_vuser);
/* This is a potentially untrusted username */
alpha_strcpy(tmp, user, ". _-$", sizeof(tmp));
- session->server_info->sanitized_username =
- talloc_strdup(session->server_info, tmp);
+ session->session_info->sanitized_username =
+ talloc_strdup(session->session_info, tmp);
- if (!session->server_info->guest) {
+ if (!session->session_info->guest) {
session->compat_vuser->homes_snum =
- register_homes_share(session->server_info->unix_name);
+ register_homes_share(session->session_info->unix_name);
}
if (!session_claim(session->sconn, session->compat_vuser)) {
@@ -480,7 +480,7 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s
session->do_signing = true;
}
- if (session->server_info->guest) {
+ if (session->session_info->guest) {
/* we map anonymous to guest internally */
*out_session_flags |= SMB2_SESSION_FLAG_IS_GUEST;
*out_session_flags |= SMB2_SESSION_FLAG_IS_NULL;
@@ -488,7 +488,7 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s
session->do_signing = false;
}
- session->session_key = session->server_info->user_session_key;
+ session->session_key = session->session_info->user_session_key;
session->compat_vuser = talloc_zero(session, user_struct);
if (session->compat_vuser == NULL) {
@@ -498,7 +498,7 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s
}
session->compat_vuser->auth_ntlmssp_state = session->auth_ntlmssp_state;
session->compat_vuser->homes_snum = -1;
- session->compat_vuser->server_info = session->server_info;
+ session->compat_vuser->session_info = session->session_info;
session->compat_vuser->session_keystr = NULL;
session->compat_vuser->vuid = session->vuid;
DLIST_ADD(session->sconn->smb1.sessions.validated_users, session->compat_vuser);
@@ -508,12 +508,12 @@ static NTSTATUS smbd_smb2_common_ntlmssp_auth_return(struct smbd_smb2_session *s
auth_ntlmssp_get_username(session->auth_ntlmssp_state),
". _-$",
sizeof(tmp));
- session->server_info->sanitized_username = talloc_strdup(
- session->server_info, tmp);
+ session->session_info->sanitized_username = talloc_strdup(
+ session->session_info, tmp);
- if (!session->compat_vuser->server_info->guest) {
+ if (!session->compat_vuser->session_info->guest) {
session->compat_vuser->homes_snum =
- register_homes_share(session->server_info->unix_name);
+ register_homes_share(session->session_info->unix_name);
}
if (!session_claim(session->sconn, session->compat_vuser)) {
@@ -624,11 +624,11 @@ static NTSTATUS smbd_smb2_spnego_auth(struct smbd_smb2_session *session,
status = auth_ntlmssp_update(session->auth_ntlmssp_state,
auth,
&auth_out);
- /* We need to call setup_ntlmssp_server_info() if status==NT_STATUS_OK,
+ /* We need to call setup_ntlmssp_session_info() if status==NT_STATUS_OK,
or if status is anything except NT_STATUS_MORE_PROCESSING_REQUIRED,
as this can trigger map to guest. */
if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
- status = setup_ntlmssp_server_info(session, status);
+ status = setup_ntlmssp_session_info(session, status);
}
if (!NT_STATUS_IS_OK(status) &&
@@ -706,7 +706,7 @@ static NTSTATUS smbd_smb2_raw_ntlmssp_auth(struct smbd_smb2_session *session,
return status;
}
- status = setup_ntlmssp_server_info(session, status);
+ status = setup_ntlmssp_session_info(session, status);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(session->auth_ntlmssp_state);
@@ -857,9 +857,9 @@ NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req)
return NT_STATUS_ACCESS_DENIED;
}
- set_current_user_info(session->server_info->sanitized_username,
- session->server_info->unix_name,
- session->server_info->info3->base.domain.string);
+ set_current_user_info(session->session_info->sanitized_username,
+ session->session_info->unix_name,
+ session->session_info->info3->base.domain.string);
req->session = session;