1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-29 16:23:52 +03:00
Commit Graph

104 Commits

Author SHA1 Message Date
Andrew Tridgell
ab953c8c72 r10471: stratos doesn't have getpagesize(), so guess 8k on systems that don't
have it. Overestimating is harmless.
2007-10-10 13:38:51 -05:00
Andrew Tridgell
c85836bafc r10470: solaris8 has a problem with tdbtorture with 3 processes. To see if
this is just a solaris issue this patch changes the default to 3, and
I'll see how many build farm boxes break
2007-10-10 13:38:51 -05:00
Andrew Tridgell
fc692dc61f r10469: use the older style of structure initialisation for tdb to make it
more portable. tdb is used in more than just Samba4, and I think the
portability/readability balance is a bit different
2007-10-10 13:38:50 -05:00
Andrew Tridgell
c2b1739c63 r10468: - terminate tdbtorture quickly when an error is detected
- more workarounds for aix not handling malloc of size 0
2007-10-10 13:38:50 -05:00
Andrew Tridgell
0177c6ca3e r10467: aix doesn't like zero length malloc :( 2007-10-10 13:38:50 -05:00
Andrew Tridgell
e615f36733 r10466: work around missing pread/pwrite declaration on openbsd 2007-10-10 13:38:49 -05:00
Andrew Tridgell
294ccfd46a r10465: separate out a read_only db from a read-only traversal to ensure we
don't end up doing a mmap read only
2007-10-10 13:38:49 -05:00
Andrew Tridgell
d9ee0e8b59 r10463: consider it an error if tdbtorture produces any log messages 2007-10-10 13:38:49 -05:00
Andrew Tridgell
312491b251 r10462: cope better with compilers that don't put the object file in the same directory
as the source
2007-10-10 13:38:49 -05:00
Andrew Tridgell
83168c7e76 r10461: fixed tdb build on systems without stdint.h 2007-10-10 13:38:48 -05:00
Andrew Tridgell
bce35ad237 r10460: fixed portability of transaction code to systems with integer
alignment constraints (like sparc)
2007-10-10 13:38:48 -05:00
Andrew Tridgell
03942dd54b r10459: fixed some portability problems 2007-10-10 13:38:48 -05:00
Andrew Tridgell
9b53e04377 r10424: for caller convenience, automatically turn a tdb_traverse() into a
tdb_traverse_read() for read only databases
2007-10-10 13:38:44 -05:00
Andrew Tridgell
7dd31288a7 r10421: following on discussions with simo, I have worked out a way of
allowing searches to proceed while another process is in a
transaction, then only upgrading the transaction lock to a write lock
on commit.

The solution is:

 - split tdb_traverse() into two calls, called tdb_traverse() and
   tdb_traverse_read(). The _read() version only gets read locks, and
   will fail any write operations made in the callback from the
   traverse.

 - the normal tdb_traverse() call allows for read or write operations
   in the callback, but gets the transaction lock, preventing
   transastions from starting inside the traverse

In addition we enforce the following rule that you may not start a
transaction within a traverse callback, although you can start a
traverse within a transaction

With these rules in place I believe all the deadlock possibilities are
removed, and we can now allow for searches to happen in parallel with
transactions
2007-10-10 13:38:44 -05:00
Jelmer Vernooij
749b19d34f r10420: Two minor scons fixes 2007-10-10 13:38:43 -05:00
Tim Potter
5f530eacba r10415: The ldb and tdb libraries are bad examples to test out the make proto
code as they are marked as NOPROTO in the config.mk files.
2007-10-10 13:38:43 -05:00
Andrew Tridgell
fa353a5bc5 r10410: blindly update the scons file for tdb. I'm not sure how this works,
but it definately needs transaction.c now
2007-10-10 13:38:42 -05:00
Andrew Tridgell
06bd8abba9 r10405: added transactions into tdb, and hook them into ldb. See my
samba-technical posting for more details on the transactions design.

