summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-12-07 15:28:51 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-12-07 15:28:51 +1100
commit9b0780cf00e966a8df3dce698f37b6acaa28050d (patch)
tree08f5385021d036b44883e13e6cf676c63d767207 /source4/dsdb/samdb
parent54ea4b17f06a6f2fb343111be22f28191d21fdf1 (diff)
downloadsamba-9b0780cf00e966a8df3dce698f37b6acaa28050d.tar.gz
samba-9b0780cf00e966a8df3dce698f37b6acaa28050d.tar.bz2
samba-9b0780cf00e966a8df3dce698f37b6acaa28050d.zip
s4:dsdb Use ldb_match_msg_objectclass in operational.c
This avoids not only a possibly non-portable compiler expression, but also the need to look up the schema each time. Andrew Bartlett
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/operational.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c
index 161de8449e..badc0c5fa1 100644
--- a/source4/dsdb/samdb/ldb_modules/operational.c
+++ b/source4/dsdb/samdb/ldb_modules/operational.c
@@ -100,16 +100,11 @@ static int construct_canonical_name(struct ldb_module *module,
static int construct_primary_group_token(struct ldb_module *module,
struct ldb_message *msg)
{
- struct ldb_parse_tree objectclass_is_group = {
- .operation = LDB_OP_EQUALITY,
- .u.equality.attr = "objectClass",
- .u.equality.value = data_blob_string_const("group")
- };
struct ldb_context *ldb;
uint32_t primary_group_token;
ldb = ldb_module_get_ctx(module);
- if (ldb_match_msg(ldb, msg, &objectclass_is_group, msg->dn, LDB_SCOPE_BASE) == 1) {
+ if (ldb_match_msg_objectclass(msg, "group") == 1) {
primary_group_token
= samdb_result_rid_from_sid(ldb, msg, "objectSid", 0);
if (primary_group_token == 0) {