summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2016-11-22 12:07:04 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2016-12-19 23:22:30 +0100
commit7b293a5095ef3e63cd2e3f2ff01b7484bf6dcd38 (patch)
tree6927b55607293edb4b7cc942224d5e650314bade /src/util
parent35d1617655ca7270a23a716f60e7a4497cbba4ba (diff)
downloadsssd-7b293a5095ef3e63cd2e3f2ff01b7484bf6dcd38.tar.gz
sssd-7b293a5095ef3e63cd2e3f2ff01b7484bf6dcd38.tar.xz
sssd-7b293a5095ef3e63cd2e3f2ff01b7484bf6dcd38.zip
sss_output_name: do not require fq name
Now, we return the original name, assuming it is a shortname, instead of returning an error. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/usertools.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/util/usertools.c b/src/util/usertools.c
index 12fc85b8f..7b87c567a 100644
--- a/src/util/usertools.c
+++ b/src/util/usertools.c
@@ -787,7 +787,13 @@ char *sss_output_name(TALLOC_CTX *mem_ctx,
if (!tmp_ctx) return NULL;
ret = sss_parse_internal_fqname(tmp_ctx, name, &shortname, NULL);
- if (ret != EOK) {
+ if (ret == ERR_WRONG_NAME_FORMAT) {
+ /* There is no domain name. */
+ shortname = talloc_strdup(tmp_ctx, name);
+ if (shortname == NULL) {
+ goto done;
+ }
+ } else if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE, "sss_parse_internal_fqname failed\n");
goto done;
}
@@ -796,14 +802,12 @@ char *sss_output_name(TALLOC_CTX *mem_ctx,
if (outname == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE,
"sss_get_cased_name failed, skipping\n");
- ret = EIO;
goto done;
}
outname = sss_replace_space(tmp_ctx, outname, replace_space);
if (outname == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE, "sss_replace_space failed\n");
- ret = EIO;
goto done;
}