|
|
bcb322 |
From 63bc622a1c6558f7dd51645031f95d0890aeec7c Mon Sep 17 00:00:00 2001
|
|
|
bcb322 |
From: Tomas Halman <thalman@redhat.com>
|
|
|
bcb322 |
Date: Wed, 19 Aug 2020 15:17:44 +0200
|
|
|
bcb322 |
Subject: [PATCH] UTIL: Use sss_sanitize_dn where we deal with DN 2
|
|
|
bcb322 |
|
|
|
bcb322 |
Tests show that also ldb_dn_get_linearized can
|
|
|
bcb322 |
return DN with extra spaces. We have to trim that too.
|
|
|
bcb322 |
|
|
|
bcb322 |
Resolves:
|
|
|
bcb322 |
https://github.com/SSSD/sssd/issues/5261
|
|
|
bcb322 |
(cherry picked from commit 12bbd26e6c551d59793ba9a02a1d7cae4062f189)
|
|
|
bcb322 |
---
|
|
|
bcb322 |
src/ldb_modules/memberof.c | 6 +++---
|
|
|
bcb322 |
src/providers/ldap/ldap_id_cleanup.c | 2 +-
|
|
|
bcb322 |
2 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
bcb322 |
|
|
|
bcb322 |
diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c
|
|
|
bcb322 |
index dae51938b..5de3b7c3b 100644
|
|
|
bcb322 |
--- a/src/ldb_modules/memberof.c
|
|
|
bcb322 |
+++ b/src/ldb_modules/memberof.c
|
|
|
bcb322 |
@@ -1364,7 +1364,7 @@ static int memberof_del(struct ldb_module *module, struct ldb_request *req)
|
|
|
bcb322 |
return LDB_ERR_OPERATIONS_ERROR;
|
|
|
bcb322 |
}
|
|
|
bcb322 |
|
|
|
bcb322 |
- sret = sss_filter_sanitize(del_ctx, dn, &clean_dn);
|
|
|
bcb322 |
+ sret = sss_filter_sanitize_dn(del_ctx, dn, &clean_dn);
|
|
|
bcb322 |
if (sret != 0) {
|
|
|
bcb322 |
talloc_free(ctx);
|
|
|
bcb322 |
return LDB_ERR_OPERATIONS_ERROR;
|
|
|
bcb322 |
@@ -1781,7 +1781,7 @@ static int mbof_del_execute_op(struct mbof_del_operation *delop)
|
|
|
bcb322 |
return LDB_ERR_OPERATIONS_ERROR;
|
|
|
bcb322 |
}
|
|
|
bcb322 |
|
|
|
bcb322 |
- ret = sss_filter_sanitize(del_ctx, dn, &clean_dn);
|
|
|
bcb322 |
+ ret = sss_filter_sanitize_dn(del_ctx, dn, &clean_dn);
|
|
|
bcb322 |
if (ret != 0) {
|
|
|
bcb322 |
return LDB_ERR_OPERATIONS_ERROR;
|
|
|
bcb322 |
}
|
|
|
bcb322 |
@@ -3054,7 +3054,7 @@ static int mbof_get_ghost_from_parent(struct mbof_mod_del_op *igh)
|
|
|
bcb322 |
return LDB_ERR_OPERATIONS_ERROR;
|
|
|
bcb322 |
}
|
|
|
bcb322 |
|
|
|
bcb322 |
- ret = sss_filter_sanitize(igh, dn, &clean_dn);
|
|
|
bcb322 |
+ ret = sss_filter_sanitize_dn(igh, dn, &clean_dn);
|
|
|
bcb322 |
if (ret != 0) {
|
|
|
bcb322 |
return LDB_ERR_OPERATIONS_ERROR;
|
|
|
bcb322 |
}
|
|
|
bcb322 |
diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c
|
|
|
bcb322 |
index 8c0f0c18b..cd10126f4 100644
|
|
|
bcb322 |
--- a/src/providers/ldap/ldap_id_cleanup.c
|
|
|
bcb322 |
+++ b/src/providers/ldap/ldap_id_cleanup.c
|
|
|
bcb322 |
@@ -422,7 +422,7 @@ static int cleanup_groups(TALLOC_CTX *memctx,
|
|
|
bcb322 |
}
|
|
|
bcb322 |
|
|
|
bcb322 |
/* sanitize dn */
|
|
|
bcb322 |
- ret = sss_filter_sanitize(tmpctx, dn, &sanitized_dn);
|
|
|
bcb322 |
+ ret = sss_filter_sanitize_dn(tmpctx, dn, &sanitized_dn);
|
|
|
bcb322 |
if (ret != EOK) {
|
|
|
bcb322 |
DEBUG(SSSDBG_MINOR_FAILURE,
|
|
|
bcb322 |
"sss_filter_sanitize failed: %s:[%d]\n",
|
|
|
bcb322 |
--
|
|
|
bcb322 |
2.21.3
|
|
|
bcb322 |
|