Fix loop with nscd and NSS recusive calls.
authorjerry <jerry@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Wed, 30 May 2007 19:47:35 +0000 (19:47 +0000)
committerjerry <jerry@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Wed, 30 May 2007 19:47:35 +0000 (19:47 +0000)
commit979199ccf7150c6ffcd0999a792be965ea83ed94
tree1c6b99fc82aefde547968f6db0468e14adbe77de
parent11d5b81e3ceaf9f27286c95c694582453c088eeb
Fix loop with nscd and NSS recusive calls.

> Here's the problem I hit:
>
> getgrnam("foo") -> nscd -> NSS -> winbindd ->
>   winbindd_passdb.c:nam_to_sid() -> lookup_global_sam_name() ->
>   getgrnam("foo") -> nscd -> ....
>
> This is in the SAMBA_3_0 specifically but in theory could happen
> SAMBA_3_0_25 (or 26) for an unknown group.
>
> The attached patch passes down enough state for the
> name_to_sid() call to be able to determine the originating
> winbindd cmd that came into the parent.  So we can avoid
> making more NSS calls if the original call came in trough NSS
> so we don't deadlock ?  But you should still service
> lookupname() calls which are needed for example when
> doing the token access checks for a "valid groups" from
> smb.conf.
>
> I've got this in testing now.  The problem has shown up with the
> DsProvider on OS X and with nscd on SOlaris and Linux.

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_3_0@23244 0c0555d6-39d7-0310-84fc-f1cc0bd64818
13 files changed:
source/include/smb.h
source/nsswitch/winbindd.h
source/nsswitch/winbindd_async.c
source/nsswitch/winbindd_cache.c
source/nsswitch/winbindd_group.c
source/nsswitch/winbindd_nss.h
source/nsswitch/winbindd_passdb.c
source/nsswitch/winbindd_reconnect.c
source/nsswitch/winbindd_rpc.c
source/nsswitch/winbindd_sid.c
source/nsswitch/winbindd_user.c
source/nsswitch/winbindd_util.c
source/passdb/lookup_sid.c