|
|
905b4d |
From 751447267c61d70016fd9f2231096188ede8eabe Mon Sep 17 00:00:00 2001
|
|
|
905b4d |
From: Michal Zidek <mzidek@redhat.com>
|
|
|
905b4d |
Date: Fri, 21 Nov 2014 20:06:32 +0100
|
|
|
905b4d |
Subject: [PATCH 112/112] util: sss_get_domain_name regex mismatch not fatal
|
|
|
905b4d |
MIME-Version: 1.0
|
|
|
905b4d |
Content-Type: text/plain; charset=UTF-8
|
|
|
905b4d |
Content-Transfer-Encoding: 8bit
|
|
|
905b4d |
|
|
|
905b4d |
Assume name is not FQDN if sss_parse_name fails to
|
|
|
905b4d |
match domain with regular expression.
|
|
|
905b4d |
|
|
|
905b4d |
Fixes:
|
|
|
905b4d |
https://fedorahosted.org/sssd/ticket/2487
|
|
|
905b4d |
|
|
|
905b4d |
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
|
|
|
905b4d |
---
|
|
|
905b4d |
src/util/usertools.c | 8 +++++++-
|
|
|
905b4d |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
905b4d |
|
|
|
905b4d |
diff --git a/src/util/usertools.c b/src/util/usertools.c
|
|
|
905b4d |
index 09cfd6b35505b8496413258fd05808ac0d2c095b..ebe139e6cd3c9eb270033629dab362fefb3e2682 100644
|
|
|
905b4d |
--- a/src/util/usertools.c
|
|
|
905b4d |
+++ b/src/util/usertools.c
|
|
|
905b4d |
@@ -646,7 +646,13 @@ sss_get_domain_name(TALLOC_CTX *mem_ctx,
|
|
|
905b4d |
/* check if the name already contains domain part */
|
|
|
905b4d |
if (dom->names != NULL) {
|
|
|
905b4d |
ret = sss_parse_name(mem_ctx, dom->names, orig_name, &domain, NULL);
|
|
|
905b4d |
- if (ret != EOK) {
|
|
|
905b4d |
+ if (ret == ERR_REGEX_NOMATCH) {
|
|
|
905b4d |
+ DEBUG(SSSDBG_TRACE_FUNC,
|
|
|
905b4d |
+ "sss_parse_name could not parse domain from [%s]. "
|
|
|
905b4d |
+ "Assuming it is not FQDN.\n", orig_name);
|
|
|
905b4d |
+ } else if (ret != EOK) {
|
|
|
905b4d |
+ DEBUG(SSSDBG_TRACE_FUNC,
|
|
|
905b4d |
+ "sss_parse_name failed [%d]: %s\n", ret, sss_strerror(ret));
|
|
|
905b4d |
return NULL;
|
|
|
905b4d |
}
|
|
|
905b4d |
}
|
|
|
905b4d |
--
|
|
|
905b4d |
1.9.3
|
|
|
905b4d |
|