diff options
author | Volker Lendecke <vl@samba.org> | 2013-02-21 16:34:32 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-05-22 21:05:14 +0200 |
commit | 9bf4f10b4b326f2d2a1f8a40f0eb55a0c39c6689 (patch) | |
tree | 1444cb16b458fdb37ebf90915283d1a2ddfdc579 /lib/tdb/tools | |
parent | b4b8e393e5bde7989707b5a7c6cab1da7ae2c0d0 (diff) | |
download | samba-9bf4f10b4b326f2d2a1f8a40f0eb55a0c39c6689.tar.gz samba-9bf4f10b4b326f2d2a1f8a40f0eb55a0c39c6689.tar.xz samba-9bf4f10b4b326f2d2a1f8a40f0eb55a0c39c6689.zip |
tdb/tools: explicitly use TDB_NOLOCK in tdbdump
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/tdb/tools')
-rw-r--r-- | lib/tdb/tools/tdbdump.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/tdb/tools/tdbdump.c b/lib/tdb/tools/tdbdump.c index a739f999e7..9a0a7fe6d4 100644 --- a/lib/tdb/tools/tdbdump.c +++ b/lib/tdb/tools/tdbdump.c @@ -99,8 +99,16 @@ static int dump_tdb(const char *fname, const char *keyname, bool emergency) TDB_CONTEXT *tdb; TDB_DATA key, value; struct tdb_logging_context logfn = { log_stderr }; + int tdb_flags = TDB_DEFAULT; - tdb = tdb_open_ex(fname, 0, 0, O_RDONLY, 0, &logfn, NULL); + /* + * Note: that O_RDONLY implies TDB_NOLOCK, but we want to make it + * explicit as it's important when working on databases which were + * created with mutex locking. + */ + tdb_flags |= TDB_NOLOCK; + + tdb = tdb_open_ex(fname, 0, tdb_flags, O_RDONLY, 0, &logfn, NULL); if (!tdb) { printf("Failed to open %s\n", fname); return 1; |