1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

59 Commits

Author SHA1 Message Date
Michael Adam
0e80775c1b tdb:torture: fix -O3 error unused result of write
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Michael Adam
a860245c4d tdb:torture: fix -O3 error unused result code of read
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
2016-05-13 00:16:15 +02:00
Ralph Boehme
a36a734717 Revert "tdb: Add tdbdump -u"
This reverts commit ea53e86c25.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Sep 18 14:03:12 CEST 2015 on sn-devel-104
2015-09-18 14:03:12 +02:00
Volker Lendecke
ea53e86c25 tdb: Add tdbdump -u
The reverse of tdbdump

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep 18 03:04:35 CEST 2015 on sn-devel-104
2015-09-18 03:04:35 +02:00
Uri Simchoni
5768ca6523 tdbrestore: include config.h before any glibc headers
config.h may have some flags which affect glibc behavior, e.g.
_FILE_OFFSET_BITS=64. To make sure these flags have the desired
effect, config.h must be included before any glibc header files.

This commit does not fix a specific known bug. It changes the code to
comply with coding conventions.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: "Stefan Metzmacher" <metze@samba.org>
2015-07-17 01:38:15 +02:00
Stefan Metzmacher
f32747ddd0 tdb/toos: allow transactions with TDB_MUTEX_LOCKING
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11004

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-19 09:20:07 +01:00
Stefan Metzmacher
5355f5e4e0 tdb:tools: fix a compiler warning
../../tdb/tools/tdbtool.c: In function ‘do_command’:
   ../../tdb/tools/tdbtool.c:717: error: declaration of ‘count’ shadows a global declaration
   ../../tdb/tools/tdbtool.c:597: error: shadowed declaration is here

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-16 09:47:05 +02:00
David Disseldorp
4f58041639 tdbtorture: print details when run with -n 1
Currently tdbtorture prints the test details (processes, loops, etc.)
from the first forked child process.
When run with -n 1 (one process), the test is run from within the
parent and no details are printed. This change ensures that they are.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Aug 18 13:26:32 CEST 2014 on sn-devel-104
2014-08-18 13:26:32 +02:00
Michael Adam
6502df5839 tdb: add "freelist_size" sub-command to tdbtool
With the new code, this has the side effect of
merging adjacent records in the freelist if the
database is not read-only.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-06-26 10:00:11 +02:00
Volker Lendecke
85fe2e8e3b tdb/tools: Allow tdbtool to r/o open mutexed tdbs
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
bd54feab46 tdb/tools: add -m option to tdbtorture
This allows tdbtorture to run with mutexes.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:15 +02:00
Volker Lendecke
9bf4f10b4b 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>
2014-05-22 21:05:14 +02:00
Volker Lendecke
b4b8e393e5 tdb/tools: add -l option to tdbtool
This opens the tdb with TDB_NOLOCK.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:14 +02:00
Volker Lendecke
781563061d tdb/tools: add -l option to tdbbackup
This opens the tdb with TDB_NOLOCK.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-22 21:05:14 +02:00
Stefan Metzmacher
e301d1b960 tdb/tools: avoid const warnings in tdbdump.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:42 +02:00
Volker Lendecke
a6a0d238b3 tdb: Fix CID 1034959 Uninitialized scalar variable
log_ctx.log_private was used uninitialized. Not a real bug here,
as tdb_log does not access it, but tdb_open_ex still moves around
uninitialized data. So this would show up in valgrind as well.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-07-22 15:07:21 -07:00
Volker Lendecke
f25449b00a tdb: Fix CID 1034960 Uninitialized scalar variable
log_ctx.log_private was used uninitialized. Not a real bug here,
as tdb_log does not access it, but tdb_open_ex still moves around
uninitialized data. So this would show up in valgrind as well.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-07-22 15:06:32 -07:00
Bill Parker
9b58da9866 Fix bug 10025 - Lack of Sanity Checking in calls to malloc()/calloc().
In reviewing various files in Samba-4.0.7, I found a number
of instances where malloc()/calloc() were called without the
checking the return value for a value of NULL, which would
indicate failure.

(NB. The changes needed to ccan, iniparser, popt and heimdal
will be reported upstream, not patched inside Samba).

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Source <idra@samba.org>
2013-07-17 16:12:19 -07:00
Volker Lendecke
c8c0bf7480 tdb: Fix blank line endings
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26 10:11:48 +01:00
Volker Lendecke
5929e38b6c tdb: Don't segfault if tdb_open_ex for check failed
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 15:46:45 +01:00
Jeremy Allison
80a6fe8427 Remove some unused variables.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-19 10:32:30 +01:00
Volker Lendecke
1beb4bc9d1 tdb: Fix \n in error messages
Reviewed-by: Rusty Russell <rusty@samba.org>
2013-01-07 09:32:22 +01:00
Rusty Russell
100d38d6e0 tdb: add -e option to tdbdump (and docment it).
This allows for an emergency best-effort dump.  It's a little better than
strings(1).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Thu Oct  4 03:16:06 CEST 2012 on sn-devel-104
2012-10-04 03:16:06 +02:00
Rusty Russell
ffde867891 tdb: tdbdump should log errors, and fail in that case.
Dumping a corrupt database should not exit silently with 0 status!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-04 09:04:23 +09:30
Stefan Metzmacher
e2caba054f tdb: remove unused debug_fprintf() macro that breaks the build
The IRIX compiler doesn't support '...' in a macro.

