Enumerating from trusted domain - fix to winbindd_util.c

Ken Cross kcross at nssolutions.com
Tue Feb 11 17:44:54 GMT 2003


You may or may not have noticed, but wbinfo -m doesn't work on
SAMBA_3_0, and -u or -g don't return users/groups from trusted domains.

The problem was in winbindd_util.c.  init_domain_list would reset the
list using free_domain_list and then call rescan_trusted_domains.  But
if it wasn't time to rescan the list (every 5 minutes),
rescan_trusted_domains didn't do anything.

The patch below resets the time from init_domain_list to force
rescan_trusted_domains to actually do it.

An alternate (and preferable) fix would be to add a "force_rescan"
argument to rescan_trusted_domains, but that would have been a slightly
bigger deal to patch.

Ken Cross
Network Storage Solutions

Index: winbindd_util.c
RCS file: /cvsroot/samba/source/nsswitch/winbindd_util.c,v
retrieving revision
diff -p -u -r1.73.2.13 winbindd_util.c
--- winbindd_util.c     15 Jan 2003 23:32:47 -0000
+++ winbindd_util.c     11 Feb 2003 17:35:00 -0000
@@ -146,11 +146,11 @@ static struct winbindd_domain *add_trust
   rescan our domains looking for new trusted domains
+static time_t last_scan;
 void rescan_trusted_domains(void)
        struct winbindd_domain *domain;
        TALLOC_CTX *mem_ctx;
-       static time_t last_scan;
        time_t t = time(NULL);
        /* trusted domains might be disabled */
@@ -217,6 +217,7 @@ BOOL init_domain_list(void)
        /* do an initial scan for trusted domains */
+       last_scan = 0;   /* KJC Force a rescan to occur */
        return True;

More information about the samba-technical mailing list