1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-06 13:18:07 +03:00
samba-mirror/lib/ldb/tools
Andrew Bartlett b8aa05525e ldb: ensure that ldbedit operates like ldbmodify: set DONT_CREATE_DB
ldb* tools, when passed a raw filename assume tdb://

By default, ldb_tdb will call tdb with O_CREAT.

TDB, when passed O_CREAT and a not-tdb file, will wipe the file.

This means that if you run ldbedit <path to mdb-format-ldb file> the file
will be wiped, which is unexpected.  I noticed this while trying to
corrupt a sam.ldb backend file (for testing), but instead I wiped it!

Ideally tdb would not do that, but the behaviour has been this way for
decades.  Ideally ldb would have had a "create db" command, but this
has been the job of ldbadd for over a decade.

So this just blunts the knife for ldbedit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14302

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2020-03-02 02:47:30 +00:00
..
cmdline.c ldb: ensure that ldbedit operates like ldbmodify: set DONT_CREATE_DB 2020-03-02 02:47:30 +00:00
cmdline.h ldb: ensure that ldbedit operates like ldbmodify: set DONT_CREATE_DB 2020-03-02 02:47:30 +00:00
ldbadd.c lib/ldb/tools: add missing "replace.h" 2012-06-11 01:21:01 +02:00
ldbdel.c Revert "ldb: Permit desactivation of autocomit for every ldb_xxx_ctrl function" 2012-04-10 16:40:05 +10:00
ldbdump.c ldb: ldbdump key and pack format version comments 2019-05-22 05:58:17 +00:00
ldbedit.c ldb: ensure that ldbedit operates like ldbmodify: set DONT_CREATE_DB 2020-03-02 02:47:30 +00:00
ldbmodify.c lib/ldb/tools: add missing "replace.h" 2012-06-11 01:21:01 +02:00
ldbrename.c lib/ldb/tools: add missing "replace.h" 2012-06-11 01:21:01 +02:00
ldbsearch.c fix mem leak in ldbsearch 2018-08-15 07:08:24 +02:00
ldbtest.c ldb/tools/ldbtest: initialise msg object 2019-05-10 01:15:18 +00:00
ldbutil.c lib/ldb/tools: add missing "replace.h" 2012-06-11 01:21:01 +02:00
ldbutil.h ldb: Fix format-nonliteral warning 2016-08-24 01:33:50 +02:00