summaryrefslogtreecommitdiff
path: root/source4/rpc_server
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/rpc_server
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/rpc_server')
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index 0a94a87480..0a347e07dd 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -2600,7 +2600,7 @@ static NTSTATUS dcesrv_lsa_AddRemoveAccountRights(struct dcesrv_call_state *dce_
msg->dn = ldb_dn_new(msg, state->pdb, dnstr);
NT_STATUS_HAVE_NO_MEMORY_AND_FREE(msg->dn, msg);
- if (ldb_flag == LDB_FLAG_MOD_ADD) {
+ if (LDB_FLAG_MOD_TYPE(ldb_flag) == LDB_FLAG_MOD_ADD) {
NTSTATUS status;
r2.in.handle = &state->handle->wire_handle;
@@ -2619,7 +2619,7 @@ static NTSTATUS dcesrv_lsa_AddRemoveAccountRights(struct dcesrv_call_state *dce_
return NT_STATUS_NO_SUCH_PRIVILEGE;
}
- if (ldb_flag == LDB_FLAG_MOD_ADD) {
+ if (LDB_FLAG_MOD_TYPE(ldb_flag) == LDB_FLAG_MOD_ADD) {
uint32_t j;
for (j=0;j<r2.out.rights->count;j++) {
if (strcasecmp_m(r2.out.rights->names[j].string,
@@ -2655,12 +2655,12 @@ static NTSTATUS dcesrv_lsa_AddRemoveAccountRights(struct dcesrv_call_state *dce_
ret = ldb_add(state->pdb, msg);
}
if (ret != LDB_SUCCESS) {
- if (ldb_flag == LDB_FLAG_MOD_DELETE && ret == LDB_ERR_NO_SUCH_ATTRIBUTE) {
+ if (LDB_FLAG_MOD_TYPE(ldb_flag) == LDB_FLAG_MOD_DELETE && ret == LDB_ERR_NO_SUCH_ATTRIBUTE) {
talloc_free(msg);
return NT_STATUS_OK;
}
DEBUG(3, ("Could not %s attributes from %s: %s",
- ldb_flag == LDB_FLAG_MOD_DELETE ? "delete" : "add",
+ LDB_FLAG_MOD_TYPE(ldb_flag) == LDB_FLAG_MOD_DELETE ? "delete" : "add",
ldb_dn_get_linearized(msg->dn), ldb_errstring(state->pdb)));
talloc_free(msg);
return NT_STATUS_UNEXPECTED_IO_ERROR;