From ffbf393fba69d715d150fbc4f147bf0a97fbb69a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 15 Jul 2017 10:56:47 +0200 Subject: [PATCH] ntlm_auth: Use libwbclient in get_winbind_netbios_name() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/utils/ntlm_auth.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c index c0e1c2a6525..3f544902a24 100644 --- a/source3/utils/ntlm_auth.c +++ b/source3/utils/ntlm_auth.c @@ -336,7 +336,8 @@ const char *get_winbind_domain(void) const char *get_winbind_netbios_name(void) { - struct winbindd_response response; + struct wbcInterfaceDetails *details; + wbcErr ret; static fstring winbind_netbios_name; @@ -344,17 +345,17 @@ const char *get_winbind_netbios_name(void) return winbind_netbios_name; } - ZERO_STRUCT(response); - /* Send off request */ - if (winbindd_request_response(NULL, WINBINDD_NETBIOS_NAME, NULL, &response) != - NSS_STATUS_SUCCESS) { + ret = wbcInterfaceDetails(&details); + if (!WBC_ERROR_IS_OK(ret)) { DEBUG(1, ("could not obtain winbind netbios name!\n")); return lp_netbios_name(); } - fstrcpy(winbind_netbios_name, response.data.netbios_name); + fstrcpy(winbind_netbios_name, details->netbios_name); + + wbcFreeMemory(details); return winbind_netbios_name; -- 2.47.3