summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/acl.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-08-17 11:21:11 +1000
committerAndrew Tridgell <tridge@samba.org>2010-08-17 21:21:50 +1000
commit6baa834ebe710d73cfd54e465479a2b2de9d2476 (patch)
tree07e98dfeb43179fc25684f2e80580dc558c5717d /source4/dsdb/samdb/ldb_modules/acl.c
parent527042f78bc1672ca9a2f766b232165fb2a81d9f (diff)
downloadsamba-6baa834ebe710d73cfd54e465479a2b2de9d2476.tar.gz
samba-6baa834ebe710d73cfd54e465479a2b2de9d2476.tar.bz2
samba-6baa834ebe710d73cfd54e465479a2b2de9d2476.zip
s4-ldb: use LDB_FLAG_MOD_TYPE() to extract element type from messages
The flags field of message elements is part of a set of flags. We had LDB_FLAG_MOD_MASK for extracting the type, but it was only rarely being used (only 1 call used it correctly). This adds LDB_FLAG_MOD_MASK() to make it more obvious what is going on. This will allow us to use some of the other flags bits for internal markers on elements Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/acl.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/acl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/acl.c b/source4/dsdb/samdb/ldb_modules/acl.c
index 11fffa4053..4eb27e9d1e 100644
--- a/source4/dsdb/samdb/ldb_modules/acl.c
+++ b/source4/dsdb/samdb/ldb_modules/acl.c
@@ -761,13 +761,13 @@ static int acl_check_password_rights(TALLOC_CTX *mem_ctx,
}
for (l = passwordAttrs; *l != NULL; l++) {
while ((el = ldb_msg_find_element(msg, *l)) != NULL) {
- if (el->flags == LDB_FLAG_MOD_DELETE) {
+ if (LDB_FLAG_MOD_TYPE(el->flags) == LDB_FLAG_MOD_DELETE) {
++del_attr_cnt;
}
- if (el->flags == LDB_FLAG_MOD_ADD) {
+ if (LDB_FLAG_MOD_TYPE(el->flags) == LDB_FLAG_MOD_ADD) {
++add_attr_cnt;
}
- if (el->flags == LDB_FLAG_MOD_REPLACE) {
+ if (LDB_FLAG_MOD_TYPE(el->flags) == LDB_FLAG_MOD_REPLACE) {
++rep_attr_cnt;
}
ldb_msg_remove_element(msg, el);