Age | Commit message (Collapse) | Author | Files | Lines |
|
We're going to use TDB2's API, so some TDB1 APIs are obviously unnecessary.
We also get rid of USE_RIGHT_MERGES and TRACE code.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit b929638e3cfe629285af3ecd0813e03eaeaa1133)
|
|
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>
|
|
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Sep 13 23:34:13 CEST 2011 on sn-devel-104
|
|
cli_state_server_time()
metze
|
|
metze
|
|
metze
|
|
metze
|
|
metze
|
|
metze
|
|
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Sep 13 19:45:01 CEST 2011 on sn-devel-104
|
|
metze
|
|
metze
|
|
metze
|
|
metze
|
|
metze
|
|
metze
|
|
metze
|
|
It's allocated when sending the request.
metze
|
|
metze
|
|
protocol
metze
|
|
metze
|
|
metze
|
|
metze
|
|
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
|
|
The --realm argument is again optional (the previous code would take the default
from the default smb.conf, not the one specified) and --targetdir is now a
named argument much like it is to provision.
We now test the --testparm option to ensure it behaves the way we expect.
Andrew Bartlett
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Sep 13 16:30:31 CEST 2011 on sn-devel-104
|
|
This has accidentally been removed by commit 8268c2d4e231b05b439bc70331b75342b35daa4e.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
|
|
The max_data parameter of trans2/nttrans calls are not bound
to cli->max_xmit. Even with cli->max_xmit, which means the max
size of the whole SMB pdu, we would get fragmented trans2/nttrans
replies. That's why we can also use our maximum, which is CLI_BUFFER_SIZE.
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Sep 13 14:52:35 CEST 2011 on sn-devel-104
|
|
metze
|
|
metze
|
|
metze
|
|
metze
|