summaryrefslogtreecommitdiff
path: root/source3/nsswitch/wb_client.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-06-03 15:42:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:05 -0500
commit5084d49052f47626b61e53add818fefaacc101b0 (patch)
treedebccf837c8d847ad2cd2749b4e3da3ae340dfe8 /source3/nsswitch/wb_client.c
parenta01de91394f1723100bcd49870422e03f69afb7e (diff)
downloadsamba-5084d49052f47626b61e53add818fefaacc101b0.tar.gz
samba-5084d49052f47626b61e53add818fefaacc101b0.tar.bz2
samba-5084d49052f47626b61e53add818fefaacc101b0.zip
r7243: Don't look at gencache.tdb for the trusted domains if winbind is around.
Volker (This used to be commit 94acb93f57b963bf137c6ddd644a147f4d0b5175)
Diffstat (limited to 'source3/nsswitch/wb_client.c')
-rw-r--r--source3/nsswitch/wb_client.c31
1 files changed, 31 insertions, 0 deletions
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);
+}