From 4f147388c0512fc291cc53764c017d7117154afc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 2 Aug 2009 10:43:05 +0200 Subject: Refactor 9b78af1f: Fix lookupname recursion Pass a "flags" argument instead of the original winbind command down the name_to_sid chain. This way we are independent of the winbind commands and can take the decision at a much higher level --- source3/winbindd/winbindd_util.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source3/winbindd/winbindd_util.c') diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 99b4542f0b..c564ef9f51 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -886,9 +886,14 @@ bool winbindd_lookup_sid_by_name(TALLOC_CTX *mem_ctx, { NTSTATUS result; - /* Lookup name */ - result = domain->methods->name_to_sid(domain, mem_ctx, orig_cmd, - domain_name, name, sid, type); + /* + * For all but LOOKUPNAME we have to avoid nss calls to avoid + * recursion + */ + result = domain->methods->name_to_sid( + domain, mem_ctx, domain_name, name, + orig_cmd == WINBINDD_LOOKUPNAME ? 0 : LOOKUP_NAME_NO_NSS, + sid, type); /* Return sid and type if lookup successful */ if (!NT_STATUS_IS_OK(result)) { -- cgit