1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

206 Commits

Author SHA1 Message Date
Martin Pool
6c684c89a4 Doc. -
Martin Pool
caa08bb56e Allow for internal databases which may have no name. -
Martin Pool
8118676f78 Log more error messages. -
Martin Pool
b50e566ab9 Log more error messages. -
Martin Pool
a228c7efcc Allocate tdb name up front in case log functions want to use it. -
Martin Pool
b1d7d80068 tdb_open_ex: More cleanups: just dynamically allocate the TDB_CONTEXT
up front, rather than working on the stack and then copying across.
-
Martin Pool
52ef112e10 Refactor code to check whether already open into its own function. -
Martin Pool
fe901ec194 tdb_open_ex should always "goto fail" in case of error, rather than
just returning.  I don't think this would leak at the moment, but it's
an accident waiting to happen.
-
Martin Pool
bb6c0df4bc Doc. -
Martin Pool
fac685d30f tdb_open_ex: Continue previous refactoring so that we consistently
just say "tdb" not "&tdb".
-
Martin Pool
d159415049 tdb_open_ex: Refactor to use a pointer to tdb, rather than an auto
tdb, to be consistent with the rest of the code.
-
Tim Potter
d902baf709 Formatting fixup. -
Andrew Tridgell
c4f5a6c65d added a simple tdbdump utility -
Jean-François Micouleau
7e20fad5ed changed the DEBUG level of tdb_pack and tdb_unpack. Instead of 8, it's now
18.

when you're looking at a level 10, and it's all clutered with
tdb_pack/unpack, it's getting .... And anyway most of our code using
tdb_pack/unpack have DEBUG around the call if there is a problem.

	J.F.
-
Jeremy Allison
837f2b961b Tidup.
Jeremy.
-
Martin Pool
3dbb5dfcfb Put back changes to set errno, which seem to do no harm. -
Martin Pool
58cfea3c2a Fix headers. This I know is correct. -
Martin Pool
0c22a10d73 Fix headers. This I know is correct. -
Martin Pool
fc176f15f2 undo -
Martin Pool
391a65395e Implement suggestion from tridge to leave the old tdb_open interface
as it was, and add tdb_open_ex() which takes a log callback.  I guess
this makes more sense since it's a public interface.
-
Martin Pool
0aa800618e Better error handling:
- tdb_open api changed so that you now pass an error handling
   callback when opening the file, so that errors detected during
   opening have somewhere to go.  (All calls from the body of Samba to
   this function go through a wrapper in tdbutil, which has been
   updated.)

 - Clean up logic for deciding how to open tdb.  Emit log messages if
   something goes wrong (e.g. bad magic.)

 - tdbtool now logs errors to stderr.
-
Martin Pool
e9085129dd Magic file for TDB databases. -
Martin Pool
5630a988be Set errno in tdb_open in cases where we detect an error in opening the
database, but no underlying system call sets errno.

The particular case I had was a mangled .tdb, but there are others.
For this one, set EIO.  It's a shame Unix messages aren't more
detailed -- "bad data format" would be better.
-
Jeremy Allison
2a7bd621b4 Added prototypes for new fns. Thanks Elrond.
Jeremy.
-
Tim Potter
a1cf70ab65 Don't display any data if tdb_fetch() failed in the tdbtool "fetch"
command.
-
Tim Potter
303b3a3595 Updated definition of fstring.
print_asc(): Don't try to print a trailing NULL character
print_key(), print_rec(): Display key in ASCII
-
Tim Potter
1d2305c233 Added a 'keys' command to tdbtool which prints out all keys in the tdb. -
Tim Potter
dad688d8c6 Removed #ifdef TDB_DEBUG around tdb_dump_all() and tdb_printfreelist()
so that tdbtool can be compiled without having to make clean.
-
Jeremy Allison
21f776df59 Don't core dump when using spinlocks on a read-only tdb. Unfortunately this
means that a read-write opener and a read-only opener are using different
locking mechanisms - this needs to be addressed, but it's hard as the
read-write opener using the spinlocks is usually first, so there's no
way to force them to change down to the fcntl method.
Read only access is less important anyway and can never corrupt the
tdb anyway, so errors in read-only record reads are more tolerable.
Jeremy
-
Jeremy Allison
2b135fba62 Fix for tdb_oob() on TDB_INTERNAL databases.
Jeremy.
-
Anton Blanchard
6612abf827 PPC spinlocks work again. Sorry, my bad. -
Jeremy Allison
a71d9d98b0 Ensure accessing NT member servers works with a Samba PDC. Don't
change these timestamp settings without good reason.
Remove CLEAR_IF_FIRST flag is tdb is read-only.
Jeremy.
-
Andrew Tridgell
2f44756233 fixed compilation of tdbtorture -
Andrew Tridgell
b8d9d1fca3 tdbtorture updates from when I was trying to track down the hp tdb bug -
Jeremy Allison
a3267551d8 Put pwrite code back in expand_file.
Jeremy.
-
Andrew Tridgell
f49518e497 added a hook to reopen all tdb's after the server fork
this prevents the fd seek pointer problem
-
Jeremy Allison
0e75c0fc1a Fix based on Andrew's insight as re-using a tdb after fork means
parent and child share seek pointer. Damn....
Jeremy.
-
Jeremy Allison
b45793ec3f Return correct error code on lock fail in tdb_expand.
Jeremy.
-
Jeremy Allison
e4b41a8f31 Roll back earlier fix after talking with Andrew. The write_lock_record and
unlock are explicitly non-blocking. I will add a comment to this effect later.
Jeremy.
-
Jeremy Allison
313c2e8652 Fixed a couple of nasty bugs only easily seen with no mmap. Firstly,
map_ptr not neccessarily set to NULL if no mmap, secondly, iterating
through a tdb was using SETLK, instead of SETLKW - would almost never
fail with mmap as the time holding the lock was so short, but was
easily seen with read/write. One finaly bug needs tracking down w.r.t.
traversal......
Jeremy.
-
Andrew Tridgell
d32ac363a5 flush stdout in test logging fns -
Andrew Tridgell
931bded1c9 use a different test tdb name for tdbtest and tdbtorture -
Andrew Tridgell
b36c98036b actually obey the "use mmap" smb.conf option -
Tim Potter
888c852f01 Renamed rwlock_t type to tdb_rwlock_t to avoid conflict with Solaris 8
header files.
-
Anton Blanchard
a58b89d339 Add missing gcc memory barriers, this bug showed up when doing a
heavy netbench run. :)

Rework ppc spinlocks to be faster.
-
Tim Potter
78207d0fc8 Patch for having spaces in tdb keys, NULL termination fixes and other
stuff.  From Andrew Esh <AEsh@tricord.com>
-
Volker Lendecke
b4f06c3ecf Print an error message if database could not be opened.
Volker
-
Jeremy Allison
38d2e6983a Added mmap fix to pass lock test from HP.
Ok - now we're no longer trying to reach a silly 1k loc target,
change the formatting to be *readable* - eg.
change if (x) y else z to be :
if (x)
    y
else
    z

and other compact sillyness. Oh look - when I did this I found
some areas where we *WEREN'T CHECKING SYSTEM CALL ERROR RETURNS !!!!*
CompSci 101 guys....... :-).
Jeremy.
-
Jeremy Allison
aaa56bb3a3 Fix for rare tdb pattern store failure. Found & fixed by Rusty.
Jeremy.
-
Jeremy Allison
34951876a1 Always check fstat for error.
Jeremy.
-