Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Lars Müller <lars@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Aug 31 21:05:21 CEST 2012 on sn-devel-104
|
|
We're about to use them for dbwrap.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Otherwise the following surgery will break the SAMBA build and testsuite.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
This will help with making dbwrap available as a top level library.
Andrew Bartlett
|
|
Keeps the tdb2 API change (which returns error codes, rather than -1)
localized. The function returns -1 down the other path, so make it
consistent.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Add the ecode arg to all the log functions, and log it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
|
|
termination is missing
Signed-off-by: Michael Adam <obnox@samba.org>
|
|
termination is missing
Signed-off-by: Michael Adam <obnox@samba.org>
|
|
TDB2 doesn't have (the racy) signal pointer; the new method is to
override the locking callbacks and do the timeout internally.
The technique here is to invalidate the struct flock when the timeout
occurs, so it works even if it happens before we enter the fcntl() call.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
My previous patches fixed up all direct TDB callers, but there are a
few utility functions and the db_context functions which are still
using the old -1 / 0 return codes.
It's clearer to fix up all the callers of these too, so everywhere is
consistent: non-zero means an error.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
This is a helper for the common case of opening a tdb with a logging
function, but it doesn't do all the work, since TDB1 and TDB2's log
functions are different types.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
These don't exist in tdb2. The former is used in one weird place in
tdb1, and the latter not at all.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
TDB2 returns a negative error number on failure. This is compatible
if we always check for != 0 instead of == -1.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
TDB2 returns void here. tdb_transaction_cancel will *always* return
with the transaction cancelled, but it will complain via the log
function if a transaction wasn't in progress.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.
Andrew Bartlett
|
|
Guenther
|
|
This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in
the top level build, these options are not available for these
databases. However, having two different tdb_wrap lists is a worse
fate, so this will do for now.
Andrew Bartlett
|
|
Guenther
|
|
First, this immediately gave me the warning that TDB_ERR_NESTING was not
covered and second, this saved 48 bytes in the .o :-)
|
|
This hides the use of talloc_reference from the caller, making it impossible to
wrongly call talloc_free() on the result.
|
|
|
|
|
|
|
|
So this gets now linked only into its single user: winbindd
(needed by winbindd_cache.c)
Michael
|
|
|
|
Guenther
|
|
<realrichardsharpe@gmail.com>.
"It seems to me that if the lock is already held by another process when we
enter this code, there is a race between the timeout and the granting. If
the lock is subsequently granted, the process releasing the lock will signal
the wait variable (or whatever) and our process will be scheduled. However,
if the timeout occurs before we are scheduled, the timeout will be delivered
first.
We will have the lock but will forget we have the lock, and never release
it."
Jeremy.
|
|
|
|
In tdb_wrap_log(), in on occurrence of "debug_level = 0"
instead of "debuglevel = 0" caused me segfaults when
accessing DEBUGLEVEL (which is defined as "*debug_level"...)
Michael
(This used to be commit d9bd894c2ec4faf87e8ff96e27c7e2b8175f9387)
|
|
It has been replaced by tdb_wipe_all().
Michael
(This used to be commit cdde2e4eaca51d51f036ad99d55df7bfd6535b03)
|
|
Users of these are currently being written...
Michael
(This used to be commit 1c51bec5318bad085c09931aa7e8f72f41d103fe)
|
|
Michael
(This used to be commit abf02a5a142c55d9e0053d319c867e4fcc3e6c30)
|
|
Replace all callers of traverse with this tdb_traverse_delete_fn() and
don't export tdb_traverse_delete_fn() anymore.
Michael
(This used to be commit d4be4e30cd8c3bdc303da30e42280f892a45a8c9)
|
|
Michael
(This used to be commit b42cf3fc69414270be9d0f430f2e95a72894f00e)
|
|
warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result
(This used to be commit ad37b7b0aee265a3e4d8b7552610f4b9a105434d)
|
|
Just a small commit to get a handle on this git thingy. This patch
fixes some missing calls to va_end() to match various calls to va_start()
and VA_COPY().
Tim.
(This used to be commit ec367f307dff7948722b9ac97beb960efd91991f)
|
|
than expect a pstring space to put data into.
Fix the (few) callers.
Jeremy.
(This used to be commit 7722a7d2c63f84b8105aa775b39f0ceedd4ed513)
|
|
an alarm sig would not terminate and could lead
to runaway smbd processes.
Thanks to Dave Daugherty @ Centrify for pointing
this out to us.
Jeremy.
(This used to be commit ef8da1698371c95495add53df81a978df709c88d)
|
|
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
|
|
Return error instead.
Michael
(This used to be commit 9b25355dd66519afd548fecbf2da7608b024a35b)
|
|
A new wrapper tdb_validate_open() takes a filename an opens and closes
the tdb before and after calling tdb_validate() respectively.
winbindd_validata_cache_nobackup() now dynamically calls one of
the above functions depending on whether the cache tdb has already
been opened or not.
Michael
(This used to be commit dc0b08e6590caa4974fd4d9f34f39f261d1f1dee)
|
|
(This is more safely used with casts from int to uint8, e.g.)
Michael
(This used to be commit cb3583b39212688a627a29bbddb2e98497714d42)
|
|
I had only tested with "net getlocalsid". posix_locking_init() calls this
with a NULL name...
(This used to be commit 3eee1fe28057e2e3da2e9d1506f57f3e35fd37b7)
|
|
This makes it possible to set the default hashsize for any tdb. I would
like to remove the "open files database hash size" in favor of this one.
I'll check that removal in with the next commit, please complain/revert
if it's not ok.
Volker
(This used to be commit e9bd7a63a8d462b1fc3bab99ff843e25bffd156b)
|
|
If restoring a backup fails due to lack of space, remove the
corrupt tdb previously moved away to "name.corrupt", and retry.
If restoring still fails, move the backup in place instead of
copying it.
Michael
(This used to be commit f81f2bf480a955213be8461636ee6f81643f17b8)
|
|
(This used to be commit 909172839a512b60db075fb1a7488345a2e48eb0)
|
|
Michael
(This used to be commit efabd7fe03733d1fcb02d0d270c18ede7836f3a9)
|
|
- call tdb_validate on the given tdb.
- if validation is successful, create a backup
return 0 (success) even if the backup fails.
- if validation fails:
- move tdb to name.corrupt (don't exit if this fails)
- look for a valid backup
- if a valid backup is found, restore it, else return -1 (failure)
if restoring succeeds, return 0 (success), else -1 (failure)
Summing up:
If 0 is returned, there is a valid tdb at the given location:
either the original one ore one restrored from a backup.
If -1 is returned, there is no valid tdb at the given location:
Either there is no file at all, or the original file is still
in place (if moving it away failed).
Michael
(This used to be commit 1c36ccd86d85b02f27ec66d37bdf7f04ad760901)
|
|
(This used to be commit 6bd2c48921dd8dbf2885a8135ba01a1324e020c8)
|