This also adds a number of command line arguments to tdbtorture,
making it more flexible, and fixes some lock deadlock conditions in
the tdbtorture code.
2007-10-10 13:38:41 -05:00
Andrew Tridgell
40a8ad2d1e r10385: removed obsolete comment 2007-10-10 13:38:36 -05:00
Andrew Tridgell
21e5c328a0 r10384: add _GNU_SOURCE in tdb configure 2007-10-10 13:38:35 -05:00
Tim Potter
54882f88ca r10379: Add files for ldb and tdb to proto_files. The tool for building proto.h
is busted though.
2007-10-10 13:38:34 -05:00
Jelmer Vernooij
59d4450453 r10336: Add sconscript for a couple more subsystems. 2007-10-10 13:38:29 -05:00
Tim Potter
f35c4763d5 r10335: Build tdb tools into bin directory. 2007-10-10 13:38:29 -05:00
Jelmer Vernooij
4bffe44359 r10330: Add SConscript to more subsystems. Some of the tdb tools build now.
Start on custom Samba scons tools (for handling proto generation, pidl, etc)
2007-10-10 13:38:28 -05:00
Tim Potter
360be7028c r10258: Fix an unused/duplicate local variable. 2007-10-10 13:38:12 -05:00
Andrew Tridgell
4673cdd0d2 r10253: a fairly large tdb cleanup and re-organise. Nearly all of this change
just involves splitting up the core tdb.c code into separate files on
logical boundaries, but there are some minor functional changes as well:

 - move the 'struct tdb_context' into tdb_private.h, hiding it from
   users. This was done to allow the structure to change without
   breaking code that uses tdb.

 - added accessor functions tdb_fd(), tdb_name(), and tdb_log_fn() to
   access the elements of struct tdb_context that were used by
   external code but are no longer visible

 - simplied tdb_append() to use tdb_fetch()/tdb_store(), which is just
   as good due to the way tdb locks work

 - changed some of the types (such as tdb_off to tdb_off_t) to make
   syntax highlighting work better

 - removed the old optional spinlock code. It was a bad idea.

 - fixed a bug in tdb_reopen_all() that caused tdbtorture to sometimes
   fail or report nasty looking errors. This is the only real bug
   fixed in this commit. Jeremy/Jerry, you might like to pickup this
   change for Samba3, as that could definately affect smbd in
   Samba3.

The aim of all of these changes is to make the tdb
transactions/journaling code I am working on easier to write. I
started to write it on top of the existing tdb.c code and it got very
messy. Splitting up the code makes it much easier to follow.

There are more cleanups we could do in tdb, such as using uint32_t
instead of u32 (suggested by metze). I'll leave those for another day.
2007-10-10 13:38:12 -05:00
Andrew Tridgell
3c32f24e2c r9774: r11605@blu: tridge | 2005-08-30 12:02:19 +1000
make sure we don't walk off the end of the hash array
2007-10-10 13:34:59 -05:00
Andrew Tridgell
2e14fb893d r9773: r11599@blu: tridge | 2005-08-30 11:55:57 +1000
optimise this case a bit more. The total speedup using non-indexed
 ldbtest is now around a factor of 80x. The code is ugly as hell, but
 I think this speed is worth it.

 Of course, if we only ever do indexed searches in ldb then this
 doesn't help, but it seems all too common that we get unindexable
 searches, so the optimisation is worthwhile
2007-10-10 13:34:59 -05:00
Andrew Tridgell
7f9efaceb6 r9769: r11592@blu: tridge | 2005-08-30 10:40:19 +1000
added a tdb optimisation that speeds up non-indexed ldb by a large
 margin (often 10x or more). I'd be interested in any comments on the
 safety of this optimisation. See the comment in the code for an
 explanation.
