summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/winbindd_pam.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index edbaa55e9b..6d27512193 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -797,8 +797,8 @@ NTSTATUS append_auth_data(struct winbindd_cli_state *state,
void winbindd_pam_auth(struct winbindd_cli_state *state)
{
struct winbindd_domain *domain;
- fstring name_domain, name_user;
- char *mapped_user = NULL;
+ fstring name_domain, name_user, mapped_user;
+ char *mapped = NULL;
NTSTATUS result;
NTSTATUS name_map_status = NT_STATUS_UNSUCCESSFUL;
@@ -822,15 +822,14 @@ void winbindd_pam_auth(struct winbindd_cli_state *state)
name_map_status = normalize_name_unmap(state->mem_ctx,
state->request->data.auth.user,
- &mapped_user);
+ &mapped);
/* If the name normalization didnt' actually do anything,
just use the original name */
- if (!NT_STATUS_IS_OK(name_map_status) &&
- !NT_STATUS_EQUAL(name_map_status, NT_STATUS_FILE_RENAMED))
- {
- mapped_user = state->request->data.auth.user;
+ if (NT_STATUS_IS_OK(name_map_status)
+ ||NT_STATUS_EQUAL(name_map_status, NT_STATUS_FILE_RENAMED)) {
+ fstrcpy(mapped_user, mapped);
}
if (!canonicalize_username(mapped_user, name_domain, name_user)) {