1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-10 13:57:47 +03:00

19 Commits

Author SHA1 Message Date
Rusty Russell
a93e03d27d lib/tdb2: fix OpenBSD incoherent mmap (tdb2 version)
This handles incoherent mmaps for TDB2 native databases, by forcing
mmap on for such systems, just like we did for tdb1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-03-22 01:57:38 +01:00
Amitay Isaacs
4e9072660a lib/tdb2: Mark public function as such
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-02-21 15:29:22 +10:30
Rusty Russell
4bc8b0c194 tdb2: use HAVE_LIBREPLACE instead of _SAMBA_BUILD_.
This is what lib/tdb2 really wants: to know if it should use normal
headers or replace.h.  It currently uses _SAMBA_BUILD_, which is wrong
for ldb, for example.

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

Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Tue Nov  1 03:19:58 CET 2011 on sn-devel-104
2011-11-01 03:19:58 +01:00
Rusty Russell
92c022f043 tdb2: allow readonly changes even while holding locks.
This happens in SAMBA with the TDB_VERSION1, presumably due to a
read-only traverse nested inside a normal traverse (since it doesn't
occur without TDB_VERSION1).

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

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 24e5ddb143fb5e79112649472258f5da67cc7362)

Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Tue Sep 20 09:35:10 CEST 2011 on sn-devel-104
2011-09-20 09:35:10 +02:00
Rusty Russell
2237daed7e tdb2: add error conversion functions.
This clarifies the code a little, but also provides a more explicit
mechanism which can be used to debug error handling (by introducing
tdb_err_t and making it a pointer type).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit afa6d57b7d93fe4675a952f556eb462951baa257)
2011-09-14 08:13:27 +09:30
Rusty Russell
a15c1cf175 tdb2: tdb_repack
Move the tdb1_repack() code into the core, make it general, rename to
tdb_repack().

It's generic code: copy database into temporary, wipe it, copy back.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit e487983a4099b6f760056ff7182f2ff543e6da71)
2011-09-14 08:03:13 +09:30
Rusty Russell
662f46de21 tdb2: unify tdb1_get_seqnum/tdb1_increment_seqnum into tdb_get_seqnum/tdb_inc_seqnum
Switch on the TDB_VERSION1 flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 57359c26e9626aa986ee0538efd13a44a466f39d)
2011-09-14 08:01:13 +09:30
Rusty Russell
014ca657e6 tdb2: unify tdb1_parse_record into tdb_parse_record
Switch on the TDB_VERSION1 flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 3352e4e947777d4a90a2dd4f3037e1e494231b25)
2011-09-14 07:57:13 +09:30
Rusty Russell
e6cbc0f00e tdb2: unify tdb1_store into tdb_store
Switch on the TDB_VERSION1 flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 2bba2a856a6cfdb93085b701557850bc1da99587)
2011-09-14 07:54:13 +09:30
Rusty Russell
10606b7e3b tdb2: unify tdb1_delete into tdb_delete.
Switch on the TDB_VERSION1 flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit acb26c9c3ee054c8b2141db25c9bd7be064e425c)
2011-09-14 07:53:13 +09:30
Rusty Russell
61095999cc tdb2: unify tdb1_append into tdb_append
Switch on the TDB_VERSION1 flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 8bc38cb177928ef739440c32e33a8eaf23a5dd22)
2011-09-14 07:52:13 +09:30
Rusty Russell
02f5b8fef8 tdb2: unify tdb1_fetch into tdb_fetch
Switch on the TDB_VERSION1 flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 08c05da588018c6b76834e57b66d525546643708)
2011-09-14 07:51:13 +09:30
Rusty Russell
f68a56ce8f tdb2: unify tdb1_store into tdb_store
Switch on the TDB_VERSION1 flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 98c754ffe65bc335f66161d6cc8705d4ea2710ec)
2011-09-14 07:50:13 +09:30
Rusty Russell
c16184f83b tdb2: merge tdb1_context into tdb_context.
Finally, we split out the tdb2-specific parts of tdb_context, and put
them into a "tdb2" sub-struct; the tdb1 parts go into a "tdb1"
sub-struct.  We get rido of tdb1_context and use tdb_context
everywhere.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit bbeb528e74c0e234e1f724ac8d54be404cfc6f9a)
2011-09-14 07:43:13 +09:30
Rusty Russell
bdc5499205 tdb2: add TDB_RDONLY flag, allow setting/unsetting it.
You can only unset it if the TDB was originally opened O_RDWR.

Also, cleaned up error handling in tdb_allrecord_lock() so we only get
one log message on a r/o database.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit b87e14495d5b07e1b247218a72329f10ecb3da7f)
2011-09-14 07:16:13 +09:30
Rusty Russell
ab61a57e01 tdb2: Hand error code to logging function.
Since we've deprecated tdb_error() function (and it didn't work right
from inside the logging function anyway, since we didn't set
tdb->ecode yet) we need to hand it to the log function.

(Imported from CCAN commit 6e3d9e8a66bf8b45150500f176452ee8e9ee9927)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14 07:12:13 +09:30
Rusty Russell
80f4a936f2 tdb2: add full LGPL headers
This is for SAMBA, so we follow their rules and do full license
headers.  Two files were missing them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 58025731)

Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Wed Aug 31 09:52:43 CEST 2011 on sn-devel-104
2011-08-31 09:52:43 +02:00
Rusty Russell
6b3f9ac0f8 tdb2: minor changes to SAMBIFY it.
This is a bit messy, but it works.  Kept as a separate patch so it's
easier to merge back and forth with CCAN's tdb2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
d24ddb0350 tdb2: add lib/tdb2 (from CCAN init-1161-g661d41f)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00