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

22 Commits

Author SHA1 Message Date
Stefan Metzmacher
002a1c57a9 s3:utils: add debug functions instead of magic format strings in net_idmap_check.c
This way the compiler can check the format string and doesn't generate warnings.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:45 +01:00
Michael Adam
cf0cb0add9 dbwrap: add a dbwrap_flags argument to db_open()
This is in preparation to support handing flags to backends,
in particular activating read only record support for ctdb
databases. For a start, this does nothing but adding the
parameter, and all databases use DBWRAP_FLAG_NONE.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-02-07 16:06:06 +01:00
Gregor Beck
d8dd0ecc48 lib/util_tdb: factor out tdb_data_talloc_copy()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 12:10:24 +01:00
Volker Lendecke
7f19a5ab52 dbwrap: dbwrap_fetch_uint32->dbwrap_fetch_uint32_bystring
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15 12:14:28 +02:00
Volker Lendecke
45e61fcf61 s3: Add a "lock_order" argument to db_open
This will be used to enforce a lock hierarchy between the databases. We have
seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb.
These should be fixed by refusing a dbwrap_fetch_locked that does not follow a
defined lock hierarchy.
2012-01-18 14:48:04 +01:00
Gregor Beck
d74b3f941f lib/util: factor out tdb_data_is_empty
Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Sat Dec  3 05:20:30 CET 2011 on sn-devel-104
2011-12-03 05:20:30 +01:00
Gregor Beck
5bc44491d2 s3:net: adapt idmap check to new dbwrap_fetch behavior not to return success if not found
Signed-off-by: Michael Adam <obnox@samba.org>
2011-12-03 03:48:31 +01:00
Gregor Beck
e430c75d4c s3:net: factor out interact_edit()
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-12 22:45:53 +02:00
Michael Adam
658f72128f s3:dbwrap: change dbwrap_fetch_uint32() to NTSTATUS return type (instead of bool)
for consistency and better error propagation
2011-10-11 14:17:58 +02:00
Michael Adam
7458aac0f1 s3:net: convert net idmap check to use dbwrap wrapper functions.
Avoid direct use of the db_record and db_context structs.
2011-10-11 14:17:57 +02:00
Michael Adam
0e28448a78 s3:dbwrap: convert dbwrap_fetch(), dbwrap_fetch_bystring() and dbwrap_fetch_bystring_upper() to NTSTATUS 2011-10-11 14:17:56 +02:00
Michael Adam
8f098a635f s3:dbwrap: change the dbwrap_traverse() wrapper to return the count in an additional parameter 2011-10-11 14:17:55 +02:00
Michael Adam
7a72c84ee7 s3:dbwrap: move the db_open_rbt() prototype to a new header dbwrap_rbt.h 2011-10-11 14:17:55 +02:00
Stefan Metzmacher
2a6c5c8edb s3:utils: avoid '//' comments
The compiler on openindiana doesn't like them.

metze
2011-10-08 07:24:14 +02:00
Michael Adam
0b5c4a601a s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29 13:34:22 +02:00
Michael Adam
1abdd9b2bb s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.
Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and
make the fallbacke implementation functoins non-static and create a
dbwrap_private.h header file that contains their prototypes.
2011-07-29 12:23:13 +02:00
Rusty Russell
d925b327f4 tdb_compat: Higher level API fixes.
My previous patches fixed up all direct TDB callers, but there are a
few utility functions and the db_context functions which are still
using the old -1 / 0 return codes.

It's clearer to fix up all the callers of these too, so everywhere is
consistent: non-zero means an error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Michael Adam
58a0c8a9e0 s3:net idmap check: fix output of an invalid record
Only print the value number for hwm, version and seqnum keys.

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Apr  8 17:29:31 CEST 2011 on sn-devel-104
2011-04-08 17:29:31 +02:00
Gregor Beck
6db4fc15df s3-net: "idmap check" ignore __db_sequence_number__
Signed-off-by: Michael Adam <obnox@samba.org>
2011-04-08 16:44:57 +02:00
Michael Adam
838e2dd1f1 s3:net idmap check: fix a couple of c++ implicit void * cast warnings 2011-04-07 17:08:16 +02:00
Gregor Beck
a217ec64ec s3-net: add command "net idmap check"
This is a tool to check the consistency of an idmap tdb database.

The default mode is to scan the database and list invalid entries,
e.g. records with an invalid format, or records which are valid
but for which the reverse mapping entry is missing.

With the "--repair" switch, one can enter an interactive
repair mode which will prompt for each invalid entry found
with the option to delete, skip or edit the record.

There is also a non-interactive repair mode triggered by "--auto"
which will remove all records with invalid content and fill up
mappings which are missing the reverse entry.

The "--test" parameter lets "net idmap check" only list the
changes that would be written and not actually commit them to
the database.

The "--lock" option allows to lock the database already in the
first reading traverse, in order to remove the race when the
database has to be closed and reopened again before writing
the changes.

Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon Apr  4 18:21:09 CEST 2011 on sn-devel-104
2011-04-04 18:21:09 +02:00