|
|
9f2ebf |
From e4ba8c5c6c08f86d51485d49c27635d7079efe13 Mon Sep 17 00:00:00 2001
|
|
|
9f2ebf |
From: Sumit Bose <sbose@redhat.com>
|
|
|
9f2ebf |
Date: Wed, 8 Nov 2017 15:14:58 +0100
|
|
|
9f2ebf |
Subject: [PATCH 55/57] sysdb: do not use objectClass for users and groups
|
|
|
9f2ebf |
MIME-Version: 1.0
|
|
|
9f2ebf |
Content-Type: text/plain; charset=UTF-8
|
|
|
9f2ebf |
Content-Transfer-Encoding: 8bit
|
|
|
9f2ebf |
|
|
|
9f2ebf |
The majority of the object in the SSSD cache are users and groups. If
|
|
|
9f2ebf |
there are many user and groups in the cache the index objects of the
|
|
|
9f2ebf |
objectclass attributes 'user' and 'group' become large because the
|
|
|
9f2ebf |
must hold references to all objects of those object classes.
|
|
|
9f2ebf |
|
|
|
9f2ebf |
As a result the management of these index objects becomes costly because
|
|
|
9f2ebf |
they must be parsed and split apart quite often. Additionally they are
|
|
|
9f2ebf |
mostly useless because user and groups are lookup up by more specific
|
|
|
9f2ebf |
attributes in general.
|
|
|
9f2ebf |
|
|
|
9f2ebf |
Only when enumerating all user or groups this kind of index might be
|
|
|
9f2ebf |
useful.
|
|
|
9f2ebf |
|
|
|
9f2ebf |
There are two way of removing this kind of index from the user and group
|
|
|
9f2ebf |
objects. Either by removing objectClass from the list of indexes and add
|
|
|
9f2ebf |
a new attribute to all other type of object we want and index for. Or by
|
|
|
9f2ebf |
replacing objectClass with a different attribute for the user and group
|
|
|
9f2ebf |
objects. After some testing I think the latter one is the more reliable
|
|
|
9f2ebf |
one and implemented it in this patch.
|
|
|
9f2ebf |
|
|
|
9f2ebf |
Related to https://pagure.io/SSSD/sssd/issue/3503
|
|
|
9f2ebf |
|
|
|
9f2ebf |
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
|
|
|
9f2ebf |
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
9f2ebf |
(cherry picked from commit 0e238c259c066cf997aaa940d33d6bda96c15925)
|
|
|
9f2ebf |
---
|
|
|
9f2ebf |
src/db/sysdb.h | 10 ++--
|
|
|
9f2ebf |
src/db/sysdb_init.c | 5 +-
|
|
|
9f2ebf |
src/db/sysdb_ops.c | 6 +--
|
|
|
9f2ebf |
src/db/sysdb_search.c | 11 +++--
|
|
|
9f2ebf |
src/db/sysdb_upgrade.c | 4 ++
|
|
|
9f2ebf |
src/ldb_modules/memberof.c | 6 +--
|
|
|
9f2ebf |
src/providers/ad/ad_pac.c | 2 +-
|
|
|
9f2ebf |
src/providers/ipa/ipa_id.c | 9 ++--
|
|
|
9f2ebf |
src/providers/ipa/ipa_subdomains_ext_groups.c | 2 +-
|
|
|
9f2ebf |
src/providers/ipa/ipa_subdomains_id.c | 2 +-
|
|
|
9f2ebf |
src/providers/krb5/krb5_renew_tgt.c | 3 +-
|
|
|
9f2ebf |
src/providers/ldap/ldap_id_cleanup.c | 2 +-
|
|
|
9f2ebf |
src/providers/ldap/sdap_async_groups.c | 8 ++--
|
|
|
9f2ebf |
src/providers/ldap/sdap_async_initgroups.c | 2 +-
|
|
|
9f2ebf |
src/providers/ldap/sdap_async_initgroups_ad.c | 2 +-
|
|
|
9f2ebf |
src/providers/ldap/sdap_async_nested_groups.c | 2 +-
|
|
|
9f2ebf |
.../common/cache_req/plugins/cache_req_common.c | 2 +-
|
|
|
9f2ebf |
src/responder/ifp/ifp_cache.c | 4 +-
|
|
|
9f2ebf |
src/responder/ifp/ifp_groups.c | 4 +-
|
|
|
9f2ebf |
src/responder/ifp/ifp_users.c | 2 +-
|
|
|
9f2ebf |
src/responder/nss/nss_cmd.c | 2 +-
|
|
|
9f2ebf |
src/responder/nss/nss_protocol_grent.c | 2 +-
|
|
|
9f2ebf |
src/responder/nss/nss_protocol_sid.c | 4 +-
|
|
|
9f2ebf |
src/tests/cmocka/test_ad_common.c | 2 +-
|
|
|
9f2ebf |
src/tests/cmocka/test_ipa_subdomains_server.c | 54 ++++++++++++++++------
|
|
|
9f2ebf |
src/tests/sysdb-tests.c | 20 +++++---
|
|
|
9f2ebf |
src/tools/sssctl/sssctl_cache.c | 3 +-
|
|
|
9f2ebf |
27 files changed, 110 insertions(+), 65 deletions(-)
|
|
|
9f2ebf |
|
|
|
9f2ebf |
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
|
|
|
9f2ebf |
index 4192f9085d941814eccd2ac60ce8fb6d4e1bfa67..fd18ecefed2b2c5f35060fa47fd160a8968e073b 100644
|
|
|
9f2ebf |
--- a/src/db/sysdb.h
|
|
|
9f2ebf |
+++ b/src/db/sysdb.h
|
|
|
9f2ebf |
@@ -192,9 +192,10 @@
|
|
|
9f2ebf |
|
|
|
9f2ebf |
#define SYSDB_NEXTID_FILTER "("SYSDB_NEXTID"=*)"
|
|
|
9f2ebf |
|
|
|
9f2ebf |
-#define SYSDB_UC "objectclass="SYSDB_USER_CLASS
|
|
|
9f2ebf |
-#define SYSDB_GC "objectclass="SYSDB_GROUP_CLASS
|
|
|
9f2ebf |
-#define SYSDB_NC "objectclass="SYSDB_NETGROUP_CLASS
|
|
|
9f2ebf |
+#define SYSDB_OBJECTCATEGORY "objectCategory"
|
|
|
9f2ebf |
+#define SYSDB_UC SYSDB_OBJECTCATEGORY"="SYSDB_USER_CLASS
|
|
|
9f2ebf |
+#define SYSDB_GC SYSDB_OBJECTCATEGORY"="SYSDB_GROUP_CLASS
|
|
|
9f2ebf |
+#define SYSDB_NC SYSDB_OBJECTCLASS"="SYSDB_NETGROUP_CLASS
|
|
|
9f2ebf |
#define SYSDB_MPGC "|("SYSDB_UC")("SYSDB_GC")"
|
|
|
9f2ebf |
|
|
|
9f2ebf |
#define SYSDB_PWNAM_FILTER "(&("SYSDB_UC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
|
|
|
9f2ebf |
@@ -227,7 +228,8 @@
|
|
|
9f2ebf |
#define SYSDB_DEFAULT_ATTRS SYSDB_LAST_UPDATE, \
|
|
|
9f2ebf |
SYSDB_CACHE_EXPIRE, \
|
|
|
9f2ebf |
SYSDB_INITGR_EXPIRE, \
|
|
|
9f2ebf |
- SYSDB_OBJECTCLASS
|
|
|
9f2ebf |
+ SYSDB_OBJECTCLASS, \
|
|
|
9f2ebf |
+ SYSDB_OBJECTCATEGORY
|
|
|
9f2ebf |
|
|
|
9f2ebf |
#define SYSDB_PW_ATTRS {SYSDB_NAME, SYSDB_UIDNUM, \
|
|
|
9f2ebf |
SYSDB_GIDNUM, SYSDB_GECOS, \
|
|
|
9f2ebf |
diff --git a/src/db/sysdb_init.c b/src/db/sysdb_init.c
|
|
|
9f2ebf |
index e246a165ec1d654dba19aa771ed97bfc3a07f245..44a7918f603fe1368b7d81738666de6bb47b83d0 100644
|
|
|
9f2ebf |
--- a/src/db/sysdb_init.c
|
|
|
9f2ebf |
+++ b/src/db/sysdb_init.c
|
|
|
9f2ebf |
@@ -31,11 +31,12 @@
|
|
|
9f2ebf |
#define LDB_MODULES_PATH "LDB_MODULES_PATH"
|
|
|
9f2ebf |
|
|
|
9f2ebf |
/* If an entry differs only in these attributes, they are written to
|
|
|
9f2ebf |
- * the timestamp cache only. In addition, objectclass is added so that
|
|
|
9f2ebf |
- * we can distinguish between users and groups.
|
|
|
9f2ebf |
+ * the timestamp cache only. In addition, objectclass/objectcategory is added
|
|
|
9f2ebf |
+ * so that we can distinguish between users and groups.
|
|
|
9f2ebf |
*/
|
|
|
9f2ebf |
const char *sysdb_ts_cache_attrs[] = {
|
|
|
9f2ebf |
SYSDB_OBJECTCLASS,
|
|
|
9f2ebf |
+ SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
SYSDB_LAST_UPDATE,
|
|
|
9f2ebf |
SYSDB_CACHE_EXPIRE,
|
|
|
9f2ebf |
SYSDB_ORIG_MODSTAMP,
|
|
|
9f2ebf |
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
|
|
|
9f2ebf |
index 1539c41c93e7d6ebd1e544abbb1707df5578cd72..024683317cab99743681db804f7026c8dbb33a38 100644
|
|
|
9f2ebf |
--- a/src/db/sysdb_ops.c
|
|
|
9f2ebf |
+++ b/src/db/sysdb_ops.c
|
|
|
9f2ebf |
@@ -958,7 +958,7 @@ static struct sysdb_attrs *ts_obj_attrs(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
return NULL;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, oc);
|
|
|
9f2ebf |
+ ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCATEGORY, oc);
|
|
|
9f2ebf |
if (ret != EOK) {
|
|
|
9f2ebf |
talloc_free(attrs);
|
|
|
9f2ebf |
return NULL;
|
|
|
9f2ebf |
@@ -1667,7 +1667,7 @@ int sysdb_add_basic_user(struct sss_domain_info *domain,
|
|
|
9f2ebf |
ERROR_OUT(ret, ENOMEM, done);
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- ret = sysdb_add_string(msg, SYSDB_OBJECTCLASS, SYSDB_USER_CLASS);
|
|
|
9f2ebf |
+ ret = sysdb_add_string(msg, SYSDB_OBJECTCATEGORY, SYSDB_USER_CLASS);
|
|
|
9f2ebf |
if (ret) goto done;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
ret = sysdb_add_string(msg, SYSDB_NAME, name);
|
|
|
9f2ebf |
@@ -2120,7 +2120,7 @@ int sysdb_add_basic_group(struct sss_domain_info *domain,
|
|
|
9f2ebf |
ERROR_OUT(ret, ENOMEM, done);
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- ret = sysdb_add_string(msg, SYSDB_OBJECTCLASS, SYSDB_GROUP_CLASS);
|
|
|
9f2ebf |
+ ret = sysdb_add_string(msg, SYSDB_OBJECTCATEGORY, SYSDB_GROUP_CLASS);
|
|
|
9f2ebf |
if (ret) goto done;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
ret = sysdb_add_string(msg, SYSDB_NAME, name);
|
|
|
9f2ebf |
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
|
|
|
9f2ebf |
index 8083966900429b268a3b984f1cad3d47d1099198..a6a81e23d257331614085403b4dca8ded860600b 100644
|
|
|
9f2ebf |
--- a/src/db/sysdb_search.c
|
|
|
9f2ebf |
+++ b/src/db/sysdb_search.c
|
|
|
9f2ebf |
@@ -114,10 +114,11 @@ static errno_t merge_msg_ts_attrs(struct sysdb_ctx *sysdb,
|
|
|
9f2ebf |
return EIO;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- /* Deliberately start from 1 in order to not merge objectclass and avoid
|
|
|
9f2ebf |
- * breaking MPGs where the OC might be made up
|
|
|
9f2ebf |
+ /* Deliberately start from 2 in order to not merge
|
|
|
9f2ebf |
+ * objectclass/objectcategory and avoid breaking MPGs where the OC might
|
|
|
9f2ebf |
+ * be made up
|
|
|
9f2ebf |
*/
|
|
|
9f2ebf |
- for (size_t c = 1; sysdb_ts_cache_attrs[c]; c++) {
|
|
|
9f2ebf |
+ for (size_t c = 2; sysdb_ts_cache_attrs[c]; c++) {
|
|
|
9f2ebf |
ret = merge_ts_attr(ts_msgs[0], sysdb_msg,
|
|
|
9f2ebf |
sysdb_ts_cache_attrs[c], attrs);
|
|
|
9f2ebf |
if (ret != EOK) {
|
|
|
9f2ebf |
@@ -751,7 +752,7 @@ static int mpg_convert(struct ldb_message *msg)
|
|
|
9f2ebf |
struct ldb_val *val = NULL;
|
|
|
9f2ebf |
int i;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- el = ldb_msg_find_element(msg, "objectClass");
|
|
|
9f2ebf |
+ el = ldb_msg_find_element(msg, SYSDB_OBJECTCATEGORY);
|
|
|
9f2ebf |
if (!el) return EINVAL;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
/* see if this is a user to convert to a group */
|
|
|
9f2ebf |
@@ -2088,7 +2089,7 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
member_filter = talloc_asprintf(tmp_ctx, "(&(%s=%s)(%s=%s))",
|
|
|
9f2ebf |
- SYSDB_OBJECTCLASS, SYSDB_GROUP_CLASS,
|
|
|
9f2ebf |
+ SYSDB_OBJECTCATEGORY, SYSDB_GROUP_CLASS,
|
|
|
9f2ebf |
SYSDB_MEMBER, sanitized_dn);
|
|
|
9f2ebf |
if (!member_filter) {
|
|
|
9f2ebf |
ret = ENOMEM;
|
|
|
9f2ebf |
diff --git a/src/db/sysdb_upgrade.c b/src/db/sysdb_upgrade.c
|
|
|
9f2ebf |
index 040c91ca6276e7c51a126eefe034aa5fe9d0433f..365d45f7ebd78523ca9ec4b9c2158cc09acb5489 100644
|
|
|
9f2ebf |
--- a/src/db/sysdb_upgrade.c
|
|
|
9f2ebf |
+++ b/src/db/sysdb_upgrade.c
|
|
|
9f2ebf |
@@ -149,6 +149,7 @@ int sysdb_upgrade_01(struct ldb_context *ldb, const char **ver)
|
|
|
9f2ebf |
struct ldb_dn *mem_dn;
|
|
|
9f2ebf |
struct ldb_message *msg;
|
|
|
9f2ebf |
const struct ldb_val *val;
|
|
|
9f2ebf |
+ /* No change needed because this version has objectclass group */
|
|
|
9f2ebf |
const char *filter = "(&(memberUid=*)(objectclass=group))";
|
|
|
9f2ebf |
const char *attrs[] = { "memberUid", NULL };
|
|
|
9f2ebf |
const char *mdn;
|
|
|
9f2ebf |
@@ -1041,6 +1042,7 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain,
|
|
|
9f2ebf |
struct ldb_message_element *memberof_el;
|
|
|
9f2ebf |
const char *name;
|
|
|
9f2ebf |
struct ldb_dn *basedn;
|
|
|
9f2ebf |
+ /* No change needed because version 10 has objectclass user */
|
|
|
9f2ebf |
const char *filter = "(&(objectClass=user)(!(uidNumber=*))(memberOf=*))";
|
|
|
9f2ebf |
const char *attrs[] = { "name", "memberof", NULL };
|
|
|
9f2ebf |
struct upgrade_ctx *ctx;
|
|
|
9f2ebf |
@@ -2082,6 +2084,7 @@ static void qualify_users(struct upgrade_ctx *ctx,
|
|
|
9f2ebf |
struct sss_names_ctx *names,
|
|
|
9f2ebf |
struct ldb_dn *base_dn)
|
|
|
9f2ebf |
{
|
|
|
9f2ebf |
+ /* No change needed because this version has objectclass user */
|
|
|
9f2ebf |
const char *user_filter = "objectclass=user";
|
|
|
9f2ebf |
const char *user_name_attrs[] = { SYSDB_NAME,
|
|
|
9f2ebf |
SYSDB_NAME_ALIAS,
|
|
|
9f2ebf |
@@ -2107,6 +2110,7 @@ static void qualify_groups(struct upgrade_ctx *ctx,
|
|
|
9f2ebf |
struct sss_names_ctx *names,
|
|
|
9f2ebf |
struct ldb_dn *base_dn)
|
|
|
9f2ebf |
{
|
|
|
9f2ebf |
+ /* No change needed because this version has objectclass group */
|
|
|
9f2ebf |
const char *group_filter = "objectclass=group";
|
|
|
9f2ebf |
const char *group_name_attrs[] = { SYSDB_NAME,
|
|
|
9f2ebf |
SYSDB_NAME_ALIAS,
|
|
|
9f2ebf |
diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c
|
|
|
9f2ebf |
index af7147ee7cc9299d4040d63a637373842dcee02a..327a38c5f75afcde1b997796afd1217d45acbde2 100644
|
|
|
9f2ebf |
--- a/src/ldb_modules/memberof.c
|
|
|
9f2ebf |
+++ b/src/ldb_modules/memberof.c
|
|
|
9f2ebf |
@@ -31,7 +31,7 @@
|
|
|
9f2ebf |
#define DB_USER_CLASS "user"
|
|
|
9f2ebf |
#define DB_GROUP_CLASS "group"
|
|
|
9f2ebf |
#define DB_CACHE_EXPIRE "dataExpireTimestamp"
|
|
|
9f2ebf |
-#define DB_OC "objectClass"
|
|
|
9f2ebf |
+#define DB_OC "objectCategory"
|
|
|
9f2ebf |
|
|
|
9f2ebf |
#ifndef MAX
|
|
|
9f2ebf |
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
|
|
9f2ebf |
@@ -3928,7 +3928,7 @@ static int memberof_recompute_task(struct ldb_module *module,
|
|
|
9f2ebf |
{
|
|
|
9f2ebf |
struct ldb_context *ldb = ldb_module_get_ctx(module);
|
|
|
9f2ebf |
static const char *attrs[] = { DB_NAME, DB_MEMBEROF, NULL };
|
|
|
9f2ebf |
- static const char *filter = "(objectclass=user)";
|
|
|
9f2ebf |
+ static const char *filter = "("DB_OC"="DB_USER_CLASS")";
|
|
|
9f2ebf |
struct mbof_rcmp_context *ctx;
|
|
|
9f2ebf |
struct ldb_request *src_req;
|
|
|
9f2ebf |
int ret;
|
|
|
9f2ebf |
@@ -4035,7 +4035,7 @@ static int mbof_rcmp_search_groups(struct mbof_rcmp_context *ctx)
|
|
|
9f2ebf |
struct ldb_context *ldb = ldb_module_get_ctx(ctx->module);
|
|
|
9f2ebf |
static const char *attrs[] = { DB_MEMBEROF, DB_MEMBERUID,
|
|
|
9f2ebf |
DB_NAME, DB_MEMBER, NULL };
|
|
|
9f2ebf |
- static const char *filter = "(objectclass=group)";
|
|
|
9f2ebf |
+ static const char *filter = "("DB_OC"="DB_GROUP_CLASS")";
|
|
|
9f2ebf |
struct ldb_request *req;
|
|
|
9f2ebf |
int ret;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
diff --git a/src/providers/ad/ad_pac.c b/src/providers/ad/ad_pac.c
|
|
|
9f2ebf |
index ed002e1f9bf8f15d5b5d4b1c55392a34d18575e4..6b47462cf79a81b9258e3508914c043432edfed3 100644
|
|
|
9f2ebf |
--- a/src/providers/ad/ad_pac.c
|
|
|
9f2ebf |
+++ b/src/providers/ad/ad_pac.c
|
|
|
9f2ebf |
@@ -31,7 +31,7 @@ static errno_t find_user_entry(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom,
|
|
|
9f2ebf |
struct dp_id_data *ar,
|
|
|
9f2ebf |
struct ldb_message **_msg)
|
|
|
9f2ebf |
{
|
|
|
9f2ebf |
- const char *user_attrs[] = { SYSDB_NAME, SYSDB_OBJECTCLASS,
|
|
|
9f2ebf |
+ const char *user_attrs[] = { SYSDB_NAME, SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
SYSDB_PAC_BLOB, SYSDB_PAC_BLOB_EXPIRE,
|
|
|
9f2ebf |
NULL };
|
|
|
9f2ebf |
struct ldb_message *msg;
|
|
|
9f2ebf |
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
|
|
|
9f2ebf |
index 5044577f0faa95b19de9233240e92aa60f029774..8f8759f64b758aae7e45c88588e97a1bcf16ad79 100644
|
|
|
9f2ebf |
--- a/src/providers/ipa/ipa_id.c
|
|
|
9f2ebf |
+++ b/src/providers/ipa/ipa_id.c
|
|
|
9f2ebf |
@@ -431,7 +431,8 @@ static errno_t ipa_id_get_group_uuids(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
filter = talloc_asprintf(tmp_ctx,
|
|
|
9f2ebf |
- "(&(objectclass=%s)(!(%s=*))(%s=*))",
|
|
|
9f2ebf |
+ "(&(%s=%s)(!(%s=*))(%s=*))",
|
|
|
9f2ebf |
+ SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
SYSDB_GROUP_CLASS, SYSDB_OVERRIDE_DN,
|
|
|
9f2ebf |
SYSDB_UUID);
|
|
|
9f2ebf |
if (filter == NULL) {
|
|
|
9f2ebf |
@@ -733,7 +734,7 @@ static void ipa_id_get_account_info_orig_done(struct tevent_req *subreq)
|
|
|
9f2ebf |
const char *attrs[] = { SYSDB_NAME,
|
|
|
9f2ebf |
SYSDB_UIDNUM,
|
|
|
9f2ebf |
SYSDB_SID_STR,
|
|
|
9f2ebf |
- SYSDB_OBJECTCLASS,
|
|
|
9f2ebf |
+ SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
SYSDB_UUID,
|
|
|
9f2ebf |
SYSDB_GHOST,
|
|
|
9f2ebf |
SYSDB_HOMEDIR,
|
|
|
9f2ebf |
@@ -819,7 +820,7 @@ static int ipa_id_get_account_info_post_proc_step(struct tevent_req *req)
|
|
|
9f2ebf |
struct ipa_id_get_account_info_state *state = tevent_req_data(req,
|
|
|
9f2ebf |
struct ipa_id_get_account_info_state);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- class = ldb_msg_find_attr_as_string(state->obj_msg, SYSDB_OBJECTCLASS,
|
|
|
9f2ebf |
+ class = ldb_msg_find_attr_as_string(state->obj_msg, SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
NULL);
|
|
|
9f2ebf |
if (class == NULL) {
|
|
|
9f2ebf |
DEBUG(SSSDBG_CRIT_FAILURE, "Cannot find an objectclass.\n");
|
|
|
9f2ebf |
@@ -957,7 +958,7 @@ static void ipa_id_get_account_info_done(struct tevent_req *subreq)
|
|
|
9f2ebf |
goto fail;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- class = ldb_msg_find_attr_as_string(state->obj_msg, SYSDB_OBJECTCLASS,
|
|
|
9f2ebf |
+ class = ldb_msg_find_attr_as_string(state->obj_msg, SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
NULL);
|
|
|
9f2ebf |
if (class == NULL) {
|
|
|
9f2ebf |
DEBUG(SSSDBG_CRIT_FAILURE, "Cannot find an objectclass.\n");
|
|
|
9f2ebf |
diff --git a/src/providers/ipa/ipa_subdomains_ext_groups.c b/src/providers/ipa/ipa_subdomains_ext_groups.c
|
|
|
9f2ebf |
index 0359e0dedeef8db0da71d16a6f0044e43a7a9840..9e1d6c3a9bdeda56b421a2dc9198dff0b84c54ce 100644
|
|
|
9f2ebf |
--- a/src/providers/ipa/ipa_subdomains_ext_groups.c
|
|
|
9f2ebf |
+++ b/src/providers/ipa/ipa_subdomains_ext_groups.c
|
|
|
9f2ebf |
@@ -940,7 +940,7 @@ search_user_or_group_by_sid_str(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
const char *attrs[] = { SYSDB_NAME,
|
|
|
9f2ebf |
SYSDB_SID_STR,
|
|
|
9f2ebf |
SYSDB_ORIG_DN,
|
|
|
9f2ebf |
- SYSDB_OBJECTCLASS,
|
|
|
9f2ebf |
+ SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
SYSDB_CACHE_EXPIRE,
|
|
|
9f2ebf |
NULL };
|
|
|
9f2ebf |
TALLOC_CTX *tmp_ctx = NULL;
|
|
|
9f2ebf |
diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c
|
|
|
9f2ebf |
index 3530af94ef59397db72465fcb0c4a03117a4d8bd..2ba9813a44b4d914d9c2ef7a1a7504546f52954c 100644
|
|
|
9f2ebf |
--- a/src/providers/ipa/ipa_subdomains_id.c
|
|
|
9f2ebf |
+++ b/src/providers/ipa/ipa_subdomains_id.c
|
|
|
9f2ebf |
@@ -888,7 +888,7 @@ apply_subdomain_homedir(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom,
|
|
|
9f2ebf |
struct ldb_message_element *msg_el = NULL;
|
|
|
9f2ebf |
size_t c;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- msg_el = ldb_msg_find_element(msg, SYSDB_OBJECTCLASS);
|
|
|
9f2ebf |
+ msg_el = ldb_msg_find_element(msg, SYSDB_OBJECTCATEGORY);
|
|
|
9f2ebf |
if (msg_el == NULL) {
|
|
|
9f2ebf |
DEBUG(SSSDBG_OP_FAILURE, "ldb_msg_find_element failed.\n");
|
|
|
9f2ebf |
ret = ENOENT;
|
|
|
9f2ebf |
diff --git a/src/providers/krb5/krb5_renew_tgt.c b/src/providers/krb5/krb5_renew_tgt.c
|
|
|
9f2ebf |
index ea6b39deb8dacdfa9211058a54a57b6e9f6b7d9d..549c08c6f105276fa9913568c228d3ff627623ae 100644
|
|
|
9f2ebf |
--- a/src/providers/krb5/krb5_renew_tgt.c
|
|
|
9f2ebf |
+++ b/src/providers/krb5/krb5_renew_tgt.c
|
|
|
9f2ebf |
@@ -385,8 +385,7 @@ static errno_t check_ccache_files(struct renew_tgt_ctx *renew_tgt_ctx)
|
|
|
9f2ebf |
{
|
|
|
9f2ebf |
TALLOC_CTX *tmp_ctx;
|
|
|
9f2ebf |
int ret;
|
|
|
9f2ebf |
- const char *ccache_filter = "(&("SYSDB_CCACHE_FILE"=*)" \
|
|
|
9f2ebf |
- "("SYSDB_OBJECTCLASS"="SYSDB_USER_CLASS"))";
|
|
|
9f2ebf |
+ const char *ccache_filter = "(&("SYSDB_CCACHE_FILE"=*)("SYSDB_UC"))";
|
|
|
9f2ebf |
const char *ccache_attrs[] = { SYSDB_CCACHE_FILE, SYSDB_UPN, SYSDB_NAME,
|
|
|
9f2ebf |
SYSDB_CANONICAL_UPN, NULL };
|
|
|
9f2ebf |
size_t msgs_count = 0;
|
|
|
9f2ebf |
diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c
|
|
|
9f2ebf |
index c85ce45918cf938a95ff85c31bfe0541f9ddd052..8c0f0c18ba587e9bbfec144abe9c172cd5e0465b 100644
|
|
|
9f2ebf |
--- a/src/providers/ldap/ldap_id_cleanup.c
|
|
|
9f2ebf |
+++ b/src/providers/ldap/ldap_id_cleanup.c
|
|
|
9f2ebf |
@@ -438,7 +438,7 @@ static int cleanup_groups(TALLOC_CTX *memctx,
|
|
|
9f2ebf |
*/
|
|
|
9f2ebf |
gid = (gid_t) ldb_msg_find_attr_as_uint(msgs[i], SYSDB_GIDNUM, 0);
|
|
|
9f2ebf |
subfilter = talloc_asprintf(tmpctx, "(&(%s=%s)(|(%s=%s)(%s=%lu)))",
|
|
|
9f2ebf |
- SYSDB_OBJECTCLASS, SYSDB_USER_CLASS,
|
|
|
9f2ebf |
+ SYSDB_OBJECTCATEGORY, SYSDB_USER_CLASS,
|
|
|
9f2ebf |
SYSDB_MEMBEROF, sanitized_dn,
|
|
|
9f2ebf |
SYSDB_GIDNUM, (long unsigned) gid);
|
|
|
9f2ebf |
} else {
|
|
|
9f2ebf |
diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c
|
|
|
9f2ebf |
index 536e3f13744c5350eed518c9bd35fd89e0899dc6..b1cfb7e4a4c054e5d365da5fca65da27c9ef5461 100644
|
|
|
9f2ebf |
--- a/src/providers/ldap/sdap_async_groups.c
|
|
|
9f2ebf |
+++ b/src/providers/ldap/sdap_async_groups.c
|
|
|
9f2ebf |
@@ -39,7 +39,7 @@ static int sdap_find_entry_by_origDN(TALLOC_CTX *memctx,
|
|
|
9f2ebf |
bool *_is_group)
|
|
|
9f2ebf |
{
|
|
|
9f2ebf |
TALLOC_CTX *tmpctx;
|
|
|
9f2ebf |
- const char *attrs[] = {SYSDB_OBJECTCLASS, NULL};
|
|
|
9f2ebf |
+ const char *attrs[] = {SYSDB_OBJECTCLASS, SYSDB_OBJECTCATEGORY, NULL};
|
|
|
9f2ebf |
struct ldb_dn *base_dn;
|
|
|
9f2ebf |
char *filter;
|
|
|
9f2ebf |
struct ldb_message **msgs;
|
|
|
9f2ebf |
@@ -90,11 +90,11 @@ static int sdap_find_entry_by_origDN(TALLOC_CTX *memctx,
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
if (_is_group != NULL) {
|
|
|
9f2ebf |
- objectclass = ldb_msg_find_attr_as_string(msgs[0], SYSDB_OBJECTCLASS,
|
|
|
9f2ebf |
+ objectclass = ldb_msg_find_attr_as_string(msgs[0], SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
NULL);
|
|
|
9f2ebf |
if (objectclass == NULL) {
|
|
|
9f2ebf |
- DEBUG(SSSDBG_OP_FAILURE, "An antry without a %s?\n",
|
|
|
9f2ebf |
- SYSDB_OBJECTCLASS);
|
|
|
9f2ebf |
+ DEBUG(SSSDBG_OP_FAILURE, "An entry without a %s?\n",
|
|
|
9f2ebf |
+ SYSDB_OBJECTCATEGORY);
|
|
|
9f2ebf |
ret = EINVAL;
|
|
|
9f2ebf |
goto done;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c
|
|
|
9f2ebf |
index a33975cde4bc359cfe8395c0de04fd1774b8763d..f8a84474749e08349b539c774d68c876167cfdf1 100644
|
|
|
9f2ebf |
--- a/src/providers/ldap/sdap_async_initgroups.c
|
|
|
9f2ebf |
+++ b/src/providers/ldap/sdap_async_initgroups.c
|
|
|
9f2ebf |
@@ -2341,7 +2341,7 @@ static errno_t rfc2307bis_nested_groups_step(struct tevent_req *req)
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
ret = sysdb_attrs_get_string(state->groups[state->group_iter],
|
|
|
9f2ebf |
- SYSDB_OBJECTCLASS, &class);
|
|
|
9f2ebf |
+ SYSDB_OBJECTCATEGORY, &class);
|
|
|
9f2ebf |
if (ret == EOK) {
|
|
|
9f2ebf |
/* If there is a objectClass attribute the object is coming from the
|
|
|
9f2ebf |
* cache and the name attribute of the object already has the primary
|
|
|
9f2ebf |
diff --git a/src/providers/ldap/sdap_async_initgroups_ad.c b/src/providers/ldap/sdap_async_initgroups_ad.c
|
|
|
9f2ebf |
index 2831be9776293260aeec0e2ff85160f1938bdb32..61aa69a2dfbe22cac37a5b7fddc07473527e5de5 100644
|
|
|
9f2ebf |
--- a/src/providers/ldap/sdap_async_initgroups_ad.c
|
|
|
9f2ebf |
+++ b/src/providers/ldap/sdap_async_initgroups_ad.c
|
|
|
9f2ebf |
@@ -1606,7 +1606,7 @@ sdap_ad_get_domain_local_groups_parse_parents(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
goto done;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- ret = sysdb_attrs_get_string(gr->group, SYSDB_OBJECTCLASS, &class);
|
|
|
9f2ebf |
+ ret = sysdb_attrs_get_string(gr->group, SYSDB_OBJECTCATEGORY, &class);
|
|
|
9f2ebf |
if (ret != EOK) {
|
|
|
9f2ebf |
/* If objectclass is missing gr->group is a nested parent found during
|
|
|
9f2ebf |
* the nested group lookup. It might not already stored in the cache.
|
|
|
9f2ebf |
diff --git a/src/providers/ldap/sdap_async_nested_groups.c b/src/providers/ldap/sdap_async_nested_groups.c
|
|
|
9f2ebf |
index 9271d8cfe38d11fb1ea14960a997f0deee175b27..b1f9753d7cdf5f6e278c54394d4f306cc21a42ab 100644
|
|
|
9f2ebf |
--- a/src/providers/ldap/sdap_async_nested_groups.c
|
|
|
9f2ebf |
+++ b/src/providers/ldap/sdap_async_nested_groups.c
|
|
|
9f2ebf |
@@ -1686,7 +1686,7 @@ static errno_t sdap_nested_group_get_ipa_user(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
goto done;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- ret = sysdb_attrs_add_string(user, SYSDB_OBJECTCLASS, SYSDB_USER_CLASS);
|
|
|
9f2ebf |
+ ret = sysdb_attrs_add_string(user, SYSDB_OBJECTCATEGORY, SYSDB_USER_CLASS);
|
|
|
9f2ebf |
if (ret != EOK) {
|
|
|
9f2ebf |
goto done;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
diff --git a/src/responder/common/cache_req/plugins/cache_req_common.c b/src/responder/common/cache_req/plugins/cache_req_common.c
|
|
|
9f2ebf |
index b80f310feeebbdbc824db441ff5313632585d3fb..1f86258bc14c7a382712959f24a4ec4c153572d4 100644
|
|
|
9f2ebf |
--- a/src/responder/common/cache_req/plugins/cache_req_common.c
|
|
|
9f2ebf |
+++ b/src/responder/common/cache_req/plugins/cache_req_common.c
|
|
|
9f2ebf |
@@ -53,7 +53,7 @@ cache_req_well_known_sid_msg(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
goto done;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- ldberr = ldb_msg_add_string(msg, SYSDB_OBJECTCLASS, SYSDB_GROUP_CLASS);
|
|
|
9f2ebf |
+ ldberr = ldb_msg_add_string(msg, SYSDB_OBJECTCATEGORY, SYSDB_GROUP_CLASS);
|
|
|
9f2ebf |
if (ldberr != LDB_SUCCESS) {
|
|
|
9f2ebf |
goto done;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
diff --git a/src/responder/ifp/ifp_cache.c b/src/responder/ifp/ifp_cache.c
|
|
|
9f2ebf |
index 8ea2d8008d40bc0a28f3871b511690af677c5c5e..f84cb14de48b5c86acb027f275edded4eb73e192 100644
|
|
|
9f2ebf |
--- a/src/responder/ifp/ifp_cache.c
|
|
|
9f2ebf |
+++ b/src/responder/ifp/ifp_cache.c
|
|
|
9f2ebf |
@@ -100,7 +100,7 @@ ifp_cache_get_cached_objects(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
errno_t ret;
|
|
|
9f2ebf |
int ldb_ret;
|
|
|
9f2ebf |
int i;
|
|
|
9f2ebf |
- const char *attrs[] = {SYSDB_OBJECTCLASS, SYSDB_UIDNUM,
|
|
|
9f2ebf |
+ const char *attrs[] = {SYSDB_OBJECTCATEGORY, SYSDB_UIDNUM,
|
|
|
9f2ebf |
SYSDB_GIDNUM, NULL};
|
|
|
9f2ebf |
|
|
|
9f2ebf |
tmp_ctx = talloc_new(NULL);
|
|
|
9f2ebf |
@@ -117,7 +117,7 @@ ifp_cache_get_cached_objects(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
|
|
|
9f2ebf |
ldb_ret = ldb_search(sysdb_ctx_get_ldb(domain->sysdb), tmp_ctx, &result,
|
|
|
9f2ebf |
base_dn, LDB_SCOPE_SUBTREE, attrs,
|
|
|
9f2ebf |
- "(&(objectClass=%s)(%s=TRUE))", class,
|
|
|
9f2ebf |
+ "(&(%s=%s)(%s=TRUE))", SYSDB_OBJECTCATEGORY, class,
|
|
|
9f2ebf |
SYSDB_IFP_CACHED);
|
|
|
9f2ebf |
if (ldb_ret != LDB_SUCCESS) {
|
|
|
9f2ebf |
DEBUG(SSSDBG_CRIT_FAILURE, "Unable to search the cache\n");
|
|
|
9f2ebf |
diff --git a/src/responder/ifp/ifp_groups.c b/src/responder/ifp/ifp_groups.c
|
|
|
9f2ebf |
index 7503254238eafdafbe2d90fbf7416587be49e1b7..b274b8f52d7908165acc10b91a7d6afe638f1a82 100644
|
|
|
9f2ebf |
--- a/src/responder/ifp/ifp_groups.c
|
|
|
9f2ebf |
+++ b/src/responder/ifp/ifp_groups.c
|
|
|
9f2ebf |
@@ -841,7 +841,7 @@ ifp_groups_group_get_members(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
int num_groups;
|
|
|
9f2ebf |
int i;
|
|
|
9f2ebf |
errno_t ret;
|
|
|
9f2ebf |
- const char *attrs[] = {SYSDB_OBJECTCLASS, SYSDB_UIDNUM,
|
|
|
9f2ebf |
+ const char *attrs[] = {SYSDB_OBJECTCATEGORY, SYSDB_UIDNUM,
|
|
|
9f2ebf |
SYSDB_GIDNUM, NULL};
|
|
|
9f2ebf |
|
|
|
9f2ebf |
tmp_ctx = talloc_new(NULL);
|
|
|
9f2ebf |
@@ -888,7 +888,7 @@ ifp_groups_group_get_members(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
num_users = 0;
|
|
|
9f2ebf |
num_groups = 0;
|
|
|
9f2ebf |
for (i = 0; i < num_members; i++) {
|
|
|
9f2ebf |
- class = ldb_msg_find_attr_as_string(members[i], SYSDB_OBJECTCLASS,
|
|
|
9f2ebf |
+ class = ldb_msg_find_attr_as_string(members[i], SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
NULL);
|
|
|
9f2ebf |
if (class == NULL) {
|
|
|
9f2ebf |
ret = ERR_INTERNAL;
|
|
|
9f2ebf |
diff --git a/src/responder/ifp/ifp_users.c b/src/responder/ifp/ifp_users.c
|
|
|
9f2ebf |
index 86a1f43a2c6e7d785c9d34e350c71f242ff7182f..cb342a245ef6545168a7a60c252505f50576fdf7 100644
|
|
|
9f2ebf |
--- a/src/responder/ifp/ifp_users.c
|
|
|
9f2ebf |
+++ b/src/responder/ifp/ifp_users.c
|
|
|
9f2ebf |
@@ -1441,7 +1441,7 @@ void ifp_users_user_get_extra_attributes(struct sbus_request *sbus_req,
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
filter = talloc_asprintf(sbus_req, "(&(%s=%s)(%s=%s))",
|
|
|
9f2ebf |
- SYSDB_OBJECTCLASS, SYSDB_USER_CLASS,
|
|
|
9f2ebf |
+ SYSDB_OBJECTCATEGORY, SYSDB_USER_CLASS,
|
|
|
9f2ebf |
SYSDB_NAME, name);
|
|
|
9f2ebf |
if (filter == NULL) {
|
|
|
9f2ebf |
DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf() failed\n");
|
|
|
9f2ebf |
diff --git a/src/responder/nss/nss_cmd.c b/src/responder/nss/nss_cmd.c
|
|
|
9f2ebf |
index 545257a0be7e91e9de767a57848bb77c5791db4e..956ee53cb88dd24faaa95ac39c8d9540af66cfb2 100644
|
|
|
9f2ebf |
--- a/src/responder/nss/nss_cmd.c
|
|
|
9f2ebf |
+++ b/src/responder/nss/nss_cmd.c
|
|
|
9f2ebf |
@@ -1148,7 +1148,7 @@ static errno_t nss_cmd_getorigbyname(struct cli_ctx *cli_ctx)
|
|
|
9f2ebf |
errno_t ret;
|
|
|
9f2ebf |
struct nss_ctx *nss_ctx;
|
|
|
9f2ebf |
const char **attrs;
|
|
|
9f2ebf |
- static const char *defattrs[] = { SYSDB_NAME, SYSDB_OBJECTCLASS,
|
|
|
9f2ebf |
+ static const char *defattrs[] = { SYSDB_NAME, SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
SYSDB_SID_STR,
|
|
|
9f2ebf |
ORIGINALAD_PREFIX SYSDB_NAME,
|
|
|
9f2ebf |
ORIGINALAD_PREFIX SYSDB_UIDNUM,
|
|
|
9f2ebf |
diff --git a/src/responder/nss/nss_protocol_grent.c b/src/responder/nss/nss_protocol_grent.c
|
|
|
9f2ebf |
index 6f6ae57dd97b000ad3cf174b0f649d46981563e2..3550c3f0d375b305d4dbdf3ea19613696448da35 100644
|
|
|
9f2ebf |
--- a/src/responder/nss/nss_protocol_grent.c
|
|
|
9f2ebf |
+++ b/src/responder/nss/nss_protocol_grent.c
|
|
|
9f2ebf |
@@ -33,7 +33,7 @@ nss_get_grent(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
errno_t ret;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
/* Check object class. */
|
|
|
9f2ebf |
- if (!ldb_msg_check_string_attribute(msg, "objectClass",
|
|
|
9f2ebf |
+ if (!ldb_msg_check_string_attribute(msg, SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
SYSDB_GROUP_CLASS)) {
|
|
|
9f2ebf |
DEBUG(SSSDBG_MINOR_FAILURE, "Wrong object (%s) found on stack!\n",
|
|
|
9f2ebf |
ldb_dn_get_linearized(msg->dn));
|
|
|
9f2ebf |
diff --git a/src/responder/nss/nss_protocol_sid.c b/src/responder/nss/nss_protocol_sid.c
|
|
|
9f2ebf |
index 61357c2bf92e2f15d978b64a15ad5bd5aa354445..3f60967d750eea3135257ccb597efaa5aa1e2de3 100644
|
|
|
9f2ebf |
--- a/src/responder/nss/nss_protocol_sid.c
|
|
|
9f2ebf |
+++ b/src/responder/nss/nss_protocol_sid.c
|
|
|
9f2ebf |
@@ -30,9 +30,9 @@ find_sss_id_type(struct ldb_message *msg,
|
|
|
9f2ebf |
struct ldb_message_element *el;
|
|
|
9f2ebf |
struct ldb_val *val = NULL;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- el = ldb_msg_find_element(msg, SYSDB_OBJECTCLASS);
|
|
|
9f2ebf |
+ el = ldb_msg_find_element(msg, SYSDB_OBJECTCATEGORY);
|
|
|
9f2ebf |
if (el == NULL) {
|
|
|
9f2ebf |
- DEBUG(SSSDBG_OP_FAILURE, "Objectclass attribute not found.\n");
|
|
|
9f2ebf |
+ DEBUG(SSSDBG_OP_FAILURE, "Objectcategory attribute not found.\n");
|
|
|
9f2ebf |
return EINVAL;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
diff --git a/src/tests/cmocka/test_ad_common.c b/src/tests/cmocka/test_ad_common.c
|
|
|
9f2ebf |
index 3187af1b004cf3d1ffc1746950faa842f3a05fbc..80b3bb5599a95578b7734d5dfcd20a2a7428a084 100644
|
|
|
9f2ebf |
--- a/src/tests/cmocka/test_ad_common.c
|
|
|
9f2ebf |
+++ b/src/tests/cmocka/test_ad_common.c
|
|
|
9f2ebf |
@@ -336,7 +336,7 @@ static void test_ad_get_pac_data_from_user_entry(void **state)
|
|
|
9f2ebf |
|
|
|
9f2ebf |
ret = ldb_msg_add_string(user_msg, SYSDB_NAME, "username");
|
|
|
9f2ebf |
assert_int_equal(ret, EOK);
|
|
|
9f2ebf |
- ret = ldb_msg_add_string(user_msg, SYSDB_OBJECTCLASS, "user");
|
|
|
9f2ebf |
+ ret = ldb_msg_add_string(user_msg, SYSDB_OBJECTCATEGORY, SYSDB_USER_CLASS);
|
|
|
9f2ebf |
assert_int_equal(ret, EOK);
|
|
|
9f2ebf |
ret = ldb_msg_add_string(user_msg, SYSDB_PAC_BLOB_EXPIRE, "12345");
|
|
|
9f2ebf |
assert_int_equal(ret, EOK);
|
|
|
9f2ebf |
diff --git a/src/tests/cmocka/test_ipa_subdomains_server.c b/src/tests/cmocka/test_ipa_subdomains_server.c
|
|
|
9f2ebf |
index eccfc2fe1e2a224b2cec8ea3184796a23d32febe..1e492e86c1caf26d8890bfa37ebb21321afca366 100644
|
|
|
9f2ebf |
--- a/src/tests/cmocka/test_ipa_subdomains_server.c
|
|
|
9f2ebf |
+++ b/src/tests/cmocka/test_ipa_subdomains_server.c
|
|
|
9f2ebf |
@@ -455,6 +455,8 @@ static void test_ipa_server_create_trusts_twoway(struct tevent_req *req)
|
|
|
9f2ebf |
tevent_req_callback_data(req, struct trust_test_ctx);
|
|
|
9f2ebf |
errno_t ret;
|
|
|
9f2ebf |
struct sss_domain_info *child_dom;
|
|
|
9f2ebf |
+ struct ipa_ad_server_ctx *s_trust;
|
|
|
9f2ebf |
+ struct ipa_ad_server_ctx *c_trust;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
ret = ipa_server_create_trusts_recv(req);
|
|
|
9f2ebf |
talloc_zfree(req);
|
|
|
9f2ebf |
@@ -462,9 +464,18 @@ static void test_ipa_server_create_trusts_twoway(struct tevent_req *req)
|
|
|
9f2ebf |
|
|
|
9f2ebf |
/* Trust object should be around now */
|
|
|
9f2ebf |
assert_non_null(test_ctx->ipa_ctx->server_mode->trusts);
|
|
|
9f2ebf |
+ assert_non_null(test_ctx->ipa_ctx->server_mode->trusts->next);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
+ if (strcmp(test_ctx->ipa_ctx->server_mode->trusts->dom->name,
|
|
|
9f2ebf |
+ SUBDOM_NAME) == 0) {
|
|
|
9f2ebf |
+ s_trust = test_ctx->ipa_ctx->server_mode->trusts;
|
|
|
9f2ebf |
+ c_trust = test_ctx->ipa_ctx->server_mode->trusts->next;
|
|
|
9f2ebf |
+ } else {
|
|
|
9f2ebf |
+ s_trust = test_ctx->ipa_ctx->server_mode->trusts->next;
|
|
|
9f2ebf |
+ c_trust = test_ctx->ipa_ctx->server_mode->trusts;
|
|
|
9f2ebf |
+ }
|
|
|
9f2ebf |
/* Two-way trusts should use the system realm */
|
|
|
9f2ebf |
- assert_trust_object(test_ctx->ipa_ctx->server_mode->trusts,
|
|
|
9f2ebf |
+ assert_trust_object(c_trust,
|
|
|
9f2ebf |
CHILD_NAME,
|
|
|
9f2ebf |
DOM_REALM,
|
|
|
9f2ebf |
CHILD_SID,
|
|
|
9f2ebf |
@@ -472,9 +483,8 @@ static void test_ipa_server_create_trusts_twoway(struct tevent_req *req)
|
|
|
9f2ebf |
TEST_AUTHID,
|
|
|
9f2ebf |
DOM_REALM);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- assert_non_null(test_ctx->ipa_ctx->server_mode->trusts->next);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- assert_trust_object(test_ctx->ipa_ctx->server_mode->trusts->next,
|
|
|
9f2ebf |
+ assert_trust_object(s_trust,
|
|
|
9f2ebf |
SUBDOM_NAME,
|
|
|
9f2ebf |
DOM_REALM,
|
|
|
9f2ebf |
SUBDOM_SID,
|
|
|
9f2ebf |
@@ -523,6 +533,8 @@ static void test_ipa_server_trust_init(void **state)
|
|
|
9f2ebf |
errno_t ret;
|
|
|
9f2ebf |
struct tevent_timer *timeout_handler;
|
|
|
9f2ebf |
struct timeval tv;
|
|
|
9f2ebf |
+ struct ipa_ad_server_ctx *s_trust;
|
|
|
9f2ebf |
+ struct ipa_ad_server_ctx *c_trust;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
add_test_2way_subdomains(test_ctx);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
@@ -537,13 +549,21 @@ static void test_ipa_server_trust_init(void **state)
|
|
|
9f2ebf |
ret = test_ev_loop(test_ctx->tctx);
|
|
|
9f2ebf |
assert_int_equal(ret, ERR_OK);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- assert_non_null(test_ctx->ipa_ctx->server_mode->trusts);
|
|
|
9f2ebf |
-
|
|
|
9f2ebf |
/* Trust object should be around now */
|
|
|
9f2ebf |
assert_non_null(test_ctx->ipa_ctx->server_mode->trusts);
|
|
|
9f2ebf |
+ assert_non_null(test_ctx->ipa_ctx->server_mode->trusts->next);
|
|
|
9f2ebf |
+
|
|
|
9f2ebf |
+ if (strcmp(test_ctx->ipa_ctx->server_mode->trusts->dom->name,
|
|
|
9f2ebf |
+ SUBDOM_NAME) == 0) {
|
|
|
9f2ebf |
+ s_trust = test_ctx->ipa_ctx->server_mode->trusts;
|
|
|
9f2ebf |
+ c_trust = test_ctx->ipa_ctx->server_mode->trusts->next;
|
|
|
9f2ebf |
+ } else {
|
|
|
9f2ebf |
+ s_trust = test_ctx->ipa_ctx->server_mode->trusts->next;
|
|
|
9f2ebf |
+ c_trust = test_ctx->ipa_ctx->server_mode->trusts;
|
|
|
9f2ebf |
+ }
|
|
|
9f2ebf |
|
|
|
9f2ebf |
/* Two-way trusts should use the system realm */
|
|
|
9f2ebf |
- assert_trust_object(test_ctx->ipa_ctx->server_mode->trusts,
|
|
|
9f2ebf |
+ assert_trust_object(c_trust,
|
|
|
9f2ebf |
CHILD_NAME,
|
|
|
9f2ebf |
DOM_REALM,
|
|
|
9f2ebf |
CHILD_SID,
|
|
|
9f2ebf |
@@ -551,9 +571,7 @@ static void test_ipa_server_trust_init(void **state)
|
|
|
9f2ebf |
TEST_AUTHID,
|
|
|
9f2ebf |
DOM_REALM);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- assert_non_null(test_ctx->ipa_ctx->server_mode->trusts->next);
|
|
|
9f2ebf |
-
|
|
|
9f2ebf |
- assert_trust_object(test_ctx->ipa_ctx->server_mode->trusts->next,
|
|
|
9f2ebf |
+ assert_trust_object(s_trust,
|
|
|
9f2ebf |
SUBDOM_NAME,
|
|
|
9f2ebf |
DOM_REALM,
|
|
|
9f2ebf |
SUBDOM_SID,
|
|
|
9f2ebf |
@@ -708,6 +726,8 @@ static void test_ipa_server_create_trusts_oneway(struct tevent_req *req)
|
|
|
9f2ebf |
struct trust_test_ctx *test_ctx = \
|
|
|
9f2ebf |
tevent_req_callback_data(req, struct trust_test_ctx);
|
|
|
9f2ebf |
errno_t ret;
|
|
|
9f2ebf |
+ struct ipa_ad_server_ctx *s_trust;
|
|
|
9f2ebf |
+ struct ipa_ad_server_ctx *c_trust;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
ret = ipa_server_create_trusts_recv(req);
|
|
|
9f2ebf |
talloc_zfree(req);
|
|
|
9f2ebf |
@@ -720,9 +740,19 @@ static void test_ipa_server_create_trusts_oneway(struct tevent_req *req)
|
|
|
9f2ebf |
|
|
|
9f2ebf |
/* Trust object should be around now */
|
|
|
9f2ebf |
assert_non_null(test_ctx->ipa_ctx->server_mode->trusts);
|
|
|
9f2ebf |
+ assert_non_null(test_ctx->ipa_ctx->server_mode->trusts->next);
|
|
|
9f2ebf |
+
|
|
|
9f2ebf |
+ if (strcmp(test_ctx->ipa_ctx->server_mode->trusts->dom->name,
|
|
|
9f2ebf |
+ SUBDOM_NAME) == 0) {
|
|
|
9f2ebf |
+ s_trust = test_ctx->ipa_ctx->server_mode->trusts;
|
|
|
9f2ebf |
+ c_trust = test_ctx->ipa_ctx->server_mode->trusts->next;
|
|
|
9f2ebf |
+ } else {
|
|
|
9f2ebf |
+ s_trust = test_ctx->ipa_ctx->server_mode->trusts->next;
|
|
|
9f2ebf |
+ c_trust = test_ctx->ipa_ctx->server_mode->trusts;
|
|
|
9f2ebf |
+ }
|
|
|
9f2ebf |
|
|
|
9f2ebf |
assert_trust_object(
|
|
|
9f2ebf |
- test_ctx->ipa_ctx->server_mode->trusts,
|
|
|
9f2ebf |
+ c_trust,
|
|
|
9f2ebf |
CHILD_NAME, /* AD domain name */
|
|
|
9f2ebf |
CHILD_REALM, /* AD realm can be child if SDAP realm is parent's */
|
|
|
9f2ebf |
CHILD_SID,
|
|
|
9f2ebf |
@@ -730,10 +760,8 @@ static void test_ipa_server_create_trusts_oneway(struct tevent_req *req)
|
|
|
9f2ebf |
ONEWAY_PRINC, /* Principal shared with parent AD dom */
|
|
|
9f2ebf |
SUBDOM_REALM); /* SDAP realm must be AD root domain */
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- assert_non_null(test_ctx->ipa_ctx->server_mode->trusts->next);
|
|
|
9f2ebf |
-
|
|
|
9f2ebf |
/* Here all properties point to the AD domain */
|
|
|
9f2ebf |
- assert_trust_object(test_ctx->ipa_ctx->server_mode->trusts->next,
|
|
|
9f2ebf |
+ assert_trust_object(s_trust,
|
|
|
9f2ebf |
SUBDOM_NAME,
|
|
|
9f2ebf |
SUBDOM_REALM,
|
|
|
9f2ebf |
SUBDOM_SID,
|
|
|
9f2ebf |
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
|
|
|
9f2ebf |
index 4652661087238c18f7fabb398d054db99f77d6cf..fc9936968bcde8370c7054ba303de4463b35e15a 100644
|
|
|
9f2ebf |
--- a/src/tests/sysdb-tests.c
|
|
|
9f2ebf |
+++ b/src/tests/sysdb-tests.c
|
|
|
9f2ebf |
@@ -503,7 +503,7 @@ static int test_search_all_users(struct test_data *data)
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
ret = sysdb_search_entry(data, data->ctx->sysdb, base_dn,
|
|
|
9f2ebf |
- LDB_SCOPE_SUBTREE, "objectClass=user",
|
|
|
9f2ebf |
+ LDB_SCOPE_SUBTREE, SYSDB_UC,
|
|
|
9f2ebf |
data->attrlist, &data->msgs_count, &data->msgs);
|
|
|
9f2ebf |
return ret;
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
@@ -2219,6 +2219,7 @@ START_TEST (test_sysdb_search_all_users)
|
|
|
9f2ebf |
struct test_data *data;
|
|
|
9f2ebf |
int ret;
|
|
|
9f2ebf |
int i;
|
|
|
9f2ebf |
+ int j;
|
|
|
9f2ebf |
char *uid_str;
|
|
|
9f2ebf |
|
|
|
9f2ebf |
/* Setup */
|
|
|
9f2ebf |
@@ -2253,8 +2254,15 @@ START_TEST (test_sysdb_search_all_users)
|
|
|
9f2ebf |
"wrong number of values, found [%d] expected [1]",
|
|
|
9f2ebf |
data->msgs[i]->elements[0].num_values);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- uid_str = talloc_asprintf(data, "%d", 27010 + i);
|
|
|
9f2ebf |
- fail_unless(uid_str != NULL, "talloc_asprintf failed.");
|
|
|
9f2ebf |
+ for (j = 0; j < data->msgs_count; j++) {
|
|
|
9f2ebf |
+ uid_str = talloc_asprintf(data, "%d", 27010 + j);
|
|
|
9f2ebf |
+ fail_unless(uid_str != NULL, "talloc_asprintf failed.");
|
|
|
9f2ebf |
+ if (strncmp(uid_str,
|
|
|
9f2ebf |
+ (char *) data->msgs[i]->elements[0].values[0].data,
|
|
|
9f2ebf |
+ data->msgs[i]->elements[0].values[0].length) == 0) {
|
|
|
9f2ebf |
+ break;
|
|
|
9f2ebf |
+ }
|
|
|
9f2ebf |
+ }
|
|
|
9f2ebf |
fail_unless(strncmp(uid_str,
|
|
|
9f2ebf |
(char *) data->msgs[i]->elements[0].values[0].data,
|
|
|
9f2ebf |
data->msgs[i]->elements[0].values[0].length) == 0,
|
|
|
9f2ebf |
@@ -4411,7 +4419,7 @@ START_TEST(test_SSS_LDB_SEARCH)
|
|
|
9f2ebf |
|
|
|
9f2ebf |
/* Non-empty filter */
|
|
|
9f2ebf |
SSS_LDB_SEARCH(ret, test_ctx->sysdb->ldb, test_ctx, &res, group_dn,
|
|
|
9f2ebf |
- LDB_SCOPE_BASE, NULL, "objectClass=group");
|
|
|
9f2ebf |
+ LDB_SCOPE_BASE, NULL, SYSDB_GC);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
fail_unless(ret == EOK, "SSS_LDB_SEARCH error [%d][%s]",
|
|
|
9f2ebf |
ret, strerror(ret));
|
|
|
9f2ebf |
@@ -5203,7 +5211,7 @@ START_TEST (test_sysdb_search_return_ENOENT)
|
|
|
9f2ebf |
|
|
|
9f2ebf |
ret = sysdb_search_entry(test_ctx, test_ctx->sysdb,
|
|
|
9f2ebf |
user_dn, LDB_SCOPE_SUBTREE,
|
|
|
9f2ebf |
- "objectClass=user", NULL,
|
|
|
9f2ebf |
+ SYSDB_UC, NULL,
|
|
|
9f2ebf |
&count, &msgs);
|
|
|
9f2ebf |
fail_unless(ret == ENOENT, "sysdb_search_entry failed: %d, %s",
|
|
|
9f2ebf |
ret, strerror(ret));
|
|
|
9f2ebf |
@@ -5215,7 +5223,7 @@ START_TEST (test_sysdb_search_return_ENOENT)
|
|
|
9f2ebf |
data->username);
|
|
|
9f2ebf |
fail_if(user_dn == NULL, "sysdb_user_dn failed");
|
|
|
9f2ebf |
SSS_LDB_SEARCH(ret, test_ctx->sysdb->ldb, test_ctx, &res, user_dn,
|
|
|
9f2ebf |
- LDB_SCOPE_BASE, NULL, "objectClass=user");
|
|
|
9f2ebf |
+ LDB_SCOPE_BASE, NULL, SYSDB_UC);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
fail_unless(ret == ENOENT, "SSS_LDB_SEARCH failed: %d, %s",
|
|
|
9f2ebf |
ret, strerror(ret));
|
|
|
9f2ebf |
diff --git a/src/tools/sssctl/sssctl_cache.c b/src/tools/sssctl/sssctl_cache.c
|
|
|
9f2ebf |
index 80f65bb55df42d0b123023bb9b1efdb2353b8e20..42a2a60fd31631b3c86d17ddbdd8027a8468366d 100644
|
|
|
9f2ebf |
--- a/src/tools/sssctl/sssctl_cache.c
|
|
|
9f2ebf |
+++ b/src/tools/sssctl/sssctl_cache.c
|
|
|
9f2ebf |
@@ -335,7 +335,8 @@ static const char *sssctl_create_filter(TALLOC_CTX *mem_ctx,
|
|
|
9f2ebf |
talloc_free(filter_value_old);
|
|
|
9f2ebf |
}
|
|
|
9f2ebf |
|
|
|
9f2ebf |
- filter = talloc_asprintf(mem_ctx, "(&(objectClass=%s)(|(%s=%s)(%s=%s)))",
|
|
|
9f2ebf |
+ filter = talloc_asprintf(mem_ctx, "(&(%s=%s)(|(%s=%s)(%s=%s)))",
|
|
|
9f2ebf |
+ obj_type == CACHED_NETGROUP ? SYSDB_OBJECTCLASS : SYSDB_OBJECTCATEGORY,
|
|
|
9f2ebf |
class, attr_name, filter_value,
|
|
|
9f2ebf |
SYSDB_NAME_ALIAS, filter_value);
|
|
|
9f2ebf |
|
|
|
9f2ebf |
--
|
|
|
9f2ebf |
2.14.3
|
|
|
9f2ebf |
|