summaryrefslogtreecommitdiffstats
path: root/src/util/usertools.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-10-25 22:03:17 +0200
committerSimo Sorce <simo@redhat.com>2012-10-26 12:10:24 -0400
commitfe4125461edd4bc984d2321224fde48283d595ef (patch)
treee6f2f3a8cae26d1fc766a84ab4ea308aa05558ed /src/util/usertools.c
parent541ba2d4824aecb28006526d2c6a407e6a519804 (diff)
downloadsssd-fe4125461edd4bc984d2321224fde48283d595ef.tar.gz
sssd-fe4125461edd4bc984d2321224fde48283d595ef.tar.xz
sssd-fe4125461edd4bc984d2321224fde48283d595ef.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.
Diffstat (limited to 'src/util/usertools.c')
-rw-r--r--src/util/usertools.c9
1 files 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) {