1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

8 Commits

Author SHA1 Message Date
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
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
d26908846a tdb2: check lock owner in tdb1 backend.
This reports errors if we fork() while holding a lock, or misuse a tdb
which we have dual-opened.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit bef6f1b02e95370ecb2cb44be87c82afc9cb74b2)
2011-09-14 08:12:13 +09:30
Rusty Russell
9140fca812 tdb2: unify tdb1_chainlock et al. into tdb_chainlock
Switch on the TDB_VERSION1 flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit ceb2f3eacbad917ee990afbc3dd800bfb0607887)
2011-09-14 07:56:13 +09:30
Rusty Russell
cbad6e2c14 tdb2: unify tdb1_open into tdb_open
Finally, we gut tdb1_open() to the tdb1-specific parts, and call it
from tdb_open if they specify the TDB_VERSION1 flag or the version is
a TDB1.

We also unify tdb_close(), based on the TDB_VERSION1 flag.

Note that tdb_open(TDB_VERSION1) will fail on an existing tdb if it's
a TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit c8c3b3568677e8b0105f84e4ab068c580faf4591)
2011-09-14 07:49:13 +09:30
Rusty Russell
bdd46e4513 tdb2: make tdb1 use same low-level lock functions.
This means they will use the TDB_ATTRIBUTE_FLOCK functions, and get automatic
reopen support.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit fbad02b680b6cbc33ae305ae1cbcdead4eedc7b1)
2011-09-14 07:38: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
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