diff options
author | Simo Sorce <idra@samba.org> | 2006-12-11 15:49:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:29:07 -0500 |
commit | 2cd08c14a014a9326c6f42b83b4f2187bd2165b2 (patch) | |
tree | e02ae724cca76b6b32f3424ec1521383f398b4a7 /source4/lib/ldb/ldb_tdb/ldb_tdb.c | |
parent | d4ac51982cda20736878ffcba4118ca53b8fa09e (diff) | |
download | samba-2cd08c14a014a9326c6f42b83b4f2187bd2165b2.tar.gz samba-2cd08c14a014a9326c6f42b83b4f2187bd2165b2.tar.bz2 samba-2cd08c14a014a9326c6f42b83b4f2187bd2165b2.zip |
r20106: Optional ONE Level indexing for ldb_tdb
To activate it you must modify the @INDEXLIST object adding
the attribute @IDXONE: 1
Ldb test included
Simo.
(This used to be commit ea111795f4016916473ccc05d23c6655e6af1207)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_tdb.c')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_tdb.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c index bf90115f51..09ddca5034 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c @@ -276,6 +276,11 @@ static int ltdb_add_internal(struct ldb_module *module, const struct ldb_message } if (ret == LDB_SUCCESS) { + ret = ltdb_index_one(module, msg, 1); + if (ret != LDB_SUCCESS) { + return LDB_ERR_OPERATIONS_ERROR; + } + ret = ltdb_modified(module, msg->dn); if (ret != LDB_SUCCESS) { return LDB_ERR_OPERATIONS_ERROR; @@ -372,6 +377,13 @@ static int ltdb_delete_internal(struct ldb_module *module, struct ldb_dn *dn) return LDB_ERR_NO_SUCH_OBJECT; } + /* remove one level attribute */ + ret = ltdb_index_one(module, msg, 0); + if (ret != LDB_SUCCESS) { + talloc_free(msg); + return LDB_ERR_OPERATIONS_ERROR; + } + /* remove any indexed attributes */ ret = ltdb_index_del(module, msg); if (ret != LDB_SUCCESS) { |