|
|
6cf099 |
From eaccdcf75b651a0cc4fc02526180f5991a16c553 Mon Sep 17 00:00:00 2001
|
|
|
6cf099 |
From: Lukas Slebodnik <lslebodn@redhat.com>
|
|
|
6cf099 |
Date: Fri, 28 Aug 2015 07:07:40 +0200
|
|
|
6cf099 |
Subject: [PATCH 68/68] NSS: Don't ignore backslash in usernames with ldap
|
|
|
6cf099 |
provider
|
|
|
6cf099 |
|
|
|
6cf099 |
The regression was caused by changing default domain regex
|
|
|
6cf099 |
for ldap provider in ticket #2717
|
|
|
6cf099 |
|
|
|
6cf099 |
Resolves:
|
|
|
6cf099 |
https://fedorahosted.org/sssd/ticket/2772
|
|
|
6cf099 |
|
|
|
6cf099 |
Reviewed-by: Sumit Bose <sbose@redhat.com>
|
|
|
6cf099 |
---
|
|
|
6cf099 |
src/responder/nss/nsssrv.c | 4 ++--
|
|
|
6cf099 |
src/tests/cmocka/test_nss_srv.c | 4 ++--
|
|
|
6cf099 |
src/util/usertools.c | 11 ++++++++++-
|
|
|
6cf099 |
src/util/util.h | 3 +++
|
|
|
6cf099 |
4 files changed, 17 insertions(+), 5 deletions(-)
|
|
|
6cf099 |
|
|
|
6cf099 |
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c
|
|
|
6cf099 |
index 2b3bca892a5b9c483d1f6f099fd4a6493e9afcab..d8eff7968c4929663412aa56d08414689b921a22 100644
|
|
|
6cf099 |
--- a/src/responder/nss/nsssrv.c
|
|
|
6cf099 |
+++ b/src/responder/nss/nsssrv.c
|
|
|
6cf099 |
@@ -552,9 +552,9 @@ int nss_process_init(TALLOC_CTX *mem_ctx,
|
|
|
6cf099 |
goto fail;
|
|
|
6cf099 |
}
|
|
|
6cf099 |
|
|
|
6cf099 |
- ret = sss_names_init(nctx, nctx->rctx->cdb, NULL, &nctx->global_names);
|
|
|
6cf099 |
+ ret = sss_ad_default_names_ctx(nctx, &nctx->global_names);
|
|
|
6cf099 |
if (ret != EOK) {
|
|
|
6cf099 |
- DEBUG(SSSDBG_CRIT_FAILURE, "sss_names_init failed.\n");
|
|
|
6cf099 |
+ DEBUG(SSSDBG_CRIT_FAILURE, "sss_ad_default_names_ctx failed.\n");
|
|
|
6cf099 |
goto fail;
|
|
|
6cf099 |
}
|
|
|
6cf099 |
|
|
|
6cf099 |
diff --git a/src/tests/cmocka/test_nss_srv.c b/src/tests/cmocka/test_nss_srv.c
|
|
|
6cf099 |
index 84d3413be70bc0af433b7fd23cf7d78b4b9298f1..3cf9f06e61b9e4f13d5d755f7cbd8020194d52d6 100644
|
|
|
6cf099 |
--- a/src/tests/cmocka/test_nss_srv.c
|
|
|
6cf099 |
+++ b/src/tests/cmocka/test_nss_srv.c
|
|
|
6cf099 |
@@ -1043,8 +1043,8 @@ void test_nss_setup(struct sss_test_conf_param params[],
|
|
|
6cf099 |
nss_test_ctx->nctx = mock_nctx(nss_test_ctx);
|
|
|
6cf099 |
assert_non_null(nss_test_ctx->nctx);
|
|
|
6cf099 |
|
|
|
6cf099 |
- ret = sss_names_init(nss_test_ctx->nctx, nss_test_ctx->tctx->confdb,
|
|
|
6cf099 |
- NULL, &nss_test_ctx->nctx->global_names);
|
|
|
6cf099 |
+ ret = sss_ad_default_names_ctx(nss_test_ctx->nctx,
|
|
|
6cf099 |
+ &nss_test_ctx->nctx->global_names);
|
|
|
6cf099 |
assert_int_equal(ret, EOK);
|
|
|
6cf099 |
assert_non_null(nss_test_ctx->nctx->global_names);
|
|
|
6cf099 |
|
|
|
6cf099 |
diff --git a/src/util/usertools.c b/src/util/usertools.c
|
|
|
6cf099 |
index 87a8d7411312c3a80c32374a1fd93bbf0e767a91..ccbf7a0c8c2fb6d1d07afbfe46d978fc33093432 100644
|
|
|
6cf099 |
--- a/src/util/usertools.c
|
|
|
6cf099 |
+++ b/src/util/usertools.c
|
|
|
6cf099 |
@@ -249,7 +249,8 @@ int sss_names_init(TALLOC_CTX *mem_ctx, struct confdb_ctx *cdb,
|
|
|
6cf099 |
}
|
|
|
6cf099 |
|
|
|
6cf099 |
if (!re_pattern) {
|
|
|
6cf099 |
- re_pattern = talloc_strdup(tmpctx, IPA_AD_DEFAULT_RE);
|
|
|
6cf099 |
+ re_pattern = talloc_strdup(tmpctx,
|
|
|
6cf099 |
+ "(?P<name>[^@]+)@?(?P<domain>[^@]*$)");
|
|
|
6cf099 |
if (!re_pattern) {
|
|
|
6cf099 |
ret = ENOMEM;
|
|
|
6cf099 |
goto done;
|
|
|
6cf099 |
@@ -294,6 +295,14 @@ done:
|
|
|
6cf099 |
return ret;
|
|
|
6cf099 |
}
|
|
|
6cf099 |
|
|
|
6cf099 |
+int sss_ad_default_names_ctx(TALLOC_CTX *mem_ctx,
|
|
|
6cf099 |
+ struct sss_names_ctx **_out)
|
|
|
6cf099 |
+{
|
|
|
6cf099 |
+ return sss_names_init_from_args(mem_ctx, IPA_AD_DEFAULT_RE,
|
|
|
6cf099 |
+ CONFDB_DEFAULT_FULL_NAME_FORMAT,
|
|
|
6cf099 |
+ _out);
|
|
|
6cf099 |
+}
|
|
|
6cf099 |
+
|
|
|
6cf099 |
int sss_parse_name(TALLOC_CTX *memctx,
|
|
|
6cf099 |
struct sss_names_ctx *snctx,
|
|
|
6cf099 |
const char *orig, char **_domain, char **_name)
|
|
|
6cf099 |
diff --git a/src/util/util.h b/src/util/util.h
|
|
|
6cf099 |
index a20d1d82eb8f10dac515ad25e7e424713bb1c099..c998e91f92b0a86e0f4308ff0c07ff802588b5cf 100644
|
|
|
6cf099 |
--- a/src/util/util.h
|
|
|
6cf099 |
+++ b/src/util/util.h
|
|
|
6cf099 |
@@ -298,6 +298,9 @@ int sss_names_init(TALLOC_CTX *mem_ctx,
|
|
|
6cf099 |
const char *domain,
|
|
|
6cf099 |
struct sss_names_ctx **out);
|
|
|
6cf099 |
|
|
|
6cf099 |
+int sss_ad_default_names_ctx(TALLOC_CTX *mem_ctx,
|
|
|
6cf099 |
+ struct sss_names_ctx **_out);
|
|
|
6cf099 |
+
|
|
|
6cf099 |
int sss_parse_name(TALLOC_CTX *memctx,
|
|
|
6cf099 |
struct sss_names_ctx *snctx,
|
|
|
6cf099 |
const char *orig, char **_domain, char **_name);
|
|
|
6cf099 |
--
|
|
|
6cf099 |
2.4.3
|
|
|
6cf099 |
|