2007-10-10 13:34:58 -05:00
Jelmer Vernooij
7548a5012a r9455: Support for reading the policy database 2007-10-10 13:34:17 -05:00
Jelmer Vernooij
9ea601c0a6 r9448: Work on reading the secrets tdb. Build tdbsam support by default. 2007-10-10 13:34:16 -05:00
Jelmer Vernooij
ce0935112b r8966: Simplify the makefile generation system a bit.
Autogenerate list of binaries (rather then having them hardcoded in build/smb_build/makefile.pm)
Add INSTALLDIR keyword to .mk files
2007-10-10 13:31:00 -05:00
Andrew Tridgell
8f222c8c7a r8624: removed valgrind comment on tdb that no longer applies 2007-10-10 13:29:45 -05:00
Andrew Tridgell
7a88a9f06c r8448: - added a test target for tdb
- reduced the torture size so it doesn't kill the build farm hosts
2007-10-10 13:23:04 -05:00
Andrew Tridgell
4a61a5c70e r8447: fixed make install in the farm 2007-10-10 13:23:04 -05:00
Andrew Tridgell
28dd79587d r8442: remove tdbtest from our build. If you want it, then do
'make bin/tdbtest' manually in the tdb tree
2007-10-10 13:23:03 -05:00
Andrew Tridgell
5c4c3e9a8d r8441: don't build tdbtest by default as there are too many systems that
don't have libgdbm, and the configure test for gdbm is broken
2007-10-10 13:23:03 -05:00
Jeremy Allison
f9f3037d68 r7641: Fix based on work from "Shlomi Yaakobovich" <Shlomi@exanet.com> to catch
loops in corrupted tdb files.
Jeremy.
2007-10-10 13:18:16 -05:00
Derrell Lipman
a80bced0b9 r7276: - moved static tdb function ltdb_dn_fold() into common/ so that it can be
called from multiple backends.  (ldb_sqlite3 needs it too.)  Added parameter
  for a callback function that determines whether an attribute needs case
  folding.
- begin to prepare for sqlite3 in build process
- work-in-progress updates, on ldb_sqlite3
2007-10-10 13:17:35 -05:00
Jelmer Vernooij
95fed657f4 r6546: Fix ldb standalone build
Add autoconf to tdb
2007-10-10 13:16:25 -05:00
Andrew Tridgell
162bbe4402 r6528: - in tdb_fetch() we effectively disallowed zero length records by
returning NULL/0, which is the same as we used for a failure. Having
  to look at tdb->ecode (which we never do) is too error prone.

  Instead, tdb_fetch() should behave like malloc() and talloc(), where
  zero length is not special and malloc(0) returns a valid pointer.

- similarly in data_blob(), asking for data_blob(NULL, 0) should
  return a zero blob, but asking for data_blob(ptr, 0) should return a
  zero length blob with a valid pointer, just like talloc() and malloc()

This change fixes the SummaryInformation stream stored in the tdb
backend when manipulated from w2k. The w2k client was using
SET_EOF_INFORMATION to create a zero-length stream, which we return
STATUS_NOT_FOUND on, as the tdb_fetch() gave us back a NULL/0 blob,
which we returned as not-found
2007-10-10 13:16:23 -05:00
Jelmer Vernooij
78bf8026bd r6487: Use autoconf for standalone build of tdb 2007-10-10 13:16:19 -05:00
Jeremy Allison
d69f7c0546 r6238: Ensure if realloc fails on an internal
tdb we fail gracefully.
Jeremy.
2007-10-10 13:11:28 -05:00
Tim Potter
1ee84e373e r5780: Remove unused arguments. 2007-10-10 13:11:03 -05:00
Tim Potter
dbb56e9a59 r5779: Remove signal and timeout gubbage from tdb. 2007-10-10 13:11:03 -05:00
Jeremy Allison
84f6d2b3dd r5533: Patch to detect infinite loops when traversing a tdb from "Shlomi Yaakobovich" <Shlomi@exanet.com>
Jeremy.
2007-10-10 13:10:53 -05:00
Andrew Bartlett
34b1da7303 r5330: Remove #include <sys/time.h> from includes.h.
Add #include "system/time.h" back (it was removed in some of these
places because the definitions were provided by <sys/time.h> on tridge's
platform.)

Andrew Bartlett
2007-10-10 13:09:43 -05:00
Andrew Tridgell
93931b1a74 r5300: more uint32 and system/filesys.h build fixes when developer mode is enabled 2007-10-10 13:09:39 -05:00
Andrew Tridgell
9db6c79e90 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
2007-10-10 13:09:38 -05:00
Andrew Tridgell
6f79432fe6 r5296: - only include the tdb headers where they are needed
- removed the u32 hack in events.c as I think this was only needed as
  tdb.h defines u32. Metze, can you check that this hack is indeed no
  longer needed on your suse system?
2007-10-10 13:09:38 -05:00