summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_tdb.c
diff options
context:
space:
mode:
authorNadezhda Ivanova <nadezhda.ivanova@postpath.com>2010-01-04 11:24:10 +0200
committerNadezhda Ivanova <nadezhda.ivanova@postpath.com>2010-01-04 11:24:10 +0200
commitfb5383c69ee52fb5e6d066a43451dc8c806cc795 (patch)
tree45b72e03f68ab6d212755c524f8e8a60a3b4373a /source4/lib/ldb/ldb_tdb/ldb_tdb.c
parent60d8ab3b7b0bd2c9b633f0380d1fdf5bcf5e2621 (diff)
parenta06e5cdb99ddf7abf16486d3837105ec4e0da9ee (diff)
downloadsamba-fb5383c69ee52fb5e6d066a43451dc8c806cc795.tar.gz
samba-fb5383c69ee52fb5e6d066a43451dc8c806cc795.tar.bz2
samba-fb5383c69ee52fb5e6d066a43451dc8c806cc795.zip
Merge branch 'master' of git://git.samba.org/samba
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_tdb.c')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 227a202a6f..a146b96b20 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -592,9 +592,12 @@ static int msg_delete_element(struct ldb_module *module,
yuck - this is O(n^2). Luckily n is usually small so we probably
get away with it, but if we ever have really large attribute lists
then we'll need to look at this again
+
+ 'req' is optional, and is used to specify controls if supplied
*/
int ltdb_modify_internal(struct ldb_module *module,
- const struct ldb_message *msg)
+ const struct ldb_message *msg,
+ struct ldb_request *req)
{
struct ldb_context *ldb = ldb_module_get_ctx(module);
void *data = ldb_module_get_private(module);
@@ -731,7 +734,15 @@ int ltdb_modify_internal(struct ldb_module *module,
case LDB_FLAG_MOD_REPLACE:
if (a && a->flags & LDB_ATTR_FLAG_SINGLE_VALUE) {
- if (el->num_values > 1) {
+ /* the RELAX control overrides this
+ check for replace. This is needed as
+ DRS replication can produce multiple
+ values here for a single valued
+ attribute when the values are deleted
+ links
+ */
+ if (el->num_values > 1 &&
+ (!req || !ldb_request_get_control(req, LDB_CONTROL_RELAX_OID))) {
ldb_asprintf_errstring(ldb, "SINGLE-VALUE attribute %s on %s specified more than once",
el->name, ldb_dn_get_linearized(msg2->dn));
ret = LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS;
@@ -852,7 +863,7 @@ static int ltdb_modify(struct ltdb_context *ctx)
return LDB_ERR_OPERATIONS_ERROR;
}
- ret = ltdb_modify_internal(module, req->op.mod.message);
+ ret = ltdb_modify_internal(module, req->op.mod.message, req);
return ret;
}