|
|
5fca41 |
From e4dd2843a4a302ababd3ccedfbf23832244a1655 Mon Sep 17 00:00:00 2001
|
|
|
5fca41 |
From: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
5fca41 |
Date: Sat, 23 Mar 2019 21:53:05 +0100
|
|
|
5fca41 |
Subject: [PATCH] krb5: Do not use unindexed objectCategory in a search filter
|
|
|
5fca41 |
|
|
|
5fca41 |
Related:
|
|
|
5fca41 |
https://pagure.io/SSSD/sssd/issue/3968
|
|
|
5fca41 |
|
|
|
5fca41 |
Since we switched to using objectcategory instead of objectclass for
|
|
|
5fca41 |
users and groups, the objectCategory attribute is also not indexed. This
|
|
|
5fca41 |
means that searches using this attribute must traverse the whole
|
|
|
5fca41 |
database which can be very slow.
|
|
|
5fca41 |
|
|
|
5fca41 |
This patch uses the cn=users container instead of the full sysdb
|
|
|
5fca41 |
container as the search base which is more or less equivalent to using
|
|
|
5fca41 |
objectCategory=user anyway.
|
|
|
5fca41 |
|
|
|
5fca41 |
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
|
|
|
5fca41 |
(cherry picked from commit e474c2dd305db654b42f2a123a6f60d12d7978c5)
|
|
|
5fca41 |
---
|
|
|
5fca41 |
src/providers/krb5/krb5_renew_tgt.c | 4 ++--
|
|
|
5fca41 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
5fca41 |
|
|
|
5fca41 |
diff --git a/src/providers/krb5/krb5_renew_tgt.c b/src/providers/krb5/krb5_renew_tgt.c
|
|
|
5fca41 |
index 549c08c6f..c7e2bd91f 100644
|
|
|
5fca41 |
--- a/src/providers/krb5/krb5_renew_tgt.c
|
|
|
5fca41 |
+++ b/src/providers/krb5/krb5_renew_tgt.c
|
|
|
5fca41 |
@@ -385,7 +385,7 @@ static errno_t check_ccache_files(struct renew_tgt_ctx *renew_tgt_ctx)
|
|
|
5fca41 |
{
|
|
|
5fca41 |
TALLOC_CTX *tmp_ctx;
|
|
|
5fca41 |
int ret;
|
|
|
5fca41 |
- const char *ccache_filter = "(&("SYSDB_CCACHE_FILE"=*)("SYSDB_UC"))";
|
|
|
5fca41 |
+ const char *ccache_filter = SYSDB_CCACHE_FILE"=*";
|
|
|
5fca41 |
const char *ccache_attrs[] = { SYSDB_CCACHE_FILE, SYSDB_UPN, SYSDB_NAME,
|
|
|
5fca41 |
SYSDB_CANONICAL_UPN, NULL };
|
|
|
5fca41 |
size_t msgs_count = 0;
|
|
|
5fca41 |
@@ -403,7 +403,7 @@ static errno_t check_ccache_files(struct renew_tgt_ctx *renew_tgt_ctx)
|
|
|
5fca41 |
return ENOMEM;
|
|
|
5fca41 |
}
|
|
|
5fca41 |
|
|
|
5fca41 |
- base_dn = sysdb_base_dn(renew_tgt_ctx->be_ctx->domain->sysdb, tmp_ctx);
|
|
|
5fca41 |
+ base_dn = sysdb_user_base_dn(tmp_ctx, renew_tgt_ctx->be_ctx->domain);
|
|
|
5fca41 |
if (base_dn == NULL) {
|
|
|
5fca41 |
DEBUG(SSSDBG_OP_FAILURE, "sysdb_base_dn failed.\n");
|
|
|
5fca41 |
ret = ENOMEM;
|
|
|
5fca41 |
--
|
|
|
5fca41 |
2.19.1
|
|
|
5fca41 |
|