summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_tdb.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r13839: Use registration mechanism for backends as well (in the same senseJelmer Vernooij1-1/+6
my previous patch added it for modules). This is the next step towards LDB backends and modules as run-time loadable .so files. (This used to be commit fb2f70de4f6c4a9b13ad590cb4d3a9c858cede49)
2007-10-10r13827: Minor enhancements or cosmetic changesSimo Sorce1-22/+9
(This used to be commit 7ef63abae12f65835a82f9931ad1f5ea75e5f3f6)
2007-10-10r13823: make async_wait part of the modules opsSimo Sorce1-4/+3
(This used to be commit b4202cf030d5f154f0f94f5f501ecd648ba5c48f)
2007-10-10r13818: Make ldb_tdb 'fake' async.Simo Sorce1-39/+277
Simo. (This used to be commit 0db616ef59ed51cac7e0bfaea8a799d5aa42ef16)
2007-10-10r13786: [merge] Add registration functions for LDB modulesJelmer Vernooij1-7/+1
Applications that use LDB modules will now have to run ldb_global_init() before they can use LDB. The next step will be adding support for loading LDB modules from .so files. This will also allow us to use one LDB without difference between the standalone and the Samba-specific build (This used to be commit 52a235650514039bf8ffee99a784bbc1b6ae6b92)
2007-10-10r13700: added highestCommittedUSN, uSNChanged and uSNCreated support, usingAndrew Tridgell1-0/+26
the @BASEINFO sequenceNumber (simo, I changed the function pointer to a structure element as you preferred) (This used to be commit 68c9ac38c7eed221b44499ee3d74597063dfe7a1)
2007-10-10r13615: Make ldb_set_errstring get ldb instead of module as parameter.Simo Sorce1-6/+6
The module was just used to get to the ldb so it was meningless. Also add LDB_WAIT_ONCE e relative code in ldb_ildap.c (This used to be commit d5b467b7c132b0bd4d23918ba7bf3370b1afcce8)
2007-10-10r12829: fix ldb headers, to not include '<...>' files in .c filesStefan Metzmacher1-3/+2
this helps in getting symbol -fvisibility=hidden (GCC 4 feature) working later. metze (This used to be commit 380938e97f31c7860aed1e73cc0110c6e17b472e)
2007-10-10r12743: Remove the ugly way we had to make a second stage init and introduceSimo Sorce1-1/+7
a second_stage_init private function for modules that need a second stage init. Simo. (This used to be commit 5e8b365fa2d93801a5de1d9ea76ce9d5546bd248)
2007-10-10r12733: Merge ldap/ldb controls into main treeSimo Sorce1-0/+6
There's still lot of work to do but the patch is stable enough to be pushed into the main samba4 tree. Simo. (This used to be commit 77125feaff252cab44d26593093a9c211c846ce8)
2007-10-10r12540: Provide more information in the ldb error string.Andrew Bartlett1-3/+5
Andrew Bartlett (This used to be commit 31f65e510cdd46b1962cf06b3d51f152b1cecf37)
2007-10-10r11958: - fixed memory leaks in the ldb_result handling in ldb operationsAndrew Tridgell1-1/+1
- removed an unnecessary level of pointer in ldb_search structure (This used to be commit b8d4afb14a18dfd8bac79882a035e74d3ed312bd)
2007-10-10r11567: Ldb API change patch.Simo Sorce1-5/+33
This patch changes the way lsb_search is called and the meaning of the returned integer. The last argument of ldb_search is changed from struct ldb_message to struct ldb_result which contains a pointer to a struct ldb_message list and a count of the number of messages. The return is not the count of messages anymore but instead it is an ldb error value. I tryed to keep the patch as tiny as possible bu as you can guess I had to change a good amount of places. I also tried to double check all my changes being sure that the calling functions would still behave as before. But this patch is big enough that I fear some bug may have been introduced anyway even if it passes the test suite. So if you are currently working on any file being touched please give it a deep look and blame me for any error. Simo. (This used to be commit 22c8c97e6fb466b41859e090e959d7f1134be780)
2007-10-10r11353: a bit of an improvement to the ldb_tdb error handlingAndrew Tridgell1-6/+39
(This used to be commit 896704f5c139c8bce30dfc898bb3a12be10035ed)
2007-10-10r10913: This patch isn't as big as it looks ...Andrew Tridgell1-1/+1
most of the changes are fixes to make all the ldb code compile without warnings on gcc4. Unfortunately That required a lot of casts :-( I have also added the start of an 'operational' module, which will replace the timestamp module, plus add support for some other operational attributes In ldb_msg_*() I added some new utility functions to make the operational module sane, and remove the 'ldb' argument from the ldb_msg_add_*() functions. That argument was only needed back in the early days of ldb when we didn't use the hierarchical talloc and thus needed a place to get the allocation function from. Now its just a pain to pass around everywhere. Also added a ldb_debug_set() function that calls ldb_debug() plus sets the result using ldb_set_errstring(). That saves on some awkward coding in a few places. (This used to be commit f6818daecca95760c12f79fd307770cbe3346f57)
2007-10-10r10753: don't require every ldb module to implement both a search_bytree() andAndrew Tridgell1-1/+0
a search() function, instead each module now only implements the bytree method, and the expression based search is handled generically by the modules code. This makes for more consistency and less code duplication. fixed the tdb backend to handle BASE searches much more efficiently. They now always only lookup one record, regardless of the search expression (This used to be commit 7e44f9153c5578624e2fca04cdc0a00af0fd9eb4)
2007-10-10r10477: expose transactions outside ldb and change the API once moreSimo Sorce1-19/+25
do not autostart transactions on ldb operations if a transaction is already in place test transactions on winsdb all my tests passes so far tridge please confirm this is ok for you (This used to be commit c2bb2a36bdbe0ec7519697a9a9ba7526a0defac2)
2007-10-10r10408: now that we are using tdb transactions we don't need any additionalAndrew Tridgell1-164/+0
locking code in the ldb_tdb backend, except for a single read lock during searches to ensure searches don't cross transaction boundaries The tdb transactions code would map these extra locks to noops anyway (as locking makes no sense inside a transaction), but the work in setting up the locking keys still costs something, and it makes the code needlessly complex (This used to be commit 1b8d368a6771360fb0626127c02b3eb95f3eae59)
2007-10-10r10406: added --nosync option to all ldb tools, so that you can control ifAndrew Tridgell1-5/+4
transactions are synchronous or not on the command line. add LDB_FLG_NOSYNC flag to ldb_connect() so we can make our temporary ldb databases non-synchronous (This used to be commit dba41164e0c52f1e4351bd9057b16661cee3a822)
2007-10-10r10405: added transactions into tdb, and hook them into ldb. See myAndrew Tridgell1-2/+22
samba-technical posting for more details on the transactions design. This also adds a number of command line arguments to tdbtorture, making it more flexible, and fixes some lock deadlock conditions in the tdbtorture code. (This used to be commit 06bd8abba942ec9f1e23f5c5d546cbb71ca3a701)
2007-10-10r10305: start implementing better error handlingSimo Sorce1-65/+57
changed the prioivate modules API error string are now not spread over all modules but are kept in a single place. This allows a better control of memory and error reporting. (This used to be commit 3fc676ac1d6f59d08bedbbd9377986154cf84ce4)
2007-10-10r10299: remove the public (un)lock functions and introduce a transaction basedSimo Sorce1-10/+23
private ldb API ldb_sqlite3 is already working with this model and ldb_tdb will do as soon as tridge finishes the tdb transaction code. currently the transactions are always implicit and wrap any single ldb API call except searching, the transaction functions are currently not made public on purpose. Simo. (This used to be commit 1da4ac2cdcb7e54076f85242a93784260dced918)
2007-10-10r9391: Convert all the code to use struct ldb_dn to ohandle ldap like ↵Simo Sorce1-39/+74
distinguished names Provide more functions to handle DNs in this form (This used to be commit 692e35b7797e39533dd2a1c4b63d9da30f1eb5ba)
2007-10-10r8625: move the ldb_wrap logic into the ldb code. This logic is meant toAndrew Tridgell1-22/+8
avoid the horrors of posix locking, but it was preventing us having an ldb open twice with different options. Now each ldb open of the same file shares the same underlying tdb, but uses a different ldb structure (This used to be commit 4e090c66dfa1d2764e4693578d3845be3b8893f6)
2007-10-10r8601: fixed null termination in ltdb connect errorAndrew Tridgell1-1/+1
(This used to be commit 64b6586b57de0bf22f8779447d217a918b7024a0)
2007-10-10r8084: do not leak memory on errorsSimo Sorce1-7/+5
(This used to be commit 2e328e6c2fc2c66b0d0de910cd43ab232049bc90)
2007-10-10r8082: large rewite of ldb_dn.cSimo Sorce1-2/+1
- we do not support multpiple attribute components anymore, makes code a lot easier they will be readded later if we found out they are really used, so far my tests show w2k3 do not handle them as well - fix escaping issues, move component value to be in an ldb_val structure still need to handle binary values case - make cononicalize functions leak less memory by giving a specific memory context - fix tests scripts so that test-ldap can start - make test not delete databases on completion so that I can inspect them (This used to be commit 624a73148d125690ce18515f19231d26df207738)
2007-10-10r8037: a fairly major update to the internals of ldb. Changes are:Andrew Tridgell1-53/+12
- moved the knowledge of attribute types out of ldb_tdb and into the generic ldb code. This allows the ldb_match() message match logic to be generic, so it can be used by other backend - added the generic ability to load attribute handlers, for canonicalisation, compare, ldif read and ldif write. In the future this will be used by the schema module to allow us to correctly obey the attributetype schema elements - added attribute handlers for some of the core ldap attribute types, Integer, DirectoryString, DN, ObjectClass etc - added automatic registration of attribute handlers for well-known attribute names 'cn', 'dc', 'dn', 'ou' and 'objectClass' - converted the objectSid special handlers for Samba to the new system - added more correct handling of indexing in tdb backend based on the attribute canonicalisation function - added generic support for subclasses, moving it out of the tdb backend. This will be used in future by the schema module - fixed several bugs in the dn_explode code. It still needs more work, but doesn't corrupt ldb dbs any more. (This used to be commit 944c5844ab441b96d8e5d7b2d151982139d1fab9)
2007-10-10r7936: new ldb_dn_explode and ldb_dn_casefold functions and coSimo Sorce1-5/+43
(This used to be commit 7ccf21ab4eeb9821e457308a239f2103a106fb12)
2007-10-10r7784: give an error in ldb_tdb for invalid modify flags. The "whenChanged"Andrew Tridgell1-0/+3
bug was being silently ignored with the tdb backend because of this bug. A case where the ldap backend was right, and the tdb backend was wrong! (This used to be commit ddb26db763c314049043d80d27113226c0f2e656)
2007-10-10r7709: - convert ldb to use popt, so that it can interact with the sambaAndrew Tridgell1-24/+19
cmdline credentials code (which will be done soon) - added a ldb_init() call, and changed ldb_connect() to take a ldb context. This allows for much better error handling in ldb_connect(), and also made the popt conversion easier - fixed up all the existing backends with the new syntax - improved error handling in *_connect() - fixed a crash bug in the new case_fold_required() code - ensured that ltdb_rename() and all ltdb_search() paths get the read lock - added a ldb_oom() macro to make it easier to report out of memory situations in ldb code (This used to be commit f648fdf187669d6d87d01dd4e786b03cd420f220)
2007-10-10r7601: ldb_sqlite3 work in progressDerrell Lipman1-2/+5
(This used to be commit 0a64948152a446b5e127578d49b1ed8a90a1a222)
2007-10-10r7527: - added a ldb_search_bytree() interface, which takes a ldb_parse_treeAndrew Tridgell1-9/+10
instead of a search expression. This allows our ldap server to pass its ASN.1 parsed search expressions straight to ldb, instead of going via strings. - updated all the ldb modules code to handle the new interface - got rid of the separate ldb_parse.h now that the ldb_parse structures are exposed externally - moved to C99 structure initialisation in ldb - switched ldap server to using ldb_search_bytree() (This used to be commit 96620ab2ee5d440bbbc51c1bc0cad9977770f897)
2007-10-10r7276: - moved static tdb function ltdb_dn_fold() into common/ so that it can beDerrell Lipman1-71/+5
called from multiple backends. (ldb_sqlite3 needs it too.) Added parameter for a callback function that determines whether an attribute needs case folding. - begin to prepare for sqlite3 in build process - work-in-progress updates, on ldb_sqlite3 (This used to be commit a80bced0b96ffb655559a43cf7f4d7a34deb5a7d)
2007-10-10r6867: this code will change the way the @ATTRIBUTES object is handledSimo Sorce1-1/+38
this object properties are now used as multivalue attributes now all values inserted are checked against a "valid values table" eg: this form is now accepted: dn: @ATTRIBUTES uid: CASE_INSENSITIVE uid: WILDCARD this form is now rejected: dn: @ATTRIBUTES uid: CASE_INSENSITIVE WILDCARD please update your .ldb files if you make use of @ATTRIBUTES (sam.ldb heavily uses it) the code passes all make test tests for both tdb and ldap, it also passes the new test to check for wrong @ATTRIBUTES attribute values Simo. (This used to be commit 1295b891a26c2cb2c34540f90ded83390cf87da2)
2007-10-10r6560: added a tdb_chainlock_read() call in ldb_search(). This guaranteesAndrew Tridgell1-0/+34
that ldb_search() sees a single consistent view of the database (by blocking writes during a ldb_search) (This used to be commit 917f2a8a073fd501f0626bea4f9deb91b95fdc90)
2007-10-10r6470: Remove ldb_search_free() it is not needed anymore.Simo Sorce1-1/+0
Just use talloc_free() to release the memory after an ldb_search(). (This used to be commit 4f0948dab0aa5e8b6a4ce486f3668ca8dfae23db)
2007-10-10r5585: LDB interfaces change:Simo Sorce1-11/+0
changes: - ldb_wrap disappears from code and become a private structure of db_wrap.c thanks to our move to talloc in ldb code, we do not need to expose it anymore - removal of ldb_close() function form the code thanks to our move to talloc in ldb code, we do not need it anymore use talloc_free() to close and free an ldb database - some minor updates to ldb modules code to cope with the change and fix some bugs I found out during the process (This used to be commit d58be9e74b786a11a57e89df36081d55730dfe0a)
2007-10-10r5374: - changed the dn key code in the ldb tdb backend to correctly honorAndrew Tridgell1-2/+79
the case sensitive/insensitive flags on sections of a dn. So if a dn is made up of 4 attributes, and 2 of those are case insensitive and 2 are case sensitive, then all the attribute names are uppercases, but only the values of the case insensitive attributes are uppercased when forming the tdb key. - added code to canonicalise the dn, removing leading and trailing spaces from attribute names and values - when the @ATTRIBUTES record changes, fix the dn keys of any records that should now have new dn keys due to changes in the case sensitivity of the record I really did this to allow me to make the WINS database properly case insensitive, but it is also the correct general fix for ldb, as it matches the LDAP specification (and w2k LDAP server behaviour) (This used to be commit 0f034dc5636d182a1d9207ad662b3fc8df7ca3e4)
2007-10-10r4714: move the ldb code to the new talloc interface (eg remove _p suffix)Simo Sorce1-10/+10
this helps standalone building of ldb renew the schema module split code into functions to improve readability and code reuse add and modify works correctly but we need a proper testsuite Simo (This used to be commit a681ae365ff1b5a2771b42ebd90336651ce1e513)
2007-10-10r4474: - converted ldb to use talloc internallyAndrew Tridgell1-99/+101
- added gcov flags to Makefile.ldb - expanded ldb test suite to get more coverage (This used to be commit 0ab98f50a7e0fe15347a99e5c29a6590a87729a0)
2007-10-10r4366: Fix ldb_modify_internal: Adding values to an existing attribute you ↵Volker Lendecke1-9/+36
could end up with a corrupt data structure on disk, namely with two attribute structures for the same attribute name. Volker (This used to be commit 284044b5b20102894a8128f84ab41d59cfcc9285)
2007-10-10r4281: fixed an ldb indexing bug in ldb found by volker.Andrew Tridgell1-5/+12
index entries were not always being removed on modify (This used to be commit 9c668e7b43dc2d82d3d639b64c53e887723ccba7)
2007-10-10r4071: - ldap does allow adding additional attribute values with a modifyAndrew Tridgell1-2/+7
operation, but not if the value already exists - fixed syntax of test.ldif for ldap backend (This used to be commit 29225d0bec39038e42e68849bd9378898f062081)
2007-10-10r3897: add a locking infrastructureSimo Sorce1-18/+32
(This used to be commit a99c0adb09e2bc77b876d23cb2d0711ccffd83ca)
2007-10-10r3783: - don't use make proto for ldb anymoreStefan Metzmacher1-5/+7
- split ldh.h out of samba's includes.h - make ldb_context and ldb_module private to the subsystem - use ltdb_ prefix for all ldb_tdb functions metze (This used to be commit f5ee40d6ce8224e280070975efc9911558fe675c)
2007-10-10r3754: merge in ldb modules support from the tmp branch ldbPluginsSimo Sorce1-74/+93
(This used to be commit 71323f424b4561af1fdddd2358629049be3dad8c)
2007-10-10r3095: - fix a free'ing of msg.dnStefan Metzmacher1-1/+2
- reenable index tests metze (This used to be commit 1e7e94fdb10db831090f9bd37e39053dfcde04ce)
2007-10-10r3093: - implment ldb_rename() and ldbrenameStefan Metzmacher1-0/+58
- add tests for ldbrename - disable all tests which regenerate the index (this is broken for me...the process hangs, tridge we need to discuss that) - link only the needed stuff to the ldb tools - build ldbtest inside samba metze (This used to be commit 18552f4786c24e0019cc87726ef4c05365fe586e)
2007-10-10r2192: removed an erroneous free() call on an error pathAndrew Tridgell1-1/+0
(This used to be commit c80d686f59a8b6c53305af1233137c22a26f6750)