summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb.c
AgeCommit message (Collapse)AuthorFilesLines
2011-04-07ldb:common/*.c - check for some OOM conditionsMatthias Dieter Wallnöfer1-0/+4
Reviewed-by: abartlet
2011-03-04ldb:ldb_request - handle here the DN checksMatthias Dieter Wallnöfer1-1/+22
This is a much better solution than we had before - so all important DN checks are enforced for each type of LDB database (and not limited to DSDB). Many "ldb_dn_validate" checks will now become obsolete. Reviewed by: Tridge
2011-01-17ldb: added ldb_req_mark_trusted()Andrew Tridgell1-0/+8
this is used to mark a ldb child request trusted, if the caller has validated all inputs. This will be used when creating new child requests with trusted inputs. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-17ldb: inherit parent flags on child requests in modulesMatthias Dieter Wallnöfer1-0/+11
2010-11-03s4-ldb: expose some more ldb module functionsAndrew Tridgell1-1/+1
this exposes enough functions for s4 to not need ldb_private.h any more.
2010-11-01s4-ldb: support a new type of ldb module loadingAndrew Tridgell1-0/+10
this supports module loading in ldb which uses the approach of "load all modules in a directory". This is much more flexible than the current module loading, as it will allow us to load modules for command line parsing and authentication. Modules are loaded from a colon separated path, in the environment variable LDB_MODULES_PATH. If unset, it defaults to LDB_MODULESDIR. Within each directory modules are loaded recursively (traversing down the directory tree). The device/inode number of each module is remembered to prevent us loading a module twice. Each module is checked for a ldb_init_module() function with dlsym(). If found, it is called with the ldb module version as an argument.
2010-10-19s4-ldb: cope with NULL oid in controlsAndrew Tridgell1-4/+6
the ldap server will mark a control with a NULL oid in order to remove it. This prevents a O(n^2) cost in control handling. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-19s4-ldb: added ldb_req_mark_untrusted() and ldb_req_is_untrusted()Andrew Tridgell1-0/+17
these will be used to determine if a ldb request comes from an untrusted source. We want requests over ldap:// to be marked untrusted so we can reject unregistered controls Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-11ldb The use of a private event context isn't a hackAndrew Bartlett1-2/+3
This is deliberate behaviour. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Mon Oct 11 13:45:14 UTC 2010 on sn-devel-104
2010-10-11s4-ldb Don't use talloc_autofree_context() in ldbAndrew Bartlett1-1/+1
The private event context only needs to live as long as ldb itself. Andrew Bartlett
2010-09-25ldb: added request location trackingAndrew Tridgell1-0/+26
this is used to help debug async ldb requests. The ldb request handle now contains a location string and the parent request pointer. This allows us to print a backtrace of ldb requests in the dsdb modules.
2010-08-17s4-ldb: added LDB_FLAG_INTERNAL_MASKAndrew Tridgell1-0/+26
This ensures that internal bits for the element flags in add/modify requests are not set via the ldb API Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-07-29s4-ldb: use TALLOC_CTX type instead of 'void'Kamen Mazdrashki1-7/+7
2010-07-19s4-dsdb: use ldb_msg_normalize() in source4/lib/ldb/common/ldb.cKamen Mazdrashki1-5/+7
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-07s4-ldb: added ldb_error() and ldb_operr()Andrew Tridgell1-0/+16
These will be used to help avoid the problem we have with hundreds of places that do "return LDB_ERR_OPERATIONS_ERROR" without an explanation. It is very difficult to track down ldb errors which don't have any explanation. By replacing "return LDB_ERR_OPERATIONS_ERROR;" with "return ldb_operr(ldb);" we at least get a file:line message in the ldb error string. It isn't an ideal error message, but it is much better than just "operations error" This change also makes ldb_oom() return the error code (LDB_ERR_OPERATIONS_ERROR) so you can do: return ldb_oom(ldb); instead of: ldb_oom(ldb); return LDB_ERR_OPERATIONS_ERROR;
2010-05-04s4/rodc: Support read-only databaseAnatoliy Atanasov1-0/+48
Check on modify if we are RODC and return referral. On the ldap backend side now we pass context and ldb_modify_default_callback to propagate the referral error to the client.
2010-03-08LDB:common - Change counters to "unsigned" where appropriateMatthias Dieter Wallnöfer1-2/+2
To count LDB objects use variables of type "unsigned (int)" or "long long int" on binary or downto searches. To count characters in strings use "size_t". To calculate differences between pointers use "ptrdiff_t".
2009-12-18s4-ldb: canonicalise the message on ldb_addAndrew Tridgell1-0/+9
This canonicalise avoids a problem with an add that has multiple elements with the same el->name. That is allowed by MS servers, and by ldb, but it breaks things like the tdb backend and the repl_meta_data RPMD handling. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2009-12-16s4-ldb: fixed a transaction error on prepare_commitAndrew Tridgell1-2/+2
when a prepare commit fails, we need to give a cancel to all modules, not a commit! Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2009-12-15Removed ldb_modify_ctrl from ldb, implemented as a static in ldap_backend.Nadezhda Ivanova1-13/+4
2009-11-27s4-ldb: better to test for valid arguments in ldb library than commandlineAndrew Tridgell1-0/+10
We were testing for valid DNs in ldbrename in the command line tool. This hid a bug in the ldb library where we caught a bad DN in the objectclass module rather than in the main ldb code. It is better to do validation of the DNs passed on the command line in the library code, as this gives us more consistent error handling between the programming APIs for ldb and the command line.
2009-11-20Some changes to allow processing of ldap controls on modify requests.Nadezhda Ivanova1-4/+13
ldap_backend used to filter out ldap controls on modify. Also, modified python binding for ldap_modify to allow writing tests for such controls.
2009-11-07ldb_init: use constant for result of "ldb_setup_wellknown_attributes"Matthias Dieter Wallnöfer1-1/+1
2009-11-06s4/ldb: Fix double allocation for "ldb_url"Kamen Mazdrashki1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-10-27s4:ldb Add additional tracing of the ldb APIAndrew Bartlett1-0/+20
This helps pin down where errors occour, by printing a call stack and setting error strings and trace messages in the transaction case. Andrew Bartlett
2009-10-23s4-ldb: added ldb_transaction_cancel_noerr()Andrew Tridgell1-0/+13
This will be used to allow cancelling of transactions in a child after a fork()
2009-09-22s4-ldb: when tracing, show ldb_set_debug messagesAndrew Tridgell1-0/+3
2009-09-22s4-ldb: only show the outer level of ldb ops when tracingAndrew Tridgell1-1/+26
2009-09-22s4-ldb: don't show timestamps on every line of ldb tracesAndrew Tridgell1-38/+42
This adds ldb_debug_add() and ldb_debug_end() to format multiline messages
2009-09-21s4-ldb: bit prettier outputAndrew Tridgell1-7/+15
2009-09-21s4-ldb: add a LDB_FLG_ENABLE_TRACING for full ldb tracingAndrew Tridgell1-0/+90
When LDB_FLG_ENABLE_TRACING is set ldb will send full traces of all operations and results
2009-09-20s4:ldb print out which LDB the transaction is still active on.Andrew Bartlett1-2/+2
2009-09-15s4-ldb: expose ldb_transaction_prepare_commit() in ldbAndrew Tridgell1-21/+57
It is useful to be able to control the 2 phase commit from application code (s4 replication uses it)
2009-09-08s4/ldb: expose the ldb flags with ldb_get_flags()Andrew Tridgell1-0/+6
2009-09-03always use prepare_commit in ldb transaction commits if possibleAndrew Tridgell1-4/+33
The reason we need this is to make multi-tdb transactions safe, with the partition module. The linked_attributes and repl_meta_data modules now do extra processing when the transaction ends, and that processing can fail. When it fails we need to cancel the transaction, which we can only do if the hook is on the prepare commit instead of the end transaction call. Otherwise the partition module cannot ensure that no commit has been done on another partition.
2009-08-14s4:ldb - Free the asynchronous resultMatthias Dieter Wallnöfer1-0/+2
2009-07-14remove all '\n' from ldb_debugSumit Bose1-1/+1
2009-04-23Provide a ldb_global_init() function for compatibility with older versions ↵Jelmer Vernooij1-0/+6
of LDB (including the one in Samba 3).
2009-03-12s4:ldb: allow nested events until the code is fixed to avoid themStefan Metzmacher1-1/+3
metze
2009-03-12s4:ldb: setup tevent debug functions on a selfcreated event contextStefan Metzmacher1-0/+35
metze
2009-02-23Make all transactions nested in ldb. The current samba4 code expects thisSimo Sorce1-59/+73
behavior anyway, and given we can only have one transaction active per ldb context this is the only sane model we can support. Fix ldb_tdb transactions, we could return back with an error with neither committing nor canceling the actual tdb transaction in some error paths within the ltdb commit and cancel transaction paths. Added also some debugging to trace what was going on.
2009-01-30Fix the mess with ldb includes.Simo Sorce1-1/+16
Separate again the public from the private headers. Add a new header specific for modules. Also add service function for modules as now ldb_context and ldb_module are opaque structures for them.
2009-01-21s4:ldb: remove dependency to samba4's events wrapperStefan Metzmacher1-3/+10
metze
2008-12-29s4:lib/tevent: rename structsStefan Metzmacher1-4/+4
list="" list="$list event_context:tevent_context" list="$list fd_event:tevent_fd" list="$list timed_event:tevent_timer" for s in $list; do o=`echo $s | cut -d ':' -f1` n=`echo $s | cut -d ':' -f2` r=`git grep "struct $o" |cut -d ':' -f1 |sort -u` files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4` for f in $files; do cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp mv $f.tmp $f done done metze
2008-10-16Transform the sequence_number operation into a normal extended operation as ↵Simo Sorce1-21/+29
it should always have been. Make it also async so that it is not a special case.
2008-09-29LDB ASYNC: Core filesSimo Sorce1-95/+209
2008-09-23Merge ldb_search() and ldb_search_exp_fmt() into a simgle function.Simo Sorce1-53/+28
The previous ldb_search() interface made it way too easy to leak results, and being able to use a printf-like expression turns to be really useful.
2008-09-06Always free tmp contexts before returningSimo Sorce1-0/+1
(This used to be commit 40b71bbd718f6dee70c0611e527f55c56623dea6)
2008-06-30ldb: allow ldb modules to specify LDB_MODULE(name) or LDB_BACKEND(name)Stefan Metzmacher1-147/+0
metze (This used to be commit 1d5b714438a955d76f92f4ccd8aa2f7f89ffa5fd)
2008-06-17Change our module code to not use the special symbol name init_module()Andrew Tridgell1-10/+0
Current glibc libraries include a function called init_module(). If we use the same name, then a dlsym() can find the glibc function if the module doesn't have an initialisation function. In ldb, none of our modules have an init_module(), so we end up calling the libc functions with bogus arguments. (This used to be commit 1b0621068998590e7b1e9528b78744dcd2cd5909)