summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
AgeCommit message (Collapse)AuthorFilesLines
2009-09-21s4-ldb: fixed O(n^2) string handling in ldif debug printAndrew Tridgell1-3/+3
2009-09-21s4-ldb: add a LDB_FLG_ENABLE_TRACING for full ldb tracingAndrew Tridgell3-1/+126
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-20s4:ldb_parse - Fix the type of an array entryMatthias Dieter Wallnöfer1-1/+1
I found this through a compile warning. Hope that I got this right.
2009-09-20s4:ldb: add ldb_parse_tree_copy_shallow() and change version to 0.9.7Stefan Metzmacher1-0/+58
metze
2009-09-15s4-ldb: ldap attribute names can contain a '.'Andrew Tridgell1-1/+2
When they are of the form of OIDs
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-11ldb: Remove references to operational module init function.Jelmer Vernooij1-1/+0
This module is now part of Samba 4's dsdb subsystem rather than standalone ldb.
2009-09-11s4-ldb: don't remove a message element beyond the end of the arrayAndrew Tridgell1-0/+4
2009-09-08s4/ldb: expose the ldb flags with ldb_get_flags()Andrew Tridgell1-0/+6
2009-09-08s4/ldb: don't line wrap ldif when --show-binary is usedAndrew Tridgell1-4/+9
2009-09-08s4/ldb: added --show-binary command line optionAndrew Tridgell1-2/+6
This add --show-binary to ldbsearch. When this flag is set, binary blobs will be shown as-is, instead of base64 encoded. This is useful for some XML encoded attributes, and will also be used as part of some NDR print formatting for attributes like repsTo.
2009-09-04ldb: make ldb module programming less error proneAndrew Tridgell1-0/+14
When a top level method in a module returns an error, it is supposed to call ldb_module_done(). We ran across a case where this wasn't done, and then found that in fact that are hundreds of similar cases in our modules. It took Andrew and I a full day to work out that this was the cause of a subtle segv in another part of the code. To try to prevent this happening again, this patch changes ldb_next_request() to catch the error by checking if a module returning an error has called ldb_module_done(). If it hasn't then the call is made on behalf of the module.
2009-09-03always use prepare_commit in ldb transaction commits if possibleAndrew Tridgell2-6/+50
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-09-02don't allow two controls to be added with the same OIDAndrew Tridgell1-1/+7
Two controls with the same OID makes no sense, as they may have different data attached
2009-09-02added ldb_ldif_message_string()Andrew Tridgell1-0/+16
This function provides a easy function for displaying a ldb_message structure in a human readable format. It is especially useful for calling in gdb.
2009-08-30ldb: cosmetic changes in ldb_dnSimo Sorce1-193/+292
- remove trailing spaces and tabs - shorten some variable names for readability - try to break superlong lines for readability
2009-08-26s4:ldb Add ldb_ldif_write_string() and python wrappersAndrew Bartlett1-0/+40
This allows us to turn a python LdbMessage back into a string. Andrew Bartlett
2009-08-21s4:ldb Use length-limited printf to avoid walking off end of stringsAndrew Bartlett1-1/+1
This should ensure the debug messages do not have random characters at their ends. Andrew Bartlett
2009-08-14s4:ldb - Free the asynchronous resultMatthias Dieter Wallnöfer1-0/+2
2009-08-07make sure we never look past the end of either string in ldb_comparison_fold()Andrew Tridgell1-26/+44
This fixes a bug in the samba3sam test with the python libraries as noticed by abartlet
2009-07-23s4:ldb: add support for the new Recycle Bin Feature LDAP controlsStefan Metzmacher1-0/+54
LDB_CONTROL_SHOW_RECYCLED_OID 1.2.840.113556.1.4.2064 LDB_CONTROL_SHOW_DEACTIVATED_LINK_OID 1.2.840.113556.1.4.2065 metze
2009-07-14remove all '\n' from ldb_debugSumit Bose5-20/+21
2009-07-06s4:ldb Fix talloc hirarchy in LDIF parsing codeAndrew Bartlett1-3/+3
The problem here was that some parts of the ldb_message were still attached to the ldb_ldif structure, and when only the message was taken (and the ldif free'ed to reclaim memory) we refereced free'ed memory. Andrew Bartlett
2009-06-29ldb: Properly handle NULL when copying attr lists.Andrew Kroeger1-4/+4
When copying an attribute list, ensure the list itself is not NULL before attempting to access elements of the list.
2009-06-10fixed server side sorting of case-insensitive stringsAndrew Tridgell1-3/+0
The sort module uses ldb_comparison_fold() as the comparison function for case-insensitive attributes. In other places the function is being used to produce a boolean, but for sorting we care about ordering. The n1 - n2 return was sorting by length, not value
2009-06-01when comp_num is zero, the case folded DN is always ""Andrew Tridgell1-8/+2
This fixes a bug where we would look at an uninitialised dn->linearized
2009-05-26s4:ldb:modules: Correct typos.Andrew Kroeger1-3/+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-04-07fixed internal handling of attribute deletionAndrew Tridgell1-13/+23
2009-04-02major upgrade to the ldb attribute handlingAndrew Tridgell2-7/+67
This is all working towards supporting the full WSPP schema without a major performance penalty. We now use binary searches when looking up classes and attributes. We also avoid the loop loading the attributes into ldb, by adding a hook to override the ldb attribute search function in a module. The attributes can thus be loaded once, and then saved as part of the global schema. Also added support for a few more key attribute syntaxes, as needed for the full schema.
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-23Fix headers, ldb_includes.h is a private header,Simo Sorce1-4/+1
do not reference it from ldb.h
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-30Explicitly include ldb_handlers.h where necessarySimo Sorce1-0/+1
2009-01-30Add helper function to get a module name, may be useful for debugging.Simo Sorce1-0/+5
2009-01-30Fix the mess with ldb includes.Simo Sorce13-13/+63
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-12-19Small cosmetic LDB patch regarding return values.Matthias Dieter Wallnöfer2-3/+3
It changes some "return 0" in "return LDB_SUCCESS"
2008-12-17s4:ldb: make it possible to return per entry controlsAndrew Bartlett2-1/+25
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17s4:ldb: use try to print the extended dn in the ldif outputAndrew Bartlett1-2/+4
This allows searches with the extended DN control to still print the extended DN in ldif output (it would otherwise be parsed and hidden in the structure). Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-17s4:ldb: add infrastructure for extended dn handlersAndrew Bartlett2-58/+442
This introduces a new set of pluggable syntax, for use on the extended DN, and uses them when parsing the DN. If the DN appears to be in the extended form, we no longer return the full DN 'as is', but only return the normal part from ldb_dn_get_linearized(). When validating/parsing the DN we validate not only the format of the DN, but also the contents of the GUID or SID (to ensure they are plausable). We also have functions to set and get the extended components on the DN. For now, extended_dn_get_linearized() returns a newly constructed and allocated string each time. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-03Merge branch 'master' of ssh://git.samba.org/data/git/sambaAndrew Tridgell1-2/+4
2008-11-17Print unconvertable ldb element values as base64.Andrew Bartlett1-2/+4
If an LDB element cannot be converted into a printable form, we should still print it, just with safety applied. Andrew Bartlett
2008-11-06don't give errors when an empty modules list is given to ldbAndrew Tridgell1-2/+9
2008-11-04Use ldb_dn_from_ldb_val to avoid possible over-run of the value.Andrew Bartlett3-6/+6
The ldb_val is length-limited, and while normally NULL terminated, this avoids the chance that this particular value might not be, as well as avoiding a cast. Andrew Bartlett
2008-10-30Revert "Length comparison of the linearized version is not correct."Simo Sorce1-0/+3
This reverts commit 753af36a3e194f645ec0b68a033199035e71c909.
2008-10-29Length comparison of the linearized version is not correct.Simo Sorce1-3/+0
The linearized version is not casefolded so length might not match and yet the strings be equivalent. This can happen if one component is case-insensitive and a letter that have an uppercase version of a multibyte character that differ in legth from the corresponding lowercase one.