mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
s3:auth Rename user_info->internal_username -> user_info->mapped.account_name
This is closer to the structure I want for a common struct auth_usersupplied_info. Andrew Bartlett
This commit is contained in:
parent
23159453d3
commit
7a021df96d
@ -217,7 +217,7 @@ static NTSTATUS check_ntlm_password(const struct auth_context *auth_context,
|
||||
user_info->client_domain, user_info->client.account_name, user_info->workstation_name));
|
||||
|
||||
DEBUG(3, ("check_ntlm_password: mapped user is: [%s]\\[%s]@[%s]\n",
|
||||
user_info->domain, user_info->internal_username, user_info->workstation_name));
|
||||
user_info->domain, user_info->mapped.account_name, user_info->workstation_name));
|
||||
|
||||
if (auth_context->challenge.length != 8) {
|
||||
DEBUG(0, ("check_ntlm_password: Invalid challenge stored for this auth context - cannot continue\n"));
|
||||
@ -298,10 +298,10 @@ static NTSTATUS check_ntlm_password(const struct auth_context *auth_context,
|
||||
|
||||
if (NT_STATUS_IS_OK(nt_status)) {
|
||||
DEBUG((*server_info)->guest ? 5 : 2,
|
||||
("check_ntlm_password: %sauthentication for user [%s] -> [%s] -> [%s] succeeded\n",
|
||||
(*server_info)->guest ? "guest " : "",
|
||||
("check_ntlm_password: %sauthentication for user [%s] -> [%s] -> [%s] succeeded\n",
|
||||
(*server_info)->guest ? "guest " : "",
|
||||
user_info->client.account_name,
|
||||
user_info->internal_username,
|
||||
user_info->mapped.account_name,
|
||||
unix_username));
|
||||
}
|
||||
|
||||
@ -310,10 +310,10 @@ static NTSTATUS check_ntlm_password(const struct auth_context *auth_context,
|
||||
|
||||
/* failed authentication; check for guest lapping */
|
||||
|
||||
DEBUG(2, ("check_ntlm_password: Authentication for user [%s] -> [%s] FAILED with error %s\n",
|
||||
user_info->client.account_name, user_info->internal_username,
|
||||
DEBUG(2, ("check_ntlm_password: Authentication for user [%s] -> [%s] FAILED with error %s\n",
|
||||
user_info->client.account_name, user_info->mapped.account_name,
|
||||
nt_errstr(nt_status)));
|
||||
ZERO_STRUCTP(server_info);
|
||||
ZERO_STRUCTP(server_info);
|
||||
|
||||
return nt_status;
|
||||
}
|
||||
|
@ -40,10 +40,10 @@ static NTSTATUS check_guest_security(const struct auth_context *auth_context,
|
||||
/* mark this as 'not for me' */
|
||||
NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED;
|
||||
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username));
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
|
||||
|
||||
if (!(user_info->internal_username
|
||||
&& *user_info->internal_username)) {
|
||||
if (!(user_info->mapped.account_name
|
||||
&& *user_info->mapped.account_name)) {
|
||||
nt_status = make_server_info_guest(NULL, server_info);
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ static NTSTATUS check_name_to_ntstatus_security(const struct auth_context *auth_
|
||||
fstring user;
|
||||
long error_num;
|
||||
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username));
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
|
||||
|
||||
fstrcpy(user, user_info->client.account_name);
|
||||
|
||||
|
@ -393,7 +393,7 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context,
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username));
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
|
||||
|
||||
/*
|
||||
* Check that the requested domain is not our own machine name.
|
||||
@ -463,7 +463,7 @@ static NTSTATUS check_trustdomain_security(const struct auth_context *auth_conte
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username));
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
|
||||
|
||||
/*
|
||||
* Check that the requested domain is not our own machine name or domain name.
|
||||
|
@ -170,7 +170,7 @@ static NTSTATUS check_netlogond_security(const struct auth_context *auth_context
|
||||
struct named_mutex *mutex = NULL;
|
||||
const char *ncalrpcsock;
|
||||
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username));
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
|
||||
|
||||
ncalrpcsock = lp_parm_const_string(
|
||||
GLOBAL_SECTION_SNUM, "auth_netlogond", "socket", NULL);
|
||||
|
@ -72,7 +72,7 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context,
|
||||
return NT_STATUS_LOGON_FAILURE;
|
||||
}
|
||||
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username));
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
|
||||
|
||||
is_local_name = is_myname(user_info->domain);
|
||||
is_my_domain = strequal(user_info->domain, lp_workgroup());
|
||||
|
@ -281,7 +281,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context
|
||||
NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED;
|
||||
bool locally_made_cli = False;
|
||||
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username));
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
|
||||
|
||||
cli = state->cli;
|
||||
|
||||
@ -427,7 +427,7 @@ use this machine as the password server.\n"));
|
||||
fstring real_username;
|
||||
struct passwd *pass;
|
||||
|
||||
if ( (pass = smb_getpwnam( NULL, user_info->internal_username,
|
||||
if ( (pass = smb_getpwnam( NULL, user_info->mapped.account_name,
|
||||
real_username, True )) != NULL )
|
||||
{
|
||||
/* if a real user check pam account restrictions */
|
||||
|
@ -91,15 +91,15 @@ static NTSTATUS check_unix_security(const struct auth_context *auth_context,
|
||||
NTSTATUS nt_status;
|
||||
struct passwd *pass = NULL;
|
||||
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->internal_username));
|
||||
DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
|
||||
|
||||
become_root();
|
||||
pass = Get_Pwnam_alloc(talloc_tos(), user_info->internal_username);
|
||||
pass = Get_Pwnam_alloc(talloc_tos(), user_info->mapped.account_name);
|
||||
|
||||
/** @todo This call assumes a ASCII password, no charset transformation is
|
||||
done. We may need to revisit this **/
|
||||
nt_status = pass_check(pass,
|
||||
pass ? pass->pw_name : user_info->internal_username,
|
||||
pass ? pass->pw_name : user_info->mapped.account_name,
|
||||
(char *)user_info->plaintext_password.data,
|
||||
user_info->plaintext_password.length-1,
|
||||
lp_update_encrypted() ?
|
||||
|
@ -61,7 +61,7 @@ static NTSTATUS check_wbc_security(const struct auth_context *auth_context,
|
||||
}
|
||||
/* Send off request */
|
||||
|
||||
DEBUG(10, ("Check auth for: [%s]", user_info->internal_username));
|
||||
DEBUG(10, ("Check auth for: [%s]", user_info->mapped.account_name));
|
||||
|
||||
params.account_name = user_info->client.account_name;
|
||||
params.domain_name = user_info->domain;
|
||||
@ -73,13 +73,13 @@ static NTSTATUS check_wbc_security(const struct auth_context *auth_context,
|
||||
/* Handle plaintext */
|
||||
if (!user_info->encrypted) {
|
||||
DEBUG(3,("Checking plaintext password for %s.\n",
|
||||
user_info->internal_username));
|
||||
user_info->mapped.account_name));
|
||||
params.level = WBC_AUTH_USER_LEVEL_PLAIN;
|
||||
|
||||
params.password.plaintext = (char *)user_info->plaintext_password.data;
|
||||
} else {
|
||||
DEBUG(3,("Checking encrypted password for %s.\n",
|
||||
user_info->internal_username));
|
||||
user_info->mapped.account_name));
|
||||
params.level = WBC_AUTH_USER_LEVEL_RESPONSE;
|
||||
|
||||
memcpy(params.password.response.challenge,
|
||||
|
@ -43,11 +43,11 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
DEBUG(10, ("Check auth for: [%s]", user_info->internal_username));
|
||||
DEBUG(10, ("Check auth for: [%s]", user_info->mapped.account_name));
|
||||
|
||||
if (!auth_context) {
|
||||
DEBUG(3,("Password for user %s cannot be checked because we have no auth_info to get the challenge from.\n",
|
||||
user_info->internal_username));
|
||||
user_info->mapped.account_name));
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
@ -388,12 +388,12 @@ NTSTATUS check_sam_security(const DATA_BLOB *challenge,
|
||||
/* get the account information */
|
||||
|
||||
become_root();
|
||||
ret = pdb_getsampwnam(sampass, user_info->internal_username);
|
||||
ret = pdb_getsampwnam(sampass, user_info->mapped.account_name);
|
||||
unbecome_root();
|
||||
|
||||
if (ret == False) {
|
||||
DEBUG(3,("check_sam_security: Couldn't find user '%s' in "
|
||||
"passdb.\n", user_info->internal_username));
|
||||
"passdb.\n", user_info->mapped.account_name));
|
||||
TALLOC_FREE(sampass);
|
||||
return NT_STATUS_NO_SUCH_USER;
|
||||
}
|
||||
|
@ -58,8 +58,8 @@ NTSTATUS make_user_info(struct auth_usersupplied_info **user_info,
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
(*user_info)->internal_username = SMB_STRDUP(internal_username);
|
||||
if ((*user_info)->internal_username == NULL) {
|
||||
(*user_info)->mapped.account_name = SMB_STRDUP(internal_username);
|
||||
if ((*user_info)->mapped.account_name == NULL) {
|
||||
free_user_info(user_info);
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
@ -118,7 +118,7 @@ void free_user_info(struct auth_usersupplied_info **user_info)
|
||||
(*user_info)->client.account_name));
|
||||
}
|
||||
SAFE_FREE((*user_info)->client.account_name);
|
||||
SAFE_FREE((*user_info)->internal_username);
|
||||
SAFE_FREE((*user_info)->mapped.account_name);
|
||||
SAFE_FREE((*user_info)->client_domain);
|
||||
SAFE_FREE((*user_info)->domain);
|
||||
SAFE_FREE((*user_info)->workstation_name);
|
||||
|
@ -29,7 +29,7 @@ struct auth_usersupplied_info {
|
||||
bool encrypted;
|
||||
struct {
|
||||
char *account_name; /* username before mapping */
|
||||
} client;
|
||||
} client, mapped;
|
||||
|
||||
bool was_mapped; /* Did the username map actually match? */
|
||||
char *client_domain; /* domain name string */
|
||||
|
Loading…
x
Reference in New Issue
Block a user