summaryrefslogtreecommitdiffstats
path: root/src/util/usertools.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-10-25 22:03:17 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-11-05 00:14:05 +0100
commiteee56828a74d85c54e53f829348655d98a20c85a (patch)
tree2f1b9abbfc560a30e33966a7244173a5a1b366ef /src/util/usertools.c
parent2740f251044837ea88409faa79b29bfd9716a234 (diff)
downloadsssd-eee56828a74d85c54e53f829348655d98a20c85a.tar.gz
sssd-eee56828a74d85c54e53f829348655d98a20c85a.tar.xz
sssd-eee56828a74d85c54e53f829348655d98a20c85a.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) {