summaryrefslogtreecommitdiffstats
path: root/source4/lib/ldb/ldb_tdb
Commit message (Collapse)AuthorAgeFilesLines
* ldb: make ldb a top level library for Samba 4.0Andrew Bartlett2011-07-057-4822/+0
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* tdb_compat: use tdb_open_compat.Rusty Russell2011-06-202-28/+50
| | | | | | | | | 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>
* tdb2: #ifdef out TDB_ERR_NOLOCK and TDB_ERR_LOCK_TIMEOUT.Rusty Russell2011-06-201-0/+4
| | | | | | | | 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>
* ldb: replace 'struct TDB_DATA' with 'TDB_DATA'Rusty Russell2011-06-203-6/+6
| | | | | | | The typedef is TDB2 compatible, the struct isn't. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_unlockall/tdb_unlockall_read: ignore return value.Rusty Russell2011-06-201-1/+2
| | | | | | | | | TDB2 returns void here. tdb_unlockall will *always* return with the database unlocked, but it will complain via the log function if it wasn't locked. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_traverse/tdb_traverse_read: check returns for negative, not -1.Rusty Russell2011-06-202-3/+3
| | | | | | | | | | | TDB2 returns a negative error number on failure. This is compatible if we always check for < 0 instead of == -1. Also, there's no tdb_traverse_read in TDB2: we don't try to make traverse reliable any more, so there are no write locks anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_transaction_cancel: ignore return value.Rusty Russell2011-06-201-4/+1
| | | | | | | | | 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>
* tdb_store: check returns for 0, not -1.Rusty Russell2011-06-202-2/+2
| | | | | | | | 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>
* tdb_fetch_compat: use instead of tdb_fetch.Rusty Russell2011-06-203-5/+7
| | | | | | | This is a noop for tdb1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_compat.h: divert every tdb build and includes to tdb_compatRusty Russell2011-06-201-1/+1
| | | | | | | | We change all the headers and wscript files to use tdb_compat; this means we have one place to decide whether to use TDB1 or TDB2. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* ldb:tdb backend - cache - remove unused "last_attribute" structure memberMatthias Dieter Wallnöfer2011-04-292-8/+0
| | | | | | | Reviewed-by: abartlet Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Fri Apr 29 20:07:27 CEST 2011 on sn-devel-104
* s4-ldb: fixed a uninitialised el->flags in ldb_tdbAndrew Tridgell2011-02-141-2/+1
| | | | | | this caused an intermittent failure in some tests Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-ldb: added LDB_FLAG_INTERNAL_FORCE_SINGLE_VALUE_CHECKAndrew Tridgell2011-02-141-0/+8
| | | | this allows a ldb module to force an element as single valued
* s4-ldb: use a helper function for single valued checkingAndrew Tridgell2011-02-141-25/+35
| | | | | | | this gives us a single piece of logic for single value checking in the tdb backend Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* ldb:ltdb_sequence_number - initialise "tmp_ctx" to prevent uninitialisation ↵Matthias Dieter Wallnöfer2011-01-121-1/+2
| | | | warning
* ldb:ltdb_sequence_number - check for an OOM exceptionMatthias Dieter Wallnöfer2011-01-121-0/+4
|
* lib/ldb Remove talloc_free() that causes double-free in callbacks.Andrew Bartlett2010-12-181-1/+3
| | | | | | | | | | | | | This partially reverts 0941099a, which was a little over-eager in fixing what were presumed to be memory leaks. It is always the callbacks responsiblity to free the ares, but if they don't then the end of the request should handle the cleanup. Attempting to talloc_free() here will result (as it did in the descriptor module) in a double-free error if the callback does free it, and no other caller of ldb_module_send_entry() has this behaviour. Andrew Bartlett
* ldb-tdb: Add more information about full scanMatthieu Patou2010-11-261-1/+7
|
* s4-ldb: added an environment varibale LDB_WARN_UNINDEXEDAndrew Tridgell2010-11-233-7/+13
| | | | | | when LDB_WARN_UNINDEXED is set, we produce warnings about unindexed searches. This makes it easier to find performance problems caused by unindexed searches.
* ldb:ldb_pack.c - the "dn" attribute isn't allowed in the message part, only ↵Matthias Dieter Wallnöfer2010-11-071-2/+0
| | | | | | | the "distinguishedName" one Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Sun Nov 7 10:11:02 UTC 2010 on sn-devel-104
* ldb:ldb_tdb.c - ltdb_check_special_dn - fix indentationMatthias Dieter Wallnöfer2010-11-061-1/+1
|
* ldb:ldb_tdb.c - make "ltdb_add" more similar to "ltdb_modify"Matthias Dieter Wallnöfer2010-11-061-9/+5
| | | | | And remove in "ltdb_add_internal" a cache loading call which has been present twice.
* s4-ldb: much more memory efficient msg filteringAndrew Tridgell2010-11-051-3/+20
| | | | | | | this ensures we don't leave unnecessary attributes in returned ldb objects Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-ldb: implement LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECKAndrew Tridgell2010-11-041-13/+9
| | | | | | | this disables the single value checking for one attribute. It is much more specific than a general RELAX control, and also more efficient. I think we should try to have more precise overrides like this, rather than using RELAX as a general purpose override
* Move the checking of single valued attributes back into the tdb backend.Andrew Tridgell2010-11-041-0/+44
| | | | | | | | | | | | | The backend is the only place that can do this properly. It makes no sense to do it anywhere else. As a result of it moving out of the backend we ended up with some bugs causing multiple values in single valued attributes (eg. isDeleted), which can really damage the inregrity of the database. For the override of single valued values needed for deleted linked attributes we should use attribute flags. This reverts commit 1949864417f3d10fb8996df7db259649eb777271.
* s4-ldb: removed ldb_includes.hAndrew Tridgell2010-11-011-1/+3
| | | | | | | it causes problems with the openchange build as it is not installed Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Mon Nov 1 21:49:47 UTC 2010 on sn-devel-104
* s4-ldb: enable ldb module version checkingAndrew Tridgell2010-11-011-0/+1
|
* s4-ldb: added an override flag to ldb_register_backend()Andrew Tridgell2010-11-011-1/+1
| | | | | this will be used to allow a system ldb build with an ldb backend to have its ldap handler overridden by the s4 one
* s4-ldb: convert the rest of the ldb modules to the new styleAndrew Tridgell2010-11-011-4/+4
|
* ldb:ldb_tdb/ldb_cache.c - remove a superflous "talloc_free"Matthias Dieter Wallnöfer2010-10-211-3/+1
| | | | Didn't realise that this is already called by "ltdb_attributes_unload".
* ldb:ldb_tdb/ldb_cache.c - in this function we don't use LDB return codesMatthias Dieter Wallnöfer2010-10-211-1/+1
|
* ldb:ldb_index.c - fix some memory leaksMatthias Dieter Wallnöfer2010-10-201-1/+6
| | | | | Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Wed Oct 20 13:11:49 UTC 2010 on sn-devel-104
* ldb:ldb_index.c - let "ldb_module_oom" generate the return codeMatthias Dieter Wallnöfer2010-10-201-15/+8
|
* ldb:ldb_cache.c - fix memory contexts and memory leaksMatthias Dieter Wallnöfer2010-10-201-3/+4
|
* ldb:ldb_tdb submodule - use "ldb_msg_new" where appropriateMatthias Dieter Wallnöfer2010-10-202-12/+12
| | | | It is saver than a manual "talloc".
* ldb:ldb_pack.c - remove superflous "message->elements = NULL"Matthias Dieter Wallnöfer2010-10-201-1/+0
| | | | It's already marked at this at the beginning of the call.
* ldb: always return PROTOCOL_ERROR if an operation is unsupportedMatthias Dieter Wallnöfer2010-10-181-1/+1
| | | | That's exactly the behaviour of various LDAP servers.
* ldb:ldb_tdb.c - fix up counter variablesMatthias Dieter Wallnöfer2010-10-181-5/+8
| | | | | | "find_element" returns an "int" since there is also the possibility that a certain element doesn't exist - then "-1" is returned. But beside this exception treat all other return values as unsigned.
* ldb:ldb_tdb.c - improve the error outputsMatthias Dieter Wallnöfer2010-10-181-13/+25
| | | | | | - Fix indentation - Include always the failing DN - Reorder the outputs to make them consistent
* s4-ldb: take advantage of ldb_match_msg_error() in more placesAndrew Tridgell2010-10-132-4/+16
| | | | this gives better error checking
* s4-ldb: added an optional operator_fn in the schema syntaxAndrew Tridgell2010-10-131-2/+10
| | | | | | | | | | | | | this function takes the operator being invoked, which will allow schema functions to provide more fine grained control over comparisons. The key bug this was introduced to fix is the incorrect handling of the LDB_OP_PRESENT test for deleted linked attributes. The backends are unaware of the deleted state of these links, so they cannot do a LDB_OP_PRESENT test on their own. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* ldb-tdb: ignore failure to register control on rootdseAndrew Tridgell2010-09-281-4/+1
| | | | this is expected for non-sam LDBs
* s4-ldb: ensure element flags are zero in ldb search returnAndrew Tridgell2010-08-171-0/+2
| | | | the distinguishedName element was getting an uninitialised flags value
* s4-ldb: fixed the ldb 'displayName=a,b' indexing bugAndrew Tridgell2010-08-171-2/+4
| | | | | | | | | the problem was the inconsistency between the key form of DNs between the itdb used for indexing and the on disk form Thanks to Matthieu Patou for finding this bug! Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s4-ldb: add some comments explaining the ltdb_index_idxptr() functionAndrew Tridgell2010-08-171-0/+8
| | | | | | this function copes with alignment sensitive CPUs Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s4:objectclass_attrs LDB module - move the single-valued attribute check ↵Matthias Dieter Wallnöfer2010-06-071-44/+0
| | | | | | | | | | into this module It seems to me more consistent (and also to keep the same behaviour on all backends). Also the DRS hack should therefore not be needed anymore since the "repl_meta_data" module launches requests behind "objectclass_attrs".
* s4:rdn_name LDB module - move the "distinguishedName" write prevent check hereMatthias Dieter Wallnöfer2010-06-071-7/+0
| | | | In my eyes it fits better here than in the TDB backend code.
* ldb:ltdb_filter_attrs - fix a counter variable typeMatthias Dieter Wallnöfer2010-06-061-2/+3
|
* ldb:ldb_tdb/ldb_tdb.c - quiet a warning regarding TDB -> LDB error code ↵Matthias Dieter Wallnöfer2010-05-301-0/+2
| | | | conversions
* ldb: mark the tdb backend in ldb as _PRIVATE_Andrew Tridgell2010-04-181-1/+1
|