s4-ldb: fixed error on single value error
authorAndrew Tridgell <tridge@samba.org>
Tue, 6 Oct 2009 07:57:06 +0000 (18:57 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Oct 2009 07:57:06 +0000 (18:57 +1100)
When you try to add a 2nd value to a single valued attribute you get
LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS. w2k8-r2 join to s4 relies on this
error, doing a replace after it sees the error

source4/lib/ldb/ldb_tdb/ldb_tdb.c

index 08208959f310f5b96a4ea36343e4f3dd336c3f62..66a10b64138ecfa111b76aa9caf492c9fda728b8 100644 (file)
@@ -664,7 +664,7 @@ int ltdb_modify_internal(struct ldb_module *module,
                         * exists in the object, then we violoate the
                         * single-value rule */
                        if (a && a->flags & LDB_ATTR_FLAG_SINGLE_VALUE) {
-                               ret = LDB_ERR_CONSTRAINT_VIOLATION;
+                               ret = LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS;
                                goto failed;
                        }