]> git.samba.org - samba.git/commitdiff
s4-ldb: expose ltdb_err_map and ltdb_delete_noindex
authorAndrew Tridgell <tridge@samba.org>
Thu, 22 Oct 2009 00:06:33 +0000 (11:06 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 22 Oct 2009 01:47:54 +0000 (12:47 +1100)
These will be used by ldb_index.c

source4/lib/ldb/ldb_tdb/ldb_tdb.c
source4/lib/ldb/ldb_tdb/ldb_tdb.h

index f8ed329fcdc6f08e18aa096eaaf146239dedc3fa..01153fe2035c4be6eb0bb9c784a31191237acf50 100644 (file)
@@ -55,7 +55,7 @@
 /*
   map a tdb error code to a ldb error code
 */
-static int ltdb_err_map(enum TDB_ERROR tdb_code)
+int ltdb_err_map(enum TDB_ERROR tdb_code)
 {
        switch (tdb_code) {
        case TDB_SUCCESS:
@@ -335,7 +335,7 @@ static int ltdb_add(struct ltdb_context *ctx)
   delete a record from the database, not updating indexes (used for deleting
   index records)
 */
-static int ltdb_delete_noindex(struct ldb_module *module, struct ldb_dn *dn)
+int ltdb_delete_noindex(struct ldb_module *module, struct ldb_dn *dn)
 {
        void *data = ldb_module_get_private(module);
        struct ltdb_private *ltdb = talloc_get_type(data, struct ltdb_private);
@@ -730,6 +730,7 @@ int ltdb_modify_internal(struct ldb_module *module,
                                }
                        }
 
+                       /* TODO: This is O(n^2) - replace with more efficient check */
                        for (j=0; j<el->num_values; j++) {
                                if (ldb_msg_find_val(el, &el->values[j]) != &el->values[j]) {
                                        ldb_asprintf_errstring(ldb, "%s: value #%d provided more than once", el->name, j);
index c5eec0a518acf1d8a4f27d1f097630142f4427f6..b3887a6c3471dbe82ebb9e11284e1a4ea47b3f93 100644 (file)
@@ -129,6 +129,8 @@ int ltdb_unlock_read(struct ldb_module *module);
 struct TDB_DATA ltdb_key(struct ldb_module *module, struct ldb_dn *dn);
 int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flgs);
 int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *msg);
+int ltdb_delete_noindex(struct ldb_module *module, struct ldb_dn *dn);
+int ltdb_err_map(enum TDB_ERROR tdb_code);
 
 struct tdb_context *ltdb_wrap_open(TALLOC_CTX *mem_ctx,
                                   const char *path, int hash_size, int tdb_flags,