ntlm_auth: Use libwbclient in get_winbind_domain()
authorVolker Lendecke <vl@samba.org>
Sat, 15 Jul 2017 08:55:09 +0000 (10:55 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 17 Nov 2017 23:09:16 +0000 (00:09 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/utils/ntlm_auth.c

index faba67c3b292c72ed901deb64cfaa3fd77b9facf..932f91c22ad2a2463fa8ecbf54c39f7e23fa0efa 100644 (file)
@@ -310,24 +310,25 @@ static char winbind_separator(void)
 
 const char *get_winbind_domain(void)
 {
 
 const char *get_winbind_domain(void)
 {
-       struct winbindd_response response;
+       struct wbcInterfaceDetails *details;
+       wbcErr ret;
 
        static fstring winbind_domain;
        if (*winbind_domain) {
                return winbind_domain;
        }
 
 
        static fstring winbind_domain;
        if (*winbind_domain) {
                return winbind_domain;
        }
 
-       ZERO_STRUCT(response);
-
        /* Send off request */
 
        /* Send off request */
 
-       if (winbindd_request_response(NULL, WINBINDD_DOMAIN_NAME, NULL, &response) !=
-           NSS_STATUS_SUCCESS) {
+       ret = wbcInterfaceDetails(&details);
+       if (!WBC_ERROR_IS_OK(ret)) {
                DEBUG(1, ("could not obtain winbind domain name!\n"));
                return lp_workgroup();
        }
 
                DEBUG(1, ("could not obtain winbind domain name!\n"));
                return lp_workgroup();
        }
 
-       fstrcpy(winbind_domain, response.data.domain_name);
+       fstrcpy(winbind_domain, details->netbios_domain);
+
+       wbcFreeMemory(details);
 
        return winbind_domain;
 
 
        return winbind_domain;