From c8f76bfd7223512074d38379593969595642a0f8 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 1 Dec 2017 23:26:33 +0100 Subject: nsswitch: fill out wbcAuthUserInfo user_principal and dns_domain_name from info6 Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- nsswitch/libwbclient/wbc_pam.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'nsswitch') diff --git a/nsswitch/libwbclient/wbc_pam.c b/nsswitch/libwbclient/wbc_pam.c index c31220ae7eb..e4cd2963012 100644 --- a/nsswitch/libwbclient/wbc_pam.c +++ b/nsswitch/libwbclient/wbc_pam.c @@ -100,12 +100,22 @@ static wbcErr wbc_create_auth_info(const struct winbindd_response *resp, i->account_name = strdup(resp->data.auth.info3.user_name); BAIL_ON_PTR_ERROR(i->account_name, wbc_status); - i->user_principal= NULL; + if (resp->data.auth.validation_level == 6) { + i->user_principal = strdup(resp->data.auth.info6.principal_name); + BAIL_ON_PTR_ERROR(i->user_principal, wbc_status); + } else { + i->user_principal = NULL; + } i->full_name = strdup(resp->data.auth.info3.full_name); BAIL_ON_PTR_ERROR(i->full_name, wbc_status); i->domain_name = strdup(resp->data.auth.info3.logon_dom); BAIL_ON_PTR_ERROR(i->domain_name, wbc_status); - i->dns_domain_name= NULL; + if (resp->data.auth.validation_level == 6) { + i->dns_domain_name = strdup(resp->data.auth.info6.dns_domainname); + BAIL_ON_PTR_ERROR(i->dns_domain_name, wbc_status); + } else { + i->dns_domain_name = NULL; + } i->acct_flags = resp->data.auth.info3.acct_flags; memcpy(i->user_session_key, -- cgit v1.2.1