summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/common/traverse.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-09-22 13:20:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:44 -0500
commit86df9ca15a4488bb96f1d7c9244d8f9bb12912ba (patch)
tree433b30a7b1141fb0e84803c480347edd9acceb60 /source4/lib/tdb/common/traverse.c
parentfcb41c3bbde43c0b25aff7d6b5377301445eec00 (diff)
downloadsamba-86df9ca15a4488bb96f1d7c9244d8f9bb12912ba.tar.gz
samba-86df9ca15a4488bb96f1d7c9244d8f9bb12912ba.tar.bz2
samba-86df9ca15a4488bb96f1d7c9244d8f9bb12912ba.zip
r10424: for caller convenience, automatically turn a tdb_traverse() into a
tdb_traverse_read() for read only databases (This used to be commit 9b53e04377d2ff652c4a9496798d2e3aa0dccab3)
Diffstat (limited to 'source4/lib/tdb/common/traverse.c')
-rw-r--r--source4/lib/tdb/common/traverse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/tdb/common/traverse.c b/source4/lib/tdb/common/traverse.c
index 335dce4152..f8315f5770 100644
--- a/source4/lib/tdb/common/traverse.c
+++ b/source4/lib/tdb/common/traverse.c
@@ -220,6 +220,10 @@ int tdb_traverse(struct tdb_context *tdb,
{
struct tdb_traverse_lock tl = { NULL, 0, 0, F_WRLCK };
int ret;
+
+ if (tdb->read_only) {
+ return tdb_traverse_read(tdb, fn, private);
+ }
if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_WRLCK, F_SETLKW, 0) == -1) {
TDB_LOG((tdb, 0, "tdb_traverse: failed to get transaction lock\n"));