From bcd0e51e280b45e489b1111d730097816dbcaa23 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 30 Dec 2003 22:27:33 +0000 Subject: Get the DOMAIN\username around the right way (I had username\domain...) Push the unix username into utf8 for it's trip across the socket. Andrew Bartlett (This used to be commit 3225f262b18bdcf326d3bfd031dac169bd9347c9) --- source3/nsswitch/winbindd_pam.c | 6 +++--- source3/utils/ntlm_auth.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'source3') diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c index 7c4cb53dbf..94f9bf9464 100644 --- a/source3/nsswitch/winbindd_pam.c +++ b/source3/nsswitch/winbindd_pam.c @@ -382,12 +382,12 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state) nt_domain = domain; } - fill_domain_username(username_out, nt_username, nt_domain); + fill_domain_username(username_out, nt_domain, nt_username); DEBUG(5, ("Setting unix username to [%s]\n", username_out)); - state->response.extra_data = strdup(username_out); - if (!state->response.extra_data) { + /* this interface is in UTF8 */ + if (push_utf8_allocate((char **)&state->response.extra_data, username_out) == -1) { result = NT_STATUS_NO_MEMORY; goto done; } diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c index bef10b52b3..96e52964b4 100644 --- a/source3/utils/ntlm_auth.c +++ b/source3/utils/ntlm_auth.c @@ -305,7 +305,9 @@ static NTSTATUS contact_winbind_auth_crap(const char *username, } if (flags & WBFLAG_PAM_UNIX_NAME) { - *unix_name = response.extra_data; + if (pull_utf8_allocate(unix_name, (char *)response.extra_data) == -1) { + return NT_STATUS_NO_MEMORY; + } } return nt_status; -- cgit