mirror of
https://github.com/samba-team/samba.git
synced 2025-07-30 19:42:05 +03:00
ntlm_auth: Use libwbclient in get_winbind_domain()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
committed by
Jeremy Allison
parent
5781cefc42
commit
25e85a4507
@ -310,24 +310,25 @@ static char winbind_separator(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;
|
||||
}
|
||||
|
||||
ZERO_STRUCT(response);
|
||||
|
||||
/* 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();
|
||||
}
|
||||
|
||||
fstrcpy(winbind_domain, response.data.domain_name);
|
||||
fstrcpy(winbind_domain, details->netbios_domain);
|
||||
|
||||
wbcFreeMemory(details);
|
||||
|
||||
return winbind_domain;
|
||||
|
||||
|
Reference in New Issue
Block a user