summaryrefslogtreecommitdiff
path: root/source3/lib/ldb/modules
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-10-25 02:06:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:39 -0500
commit151237477bef0d8fdcf926fa0fbe048580a58be5 (patch)
treea0e7ba5ef168739b4f1b191b65b19ad9d28d4275 /source3/lib/ldb/modules
parente6b56f9f0c601c740432c7040a737f679c131eb3 (diff)
downloadsamba-151237477bef0d8fdcf926fa0fbe048580a58be5.tar.gz
samba-151237477bef0d8fdcf926fa0fbe048580a58be5.tar.bz2
samba-151237477bef0d8fdcf926fa0fbe048580a58be5.zip
r19491: backport changes from samba4
(This used to be commit aa464c9fda978f615230241921f83884a60f4c6f)
Diffstat (limited to 'source3/lib/ldb/modules')
-rw-r--r--source3/lib/ldb/modules/ldb_map.c2
-rw-r--r--source3/lib/ldb/modules/ldb_map_inbound.c2
-rw-r--r--source3/lib/ldb/modules/ldb_map_outbound.c7
-rw-r--r--source3/lib/ldb/modules/objectclass.c6
-rw-r--r--source3/lib/ldb/modules/rdn_name.c12
5 files changed, 12 insertions, 17 deletions
diff --git a/source3/lib/ldb/modules/ldb_map.c b/source3/lib/ldb/modules/ldb_map.c
index f9ae66a2aa..1cdeeeb293 100644
--- a/source3/lib/ldb/modules/ldb_map.c
+++ b/source3/lib/ldb/modules/ldb_map.c
@@ -964,7 +964,7 @@ struct ldb_request *map_build_fixup_req(struct map_context *ac, const struct ldb
if (dn == NULL) {
goto failed;
}
- if (ldb_msg_add_empty(msg, IS_MAPPED, LDB_FLAG_MOD_REPLACE) != 0) {
+ if (ldb_msg_add_empty(msg, IS_MAPPED, LDB_FLAG_MOD_REPLACE, NULL) != 0) {
goto failed;
}
if (ldb_msg_add_string(msg, IS_MAPPED, dn) != 0) {
diff --git a/source3/lib/ldb/modules/ldb_map_inbound.c b/source3/lib/ldb/modules/ldb_map_inbound.c
index 404b2ce528..b83a17e502 100644
--- a/source3/lib/ldb/modules/ldb_map_inbound.c
+++ b/source3/lib/ldb/modules/ldb_map_inbound.c
@@ -345,7 +345,7 @@ int map_modify_do_local(struct ldb_handle *handle)
/* Add local 'IS_MAPPED' */
/* TODO: use GUIDs here instead */
dn = ldb_dn_linearize(msg, ac->remote_req->op.mod.message->dn);
- if (ldb_msg_add_empty(msg, IS_MAPPED, LDB_FLAG_MOD_ADD) != 0) {
+ if (ldb_msg_add_empty(msg, IS_MAPPED, LDB_FLAG_MOD_ADD, NULL) != 0) {
return LDB_ERR_OPERATIONS_ERROR;
}
if (ldb_msg_add_string(msg, IS_MAPPED, dn) != 0) {
diff --git a/source3/lib/ldb/modules/ldb_map_outbound.c b/source3/lib/ldb/modules/ldb_map_outbound.c
index cd33f29043..ff3b5c3aa2 100644
--- a/source3/lib/ldb/modules/ldb_map_outbound.c
+++ b/source3/lib/ldb/modules/ldb_map_outbound.c
@@ -192,12 +192,7 @@ static int ldb_msg_replace(struct ldb_message *msg, const struct ldb_message_ele
/* no local result, add as new element */
if (old == NULL) {
- if (ldb_msg_add_empty(msg, el->name, 0) != 0) {
- return -1;
- }
-
- old = ldb_msg_find_element(msg, el->name);
- if (old == NULL) {
+ if (ldb_msg_add_empty(msg, el->name, 0, &old) != 0) {
return -1;
}
}
diff --git a/source3/lib/ldb/modules/objectclass.c b/source3/lib/ldb/modules/objectclass.c
index e4040a8e3d..191238f9c9 100644
--- a/source3/lib/ldb/modules/objectclass.c
+++ b/source3/lib/ldb/modules/objectclass.c
@@ -250,7 +250,7 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
}
ldb_msg_remove_attr(msg, "objectClass");
- ret = ldb_msg_add_empty(msg, "objectClass", 0);
+ ret = ldb_msg_add_empty(msg, "objectClass", 0, NULL);
if (ret != LDB_SUCCESS) {
talloc_free(mem_ctx);
@@ -351,7 +351,7 @@ static int objectclass_modify(struct ldb_module *module, struct ldb_request *req
* because we need it sorted */
ldb_msg_remove_attr(msg, "objectClass");
- ret = ldb_msg_add_empty(msg, "objectClass", LDB_FLAG_MOD_REPLACE);
+ ret = ldb_msg_add_empty(msg, "objectClass", LDB_FLAG_MOD_REPLACE, NULL);
if (ret != LDB_SUCCESS) {
talloc_free(mem_ctx);
@@ -537,7 +537,7 @@ static int objectclass_do_mod(struct ldb_handle *h) {
* We could do a constrained add/del, but we are meant to be
* in a transaction... */
- ret = ldb_msg_add_empty(msg, "objectClass", LDB_FLAG_MOD_REPLACE);
+ ret = ldb_msg_add_empty(msg, "objectClass", LDB_FLAG_MOD_REPLACE, NULL);
if (ret != LDB_SUCCESS) {
ldb_set_errstring(ac->module->ldb, "objectclass: could not clear objectclass in modify msg");
talloc_free(mem_ctx);
diff --git a/source3/lib/ldb/modules/rdn_name.c b/source3/lib/ldb/modules/rdn_name.c
index fce1d34ac0..510a43dbc9 100644
--- a/source3/lib/ldb/modules/rdn_name.c
+++ b/source3/lib/ldb/modules/rdn_name.c
@@ -91,7 +91,7 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req)
attribute->num_values = 0;
}
- if (ldb_msg_add_value(msg, "name", &rdn->value) != 0) {
+ if (ldb_msg_add_value(msg, "name", &rdn->value, NULL) != 0) {
talloc_free(down_req);
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -99,7 +99,7 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req)
attribute = rdn_name_find_attribute(msg, rdn->name);
if (!attribute) {
- if (ldb_msg_add_value(msg, rdn->name, &rdn->value) != 0) {
+ if (ldb_msg_add_value(msg, rdn->name, &rdn->value, NULL) != 0) {
talloc_free(down_req);
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -213,16 +213,16 @@ static int rdn_name_rename_do_mod(struct ldb_handle *h) {
return LDB_ERR_OPERATIONS_ERROR;
}
- if (ldb_msg_add_empty(msg, rdn->name, LDB_FLAG_MOD_REPLACE) != 0) {
+ if (ldb_msg_add_empty(msg, rdn->name, LDB_FLAG_MOD_REPLACE, NULL) != 0) {
return LDB_ERR_OPERATIONS_ERROR;
}
- if (ldb_msg_add_value(msg, rdn->name, &rdn->value) != 0) {
+ if (ldb_msg_add_value(msg, rdn->name, &rdn->value, NULL) != 0) {
return LDB_ERR_OPERATIONS_ERROR;
}
- if (ldb_msg_add_empty(msg, "name", LDB_FLAG_MOD_REPLACE) != 0) {
+ if (ldb_msg_add_empty(msg, "name", LDB_FLAG_MOD_REPLACE, NULL) != 0) {
return LDB_ERR_OPERATIONS_ERROR;
}
- if (ldb_msg_add_value(msg, "name", &rdn->value) != 0) {
+ if (ldb_msg_add_value(msg, "name", &rdn->value, NULL) != 0) {
return LDB_ERR_OPERATIONS_ERROR;
}