winbindd/idmap_ad: add support for trusted domains to idmap_ad (bug #3661)
commit9423214217558036c4c88d48efead41df48d2492
authorMichael Adam <obnox@samba.org>
Wed, 26 Nov 2008 22:09:49 +0000 (26 23:09 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 1 Dec 2008 03:26:30 +0000 (1 04:26 +0100)
tree902a9a3d9999298e25ed76f966ac689bd4953b82
parent1ffceacbc1696bcee6a5f0dc414487b305ba2b4c
winbindd/idmap_ad: add support for trusted domains to idmap_ad (bug #3661)

This initial fix does at least work for explicitly configured domains.

The patch has a few disadvantages:

1. It does work only for explicitly configured domains, not with
   the default backend (idmap backend = ad), since it relies on the
   domain name being passed in via the idmap_domain. One workaround
   for this would be to create clones of the default idmap_domain
   for domains not explicitly configured.

2. It calls find_domain_from_name_noinit() from idmap_ad_cached_connection.
   The problem here is that only the NetBIOS domain name (workgroup
   name) is passed in via the idmap_domain struct, and the module
   has to establish a connection to the domain based on that information.
   find_domain_from_name_noinit() has the disadvantage that it uses the state
   of the domain list at fork time (unless used from the main winbindd).
   But this should be ok as long as the primary domain was reachable at
   start time.

For nss_info, the situation is similar - This will only work for domains
explicitly configured in smb.conf as follows:
"winbind nss info = rfc2307:dom1 sfu:dom2 rfc2307:dom3 template:dom4"
Setting the default nss info to one of the ad backends (rfc2307, sfu, sfu20)
will fail since the domain name is not passed in with the nss_domain_entry.

Michael
source/winbindd/idmap_ad.c