Age | Commit message (Collapse) | Author | Files | Lines |
|
The main change is to s/tdb/tdb1_/ everywhere.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit fab544c24c1ad6523f95893abcaec4e6cce6c2b4)
|
|
Since we've renamed everything in tdb1, they won't clash.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 5d6194b434f3664d1025df12ef06c6a25f693bc8)
|
|
We import the entire codebase, putting a "tdb1_" prefix on the files
and changing the "tdb_" prefix to "tdb1_" everywhere.
The next patches will gradually merge it with the TDB2 code where
necessary.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 19e6c1a250ade1e7204ada17163294855585e825)
|
|
This lets us add the new files to a single place.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 476567430be6962625bf399192e20938985232c7)
|
|
Create an iterator over every open tdb (not internal TDBs). This is
useful for re-establishing the tdb1-style active lock for
CLEAR_IF_FIRST.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 1a0c636bc38213bd0322db47529f78f2dc22ffdd)
|
|
Instead of a per-file linked list, use a per-tdb list. This is needed
for tdb_foreach().
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 2414f261918b4fb8a549dd385dba32118e37bf85)
|
|
This makes it easy to call it again after a fork(), such as for
re-establishing the CLEAR_IF_FIRST files locks.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 937d0babe99dcd315040a9e48430140e63e4a7df)
|
|
It doesn't make a difference unless the tdb2 opens a TDB1 on disk, in
which case tdb1_traverse() takes a write lock on the entire file. By
setting the tdb to read-only first, we simulate the old behaviour.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
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)
|
|
This is more accurate than returning TDB_ERR_EINVAL.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 91436a25574597dbd1fd2de5bcd5826a234100d6)
|
|
It's more consistent with what tdb1 does, and slightly more encapsulated.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 6b7c3c840eafbec211b9f58751c5ff754302a68e)
|
|
Add the ecode arg to all the log functions, and log it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
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>
|
|
Make it the same offset as TDB1. This isn't strictly necessary, but
it would allow for total unification later, since TDB1 and TDB2's
transaction code is otherwise completely compatible.
(Imported from CCAN commit de432e8f857ce23bccde7c6ffa3e7e21456df18b)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
If the caller actually specifies TDB_CONVERT, fail if the TDB does not
need conversion. It's unusual for the user to specify TDB_CONVERT
(it's auto-detected) but better to be strict.
(Imported from CCAN commit 3e3ee8b0c1e77340ab9e8678c2d23646d8cdb627)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
The tdb_oob() function can fail due to errors, as well as because the length
asked for is greater than the size of the file. Clean that up:
(1) If probe is true, only fail if there's an error, not if the length is
too great.
(2) Exit tdb_open() if it tdb_oob() probe fails; this helps cut down
test time for failtest.
(3) Don't set probe to true in tdb_direct() fail; a minor issue, but it means
we log failure.
(Imported from CCAN commit 77658070a3e4f712b94d659b2e399031ce3394c8)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
It can be 64 bits, for huge databases.
(Imported from CCAN commit 736c033322079baf754261d82b6a83de53b2bb4e)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
As noted, failtest was taking a long time, because a failure injected here
was not detected.
(Imported from CCAN commit 51f592dfcda4d58d6b9d8134b6e1aff791dc40f2)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
We use off_t in the tdb2 interface (for tdb_attribute_flock); we need
to make sure that all callers agree on the size.
This also causes a problem in the tests: it's not enough to include
config.h first, we need the _FILE_OFFSET_BITS define from private.h.
Otherwise, we can disagree about the definitions of F_SETLK, F_SETLKW
and off_t, causing strange problems.
(Imported from CCAN commit baa17ee2d5e01a32030f19e566007417d72b4b6e)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
We weren't testing for this, and without it, typesafe_cb just casts
its function argument. This is why I didn't get a warning when one of
my patches amended a function incorrectly.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Reviewed-by: Jelmer
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Tue Sep 13 18:11:18 CEST 2011 on sn-devel-104
|
|
And fix the comment
Reviewed-by: Jelmer
|
|
Reviewed-by: Jelmer
|
|
There is little point testing this against the system iconv.
Andrew Bartlett
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Sep 10 15:45:42 CEST 2011 on sn-devel-104
|
|
|
|
|
|
We need to know that we can load the samba-provided modules, and that
they are correct. However, we must mark a number of tests as
knownfail due to errors in our internal iconv modules.
Andrew Bartlett
|
|
For autoconf builds these remain as modules, for waf builds they are
built into the charset library.
This is required to provide the CP850 charset when iconv is not available.
The charset modules static for the waf builds because with proper
shared libs, there isn't the same need for these to be in seperate .so
files. The modules are also not produced if a system iconv is found,
except for developers, to allow testing of both code paths.
Andrew Bartlett
|
|
Just in-case, and done this way due to the #define maze that applies
to this function. No actual host has been found that needs this yet.
Andrew Bartlett
|
|
struct iovec
This is needed on some platforms, e.g. NetBSD5.
metze
|
|
its nice to be able to allocate on other than NULL
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
|
|
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Sep 7 16:47:26 CEST 2011 on sn-devel-104
|
|
|
|
this allows --show-binary to display trustAuthOutgoing and
trustAuthIncoming NDR blobs. Useful for debugging trust issues
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
|
|
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Sep 1 18:25:34 CEST 2011 on sn-devel-104
|
|
the spy code in ldb_tdb was added a while ago to overcome a memory
hierarchy problem with async ldb errors. Recently we started to get
valgrind errors related to the order of free in the spy code. This
patch ensures that we don't try to use a freed spy pointer. This
prevents the valgrind errors, although I suspect that the memory
hierarchy we have here is more complex than it needs to be
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Sep 1 08:54:23 CEST 2011 on sn-devel-104
|
|
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
|
|
This also changes the other constants to remove the LDB_ prefix, which
is redundent
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
|
|
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
|
|
When we do --enable-tdb2, we start clashing with the replace.h
version:
In file included from ../lib/tdb2/tools/../private.h:25:0,
from ../lib/tdb2/tools/tdb2torture.c:60:
../lib/ccan/likely/likely.h:32:0: warning: "likely" redefined
../lib/replace/replace.h:762:0: note: this is the location of the previous definition
../lib/ccan/likely/likely.h:53:0: warning: "unlikely" redefined
../lib/replace/replace.h:765:0: note: this is the location of the previous definition
I don't like to #ifndef-protect them in general, since you don't want
different parts of the code to silently have different definitions,
but it's the simplest fix for now.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Aug 27 17:40:39 CEST 2011 on sn-devel-104
|
|
|
|
|
|
Poll and select behave differently regarding error handling. When doing the
connect(2), we can not rely on poll telling us both readability and writability
upon error. Just always try a second connect(2). At least on Linux it returns 0
when it succeeded.
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Aug 25 19:39:12 CEST 2011 on sn-devel-104
|
|
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
|
|
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Aug 21 04:53:07 CEST 2011 on sn-devel-104
|
|
|
|
|
|
explicitly specified that they don't need one.
|
|
|