summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2011-09-14tdb2: make tdb1 headers include tdb2 headers.Rusty Russell2-29/+4
They're about to start sharing TDB2's definitions. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 1e3138a0ad0c184d2ca49ce7bc47173eb2fe67bd)
2011-09-14tdb2: rearrange tdb_context layout so tdb1_context can matchRusty Russell1-16/+16
By moving all the parts of struct tdb_context which logging and locking use to the beginning of the structure, we can make tdb1_context match, and thus pass that directly to the tdb_logerr() function, and later the locking functions. This is only necessary until we unify tdb1_context and tdb_context. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 0fd5be2955f8e6487c0f4ab711e2a6958bb8f412)
2011-09-14tdb2: add tdb1 code to build.Rusty Russell1-1/+5
The following patches integrate it together, but from here on we build it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: remove TDB1 TDB_NO_FSYNC environment variable hack.Rusty Russell1-4/+0
The caller should do this: the SAMBA compatibility later does. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 75a6a6ad64156ef3b13493be2970ae3cb99ccf8b)
2011-09-14tdb2: get rid of TDB1 mark and nonblock functions.Rusty Russell5-42/+19
We do this using hooks in tdb2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 444fade529f68eb2b0aebbc8de442478c5c6f916)
2011-09-14tdb2: remove _PUBLIC_ in tdb1 functions.Rusty Russell9-41/+36
They'll all be accessed via the tdb2 API. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 39f55294799c6443c0ad7bef09f1c113cf89d295)
2011-09-14tdb2: Remove unused tdb1 functions.Rusty Russell17-710/+17
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)
2011-09-14tdb2: test: import tdb1's tests.Rusty Russell33-0/+2102
The main change is to s/tdb/tdb1_/ everywhere. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit fab544c24c1ad6523f95893abcaec4e6cce6c2b4)
2011-09-14tdb2: include tdb1 source in tests.Rusty Russell1-0/+11
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)
2011-09-14tdb2: import TDB1 code.Rusty Russell15-0/+6787
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)
2011-09-14tdb2: make tests include a single mega-header to simplify future patchesRusty Russell50-408/+60
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)
2011-09-14tdb2: tdb_foreach()Rusty Russell3-0/+117
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)
2011-09-14tdb2: keep link of every non-internal tdb.Rusty Russell2-25/+22
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)
2011-09-14tdb2: save openhook, allow tdb_get_attribute() on it.Rusty Russell4-18/+21
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)
2011-09-14tdb_compat: make tdb2s temporarily read-only for tdb_traverse_read()Rusty Russell2-2/+27
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>
2011-09-14tdb2: add TDB_RDONLY flag, allow setting/unsetting it.Rusty Russell8-16/+170
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-14tdb2: return TDB_ERR_RDONLY if trying to start a transaction on a R/O tdb.Rusty Russell1-2/+11
This is more accurate than returning TDB_ERR_EINVAL. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 91436a25574597dbd1fd2de5bcd5826a234100d6)
2011-09-14tdb2: save open_flags instead of mmap_flags.Rusty Russell3-5/+11
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)
2011-09-14tdb_compat: adapt to tdb2 API change.Rusty Russell5-3/+12
Add the ecode arg to all the log functions, and log it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: Hand error code to logging function.Rusty Russell10-15/+34
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-14tdb2: move transaction lockRusty Russell1-2/+2
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>
2011-09-14tdb2: enforce TDB_CONVERTRusty Russell4-0/+72
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>
2011-09-14tdb2: cleanup oob handling.Rusty Russell3-25/+30
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>
2011-09-14tdb2: fix tdb_lock offset.Rusty Russell1-1/+1
It can be 64 bits, for huge databases. (Imported from CCAN commit 736c033322079baf754261d82b6a83de53b2bb4e) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb2: fix internal tdb_write_convert() error handling in tdb_open()Rusty Russell1-4/+5
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>
2011-09-14tdb2: Fix to always use 64-bit offset definitionRusty Russell7-11/+627
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>
2011-09-14ccan: configure check for HAVE_BUILTIN_CHOOSE_EXPRRusty Russell2-0/+18
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>
2011-09-13ldb:pyldb.c - "py_ldb_rename" remove superflous "ldb" pointerMatthias Dieter Wallnöfer1-4/+2
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
2011-09-11ldb:ldb_controls.c - remove duplicate definition of "LDB_CONTROL_CMP"Matthias Dieter Wallnöfer1-11/+3
And fix the comment Reviewed-by: Jelmer
2011-09-11ldb:pyldb.c - point out that "PyLdbResult_AsResult" does not convert everythingMatthias Dieter Wallnöfer1-1/+4
Reviewed-by: Jelmer
2011-09-10lib/util/charset: the comparsion must be against our charset modulesAndrew Bartlett1-2/+2
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
2011-09-10lib/util/charset Use name of ISO-8859-1 that matches our internal implementationAndrew Bartlett1-44/+44
2011-09-10lib/util/charset: Improve toture assertions in iconv testAndrew Bartlett1-1/+14
2011-09-10lib/util/charset Run charset sets with and without the system iconvAndrew Bartlett3-14/+28
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
2011-09-10lib/util/charset: add back loading of charset modulesAndrew Bartlett2-34/+64
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
2011-09-09build: a more robust zlib testAndrew Bartlett1-1/+4
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
2011-09-08lib/replace: include <sys/uio.h> in "system/filesys.h" in order to have ↵Stefan Metzmacher1-0/+4
struct iovec This is needed on some platforms, e.g. NetBSD5. metze
2011-09-08lib: added base64_decode_data_blob_talloc()Andrew Tridgell2-2/+19
its nice to be able to allocate on other than NULL Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-07talloc: Remove an unused variableVolker Lendecke1-1/+0
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Sep 7 16:47:26 CEST 2011 on sn-devel-104
2011-09-07lib/addns: Remove unused TALLOC_ macrosAndrew Bartlett1-42/+0
2011-09-05s4-ldb: allow decoding of trustAuthIncoming and trustAuthOutgoingAndrew Tridgell2-0/+23
this allows --show-binary to display trustAuthOutgoing and trustAuthIncoming NDR blobs. Useful for debugging trust issues Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-01Fix bug 8433, segfault in iconv.cVolker Lendecke1-1/+0
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Sep 1 18:25:34 CEST 2011 on sn-devel-104
2011-09-01ldb: make the 'spy' code more paranoidAndrew Tridgell2-10/+12
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
2011-09-01ldb: fixed ldbsearch when no baseDN specified and cross-ncs is usedAndrew Tridgell1-4/+24
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-01pyldb: added OID_COMPARATOR constantsAndrew Tridgell1-9/+11
This also changes the other constants to remove the LDB_ prefix, which is redundent Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-31tdb2: add full LGPL headersRusty Russell2-0/+34
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-31ccan: fix likely redefinition warnings with --enable-tdb2Rusty Russell1-0/+8
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>
2011-08-27dnspython: Update to latest upstream snapshot.Jelmer Vernooij109-858/+1197
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Aug 27 17:40:39 CEST 2011 on sn-devel-104
2011-08-27subunit: Update to latest upstream snapshot.Jelmer Vernooij22-609/+1281
2011-08-27testtools: Update to latest upstream snapshot.Jelmer Vernooij59-876/+5255