summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2014-11-21 20:06:32 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-11-25 13:47:57 +0100
commite894a127a9979dea667408b0cced59fedc3bcd0a (patch)
treeaff64d42c63cbaa9a1680e31679d5a7708caf5bd
parent8394eddba54b5d3e3fda868145e3751247bdbdb2 (diff)
downloadsssd-e894a127a9979dea667408b0cced59fedc3bcd0a.zip
sssd-e894a127a9979dea667408b0cced59fedc3bcd0a.tar.gz
sssd-e894a127a9979dea667408b0cced59fedc3bcd0a.tar.xz
util: sss_get_domain_name regex mismatch not fatal
Assume name is not FQDN if sss_parse_name fails to match domain with regular expression. Fixes: https://fedorahosted.org/sssd/ticket/2487 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
-rw-r--r--src/util/usertools.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util/usertools.c b/src/util/usertools.c
index 09cfd6b..ebe139e 100644
--- a/src/util/usertools.c
+++ b/src/util/usertools.c
@@ -646,7 +646,13 @@ sss_get_domain_name(TALLOC_CTX *mem_ctx,
/* check if the name already contains domain part */
if (dom->names != NULL) {
ret = sss_parse_name(mem_ctx, dom->names, orig_name, &domain, NULL);
- if (ret != EOK) {
+ if (ret == ERR_REGEX_NOMATCH) {
+ DEBUG(SSSDBG_TRACE_FUNC,
+ "sss_parse_name could not parse domain from [%s]. "
+ "Assuming it is not FQDN.\n", orig_name);
+ } else if (ret != EOK) {
+ DEBUG(SSSDBG_TRACE_FUNC,
+ "sss_parse_name failed [%d]: %s\n", ret, sss_strerror(ret));
return NULL;
}
}