diff options
author | Simo Sorce <idra@samba.org> | 2008-12-22 15:54:56 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-12-22 18:52:48 -0500 |
commit | 41718e315ea78998fab0893fd5f148a49d8faab8 (patch) | |
tree | ecbc13fb3abce56481ba04e13d9aa1b69b19783b /ldb/tools | |
parent | a93a69380dc6718c49879af628ed69f8e2b70797 (diff) | |
download | sssd-41718e315ea78998fab0893fd5f148a49d8faab8.tar.gz sssd-41718e315ea78998fab0893fd5f148a49d8faab8.tar.bz2 sssd-41718e315ea78998fab0893fd5f148a49d8faab8.zip |
Rebase ldb code with all changes in samba master
Diffstat (limited to 'ldb/tools')
-rw-r--r-- | ldb/tools/ldbadd.c | 10 | ||||
-rw-r--r-- | ldb/tools/ldbedit.c | 10 | ||||
-rw-r--r-- | ldb/tools/ldbmodify.c | 10 |
3 files changed, 30 insertions, 0 deletions
diff --git a/ldb/tools/ldbadd.c b/ldb/tools/ldbadd.c index 15376e73..f32a4fa9 100644 --- a/ldb/tools/ldbadd.c +++ b/ldb/tools/ldbadd.c @@ -92,6 +92,11 @@ int main(int argc, const char **argv) options = ldb_cmdline_process(ldb, argc, argv, usage); + if (ldb_transaction_start(ldb) != 0) { + printf("Failed to start transaction: %s\n", ldb_errstring(ldb)); + exit(1); + } + if (options->argc == 0) { ret = process_file(ldb, stdin, &count); } else { @@ -108,6 +113,11 @@ int main(int argc, const char **argv) } } + if (count != 0 && ldb_transaction_commit(ldb) != 0) { + printf("Failed to commit transaction: %s\n", ldb_errstring(ldb)); + exit(1); + } + talloc_free(ldb); printf("Added %d records with %d failures\n", count, failures); diff --git a/ldb/tools/ldbedit.c b/ldb/tools/ldbedit.c index b2a040cd..1a684c5c 100644 --- a/ldb/tools/ldbedit.c +++ b/ldb/tools/ldbedit.c @@ -112,6 +112,11 @@ static int merge_edits(struct ldb_context *ldb, int ret = 0; int adds=0, modifies=0, deletes=0; + if (ldb_transaction_start(ldb) != 0) { + fprintf(stderr, "Failed to start transaction: %s\n", ldb_errstring(ldb)); + return -1; + } + /* do the adds and modifies */ for (i=0;i<count2;i++) { msg = msg_find(ldb, msgs1, count1, msgs2[i]->dn); @@ -150,6 +155,11 @@ static int merge_edits(struct ldb_context *ldb, } } + if (ldb_transaction_commit(ldb) != 0) { + fprintf(stderr, "Failed to commit transaction: %s\n", ldb_errstring(ldb)); + return -1; + } + printf("# %d adds %d modifies %d deletes\n", adds, modifies, deletes); return ret; diff --git a/ldb/tools/ldbmodify.c b/ldb/tools/ldbmodify.c index 6e355a10..d73937ce 100644 --- a/ldb/tools/ldbmodify.c +++ b/ldb/tools/ldbmodify.c @@ -93,6 +93,11 @@ int main(int argc, const char **argv) options = ldb_cmdline_process(ldb, argc, argv, usage); + if (ldb_transaction_start(ldb) != 0) { + printf("Failed to start transaction: %s\n", ldb_errstring(ldb)); + exit(1); + } + if (options->argc == 0) { ret = process_file(ldb, stdin, &count); } else { @@ -108,6 +113,11 @@ int main(int argc, const char **argv) } } + if (count != 0 && ldb_transaction_commit(ldb) != 0) { + printf("Failed to commit transaction: %s\n", ldb_errstring(ldb)); + exit(1); + } + talloc_free(ldb); printf("Modified %d records with %d failures\n", count, failures); |