Fix bug 6966 - "allow trusted domains = no" not respected in winbind.
authorDmitry Butskoy <dmitry@butskoy.name>
Wed, 6 Apr 2011 20:52:42 +0000 (13:52 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 6 Apr 2011 22:35:47 +0000 (15:35 -0700)
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Apr  6 23:37:27 CEST 2011 on sn-devel-104
(cherry picked from commit 2db094fc32687dc2a869d753b50b2aa1636cdbd6)

source3/winbindd/winbindd.c

index 85abbd89f07d72441e6a3c897bdd6564b06bf8c3..7ff26f353906ca4cf3983089a6fb8ec50ec1653c 100644 (file)
@@ -1022,7 +1022,6 @@ bool winbindd_use_cache(void)
 
 void winbindd_register_handlers(void)
 {
-       struct tevent_timer *te;
        /* Setup signal handlers */
 
        if (!winbindd_setup_sig_term_handler(true))
@@ -1104,11 +1103,12 @@ void winbindd_register_handlers(void)
        smb_nscd_flush_user_cache();
        smb_nscd_flush_group_cache();
 
-       te = tevent_add_timer(winbind_event_context(), NULL, timeval_zero(),
-                             rescan_trusted_domains, NULL);
-       if (te == NULL) {
-               DEBUG(0, ("Could not trigger rescan_trusted_domains()\n"));
-               exit(1);
+       if (lp_allow_trusted_domains()) {
+               if (tevent_add_timer(winbind_event_context(), NULL, timeval_zero(),
+                             rescan_trusted_domains, NULL) == NULL) {
+                       DEBUG(0, ("Could not trigger rescan_trusted_domains()\n"));
+                       exit(1);
+               }
        }
 
 }