summaryrefslogtreecommitdiff
path: root/source3/nsswitch/pam_winbind.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch/pam_winbind.c')
-rw-r--r--source3/nsswitch/pam_winbind.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index 89db0773ae..81f5227410 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -1341,9 +1341,10 @@ static int winbind_auth_request(pam_handle_t * pamh,
/* If winbindd returned a username, return the pointer to it
* here. */
- if (user_ret && response.extra_data.data) {
+ if (user_ret && response.data.auth.unix_username[0]) {
/* We have to trust it's a null terminated string. */
- *user_ret = (char *)response.extra_data.data;
+ *user_ret = strndup(response.data.auth.unix_username,
+ sizeof(response.data.auth.unix_username) - 1);
}
}