summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-10-14 11:14:57 -0700
committerJeremy Allison <jra@samba.org>2009-10-14 11:14:57 -0700
commitdb29d3eb400bee78347963c8ccd057f564383e36 (patch)
tree9b6440d5f221af2da2662bd535b011a8e0a10266 /source3/winbindd
parent67b544ba968d08cd861fc2d6d5b8a0881880b0aa (diff)
downloadsamba-db29d3eb400bee78347963c8ccd057f564383e36.tar.gz
samba-db29d3eb400bee78347963c8ccd057f564383e36.tar.bz2
samba-db29d3eb400bee78347963c8ccd057f564383e36.zip
s3:winbind: Fix bug 6793 -- segfault in winbindd_pam_auth
Diffstat (limited to 'source3/winbindd')
-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)) {