nsswitch: fill out wbcAuthUserInfo user_principal and dns_domain_name from info6
authorRalph Boehme <slow@samba.org>
Fri, 1 Dec 2017 22:26:33 +0000 (23:26 +0100)
committerRalph Boehme <slow@samba.org>
Sat, 13 Jan 2018 07:24:09 +0000 (08:24 +0100)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
nsswitch/libwbclient/wbc_pam.c

index c31220a..e4cd296 100644 (file)
@@ -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,