1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

s3:passdb: Refactor lookup_name_smbconf()

This will be changed to support UPNs too in the next patch.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15054

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Andreas Schneider 2022-04-26 07:24:10 +02:00 committed by Jeremy Allison
parent ed8e466854
commit 2690310743

View File

@ -465,13 +465,14 @@ bool lookup_name_smbconf(TALLOC_CTX *mem_ctx,
struct dom_sid *ret_sid, enum lsa_SidType *ret_type) struct dom_sid *ret_sid, enum lsa_SidType *ret_type)
{ {
char *qualified_name = NULL; char *qualified_name = NULL;
const char *p; const char *p = strchr_m(full_name, *lp_winbind_separator());
bool is_qualified = p != NULL;
if ((p = strchr_m(full_name, *lp_winbind_separator())) != NULL) { if (is_qualified) {
/* The name is already qualified with a domain. */ /* The name is already qualified with a domain. */
if (*lp_winbind_separator() != '\\') { if (p != NULL && *lp_winbind_separator() != '\\') {
/* lookup_name() needs '\\' as a separator */ /* lookup_name() needs '\\' as a separator */
qualified_name = talloc_strdup(mem_ctx, full_name); qualified_name = talloc_strdup(mem_ctx, full_name);