From fe4125461edd4bc984d2321224fde48283d595ef Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Oct 26 2012 16:10:24 +0000 Subject: sss_parse_name_for_domains: always return the canonical domain name Domains may have a flat or short name to save some keystrokes when typing fully qualified user names. Internally sssd will always use the canonical name to allow consistent processing. --- diff --git a/src/util/usertools.c b/src/util/usertools.c index 41f7b68..b8715fe 100644 --- a/src/util/usertools.c +++ b/src/util/usertools.c @@ -355,8 +355,13 @@ int sss_parse_name_for_domains(TALLOC_CTX *memctx, if (match != NULL) { DEBUG(SSSDBG_FUNC_DATA, ("name '%s' matched expression for " "domain '%s', user is %s\n", - orig, dom->name, nmatch)); - rdomain = dmatch; + orig, match->name, nmatch)); + rdomain = talloc_strdup(tmp_ctx, match->name); + if (rdomain == NULL) { + DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + ret = ENOMEM; + goto done; + } rname = nmatch; break; } else if (candidate_name == NULL) {