diff options
author | Sumit Bose <sbose@redhat.com> | 2012-10-25 22:03:17 +0200 |
---|---|---|
committer | Sumit Bose <sbose@redhat.com> | 2012-10-26 10:32:06 +0200 |
commit | bfc3b766d8774186307dc43c187a014b4803e98c (patch) | |
tree | 5e69d0aa733892ff411e1ed5499a1502b5e3a04d | |
parent | 7c4845bd0efb1dcb44b5be52923c539316725693 (diff) | |
download | sssd2-bfc3b766d8774186307dc43c187a014b4803e98c.tar.gz sssd2-bfc3b766d8774186307dc43c187a014b4803e98c.tar.xz sssd2-bfc3b766d8774186307dc43c187a014b4803e98c.zip |
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.
-rw-r--r-- | src/util/usertools.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/util/usertools.c b/src/util/usertools.c index 41f7b680..b8715fe2 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) { |