r19190: merge from samba4:
authorStefan Metzmacher <metze@samba.org>
Mon, 9 Oct 2006 08:22:59 +0000 (08:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:15:21 +0000 (12:15 -0500)
remove wrong check and statement.
to manipulate rootDSE we use ldb_dn_new() as base and that has 0 elements.

metze
(This used to be commit b81cae4180452d2a14c445392fd828032e6eddec)

source3/lib/ldb/common/ldb_msg.c

index 809d965745bb5f56e179952a7a6e6bdd98bc2ccd..7e001f91807513dfcc74582ce47d28c6ace8bb01 100644 (file)
@@ -229,7 +229,7 @@ int ldb_msg_add_string(struct ldb_message *msg,
 
        if (val.length == 0) {
                /* allow empty strings as non-existant attributes */
-               return 0;
+               return LDB_SUCCESS;
        }
 
        return ldb_msg_add_value(msg, attr_name, &val);
@@ -596,11 +596,6 @@ int ldb_msg_sanity_check(struct ldb_context *ldb,
                ldb_set_errstring(ldb, "ldb message lacks a DN!");
                return LDB_ERR_INVALID_DN_SYNTAX;
        }
-       if (msg->dn->comp_num == 0) {
-               /* root dse has empty dn */
-               ldb_set_errstring(ldb, "DN on new ldb message is '' (not permitted)!");
-               return LDB_ERR_ENTRY_ALREADY_EXISTS;
-       }
 
        /* basic syntax checks */
        for (i = 0; i < msg->num_elements; i++) {