From 6361d151a4c2fa96b84347ccd76f0748e8ecb1bf Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 4 Aug 2006 21:07:32 +0000 Subject: r17406: We need to do a translation of winbind separator -> '\\' in lookup_name_smbconf, otherwise force user = domain+administrator can not work. Also attempt to fix the 'valid users = domain+group' bug at the same time. Volker (This used to be commit 255475901c13fde29b1b476560d969cc99712767) --- source3/passdb/lookup_sid.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source3/passdb/lookup_sid.c') diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index 567ddac3db..d4c1ff2059 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -395,8 +395,25 @@ BOOL lookup_name_smbconf(TALLOC_CTX *mem_ctx, char *qualified_name; /* NB. No winbindd_separator here as lookup_name needs \\' */ - if (strchr_m(full_name, '\\')) { + if (strchr_m(full_name, *lp_winbind_separator())) { + /* The name is already qualified with a domain. */ + + if (*lp_winbind_separator() != '\\') { + char *p, *tmp; + + /* lookup_name() needs '\\' as a separator */ + + tmp = talloc_strdup(mem_ctx, full_name); + if (!tmp) { + return False; + } + p = strchr_m(tmp, *lp_winbind_separator()); + SMB_ASSERT(p != NULL); + *p = '\\'; + full_name = tmp; + } + return lookup_name(mem_ctx, full_name, flags, ret_domain, ret_name, ret_sid, ret_type); -- cgit