From eee56828a74d85c54e53f829348655d98a20c85a Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Thu, 25 Oct 2012 22:03:17 +0200 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. --- src/util/usertools.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/util/usertools.c b/src/util/usertools.c index 41f7b6803..b8715fe23 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) { -- cgit