metze
2012-06-14 09:34:14 +02:00
Ira Cooper
eff69aa0f9 Add "repack" command to tdbtool.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Jan  7 02:18:41 CET 2012 on sn-devel-104
2012-01-07 02:18:40 +01:00
Jeremy Allison
3741cf999e Remove unused variable.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Nov 24 00:17:41 CET 2011 on sn-devel-104
2011-11-24 00:17:40 +01:00
Jeremy Allison
3e6e1aed94 Fix a bunch of "warning: variable ‘XXXX’ set but not used [-Wunused-but-set-variable]" warnings from the new gcc.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Nov 21 23:39:08 CET 2011 on sn-devel-104
2011-11-21 23:39:08 +01:00
Andrew Tridgell
e01f3108ff tdb: remove 'EOF' print from tdbrestore
the EOF message is pointless, and makes for noisy scripts

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-21 11:44:37 +10:00
Rusty Russell
6bc59d77b6 tdb_store: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Simo Sorce
1804d9a646 tdb_backup: avoid transaction on backup file, use lockall
Transactions have the side effect of generating bigger files.
By removing the transaction files get as much as 30% smaller.

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Tue Apr 19 23:34:37 CEST 2011 on sn-devel-104
2011-04-19 23:34:37 +02:00
Andrew Tridgell
bfce962c8f tdb: rename convert_string() to tdb_convert_string()
this prevents a conflict with the convert_string() in samba
2011-03-25 04:37:06 +01:00
Jelmer Vernooij
24d5a7202a tdbrestore: Update to GPLv3+, remove old FSF address. 2011-01-06 15:21:21 +01:00
Rusty Russell
cac57328a6 tdb: tdb_summary() support.
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Wed Dec 29 10:12:05 CET 2010 on sn-devel-104
2010-12-29 10:12:05 +01:00
Stefan Metzmacher
b83672b36c tdb:tdbtorture: use TEST_DATA_PREFIX for files
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Dec 24 18:17:53 CET 2010 on sn-devel-104
2010-12-24 18:17:53 +01:00
Stefan Metzmacher
d81ceeb983 tdb:tdbtest: use TEST_DATA_PREFIX for files
metze
2010-12-24 17:31:06 +01:00
Matthias Dieter Wallnöfer
d2560cd7dc tdb:tdbstore.c - remove an useless '\'
Discovered by a warning of the Tru64 host on the buildfarm.
2010-11-27 18:22:38 +01:00
Volker Lendecke
66731461a6 tdb: add restore
Based on an idea by Simon McVittie, largely rewritten
2010-09-23 12:19:09 -07:00
Jelmer Vernooij
7da94cc4a6 subunit: Support formatting compatible with upstream subunit, for consistency.
Upstream subunit makes a ":" after commands optional, so I've fixed any
places where we might trigger commands accidently. I've filed a bug
about this in subunit.
2010-04-11 20:57:33 +02:00
Volker Lendecke
e2c7e5c4f7 tdb: Fix bug 7248, avoid the nanosleep dependency 2010-03-22 21:29:21 +01:00
Rusty Russell
ececeffd85 tdb: add -k option to tdbtorture
To test the case of death of a process during transaction commit, add
a -k (kill random) option to tdbtorture.  The easiest way to do this
is to make every worker a child (unless there's only one child), which
is why this patch is bigger than you might expect.

Using -k without -t (always transactions) you expect corruption, though
it doesn't happen every time.  With -t, we currently get corruption but
the next patch fixes that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 10:53:05 +10:30
Günther Deschner
a23084e1e8 tdbtool: avoid using c++ reserved words.
Guenther
2009-12-17 15:40:42 +01:00
Matthias Dieter Wallnöfer
9776cb0345 tdb tools: Mostly cosmetic adaptions
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-20 16:50:48 +01:00
Rusty Russell
0944931159 lib/tdb: make tdbtool use tdb_check() for "check" command
Also, set logging function so we get more informative messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:11:34 +10:30
Rusty Russell
0fc6800005 lib/tdb: add -t (always use transactions) option to tdbtorture
This means you can kill it at any time and expect no corruption.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:10:54 +10:30
Andrew Tridgell
5dcf0069b6 tdb: fixed the intermittent failure of tdbtorture in the build farm
There was a race condition that caused the torture.tdb to be left in a
state that needed recovery. The torture code thought that any message
from the tdb code was an error, so the "recovered" message, which is a
TDB_DEBUG_TRACE message, marked the run as being an error when it
isn't.
2009-10-20 10:59:40 +11:00
Michael Adam
e440a2e11e tdb:tdbtool: fix indentation.
Michael
2009-09-21 17:47:51 +02:00
Michael Adam
91e1bab2e9 tdb:tdbtool: add transaction_start/_commit/_cancel commands.
So one can perform tdbtool operations protected by transactions.

Michael
2009-09-21 17:47:51 +02:00
Michael Adam
817383d88d tdb:tdbtool: add the "speed" command to the help text.
Michael
2009-09-21 17:47:51 +02:00
Slava Semushin
497b9e460b lib/tdb/tools/tdbtorture.c: fixed memory leak.
Found by cppcheck:
[lib/tdb/tools/tdbtorture.c:326]: (error) Memory leak: pids
2009-06-06 22:33:39 +02:00