From 5084d49052f47626b61e53add818fefaacc101b0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 3 Jun 2005 15:42:03 +0000 Subject: r7243: Don't look at gencache.tdb for the trusted domains if winbind is around. Volker (This used to be commit 94acb93f57b963bf137c6ddd644a147f4d0b5175) --- source3/nsswitch/wb_client.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'source3/nsswitch/wb_client.c') diff --git a/source3/nsswitch/wb_client.c b/source3/nsswitch/wb_client.c index 6b184b568b..5005f72457 100644 --- a/source3/nsswitch/wb_client.c +++ b/source3/nsswitch/wb_client.c @@ -394,4 +394,35 @@ BOOL winbind_ping( void ) return result == NSS_STATUS_SUCCESS; } +/********************************************************************** + Is a domain trusted? + + result == NSS_STATUS_UNAVAIL: winbind not around + result == NSS_STATUS_NOTFOUND: winbind around, but domain missing + + Due to a bad API NSS_STATUS_NOTFOUND is returned both when winbind_off and + when winbind return WINBINDD_ERROR. So the semantics of this routine depends + on winbind_on. Grepping for winbind_off I just found 3 places where winbind + is turned off, and this does not conflict (as far as I have seen) with the + callers of is_trusted_domains. + + I *hate* global variables.... + + Volker + +**********************************************************************/ + +NSS_STATUS wb_is_trusted_domain(const char *domain) +{ + struct winbindd_request request; + struct winbindd_response response; + /* Call winbindd */ + + ZERO_STRUCT(request); + ZERO_STRUCT(response); + + fstrcpy(request.domain_name, domain); + + return winbindd_request(WINBINDD_DOMAIN_INFO, &request, &response); +} -- cgit