summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_search.c
AgeCommit message (Collapse)AuthorFilesLines
2009-01-30Fix the mess with ldb includes.Simo Sorce1-15/+24
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.
2008-12-17s4:ldb: make it possible to return per entry controlsAndrew Bartlett1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-10-20Make sure prototypes are always included, make some functions static andJelmer Vernooij1-1/+1
remove some unused functions.
2008-10-16Transform the sequence_number operation into a normal extended operation as ↵Simo Sorce1-24/+0
it should always have been. Make it also async so that it is not a special case.
2008-09-29LDB ASYNC: ldb_tdb backendSimo Sorce1-85/+44
2008-09-25Revert LDB return code patches from Matthias.Jelmer Vernooij1-21/+21
2008-09-24Cosmetic corrections for the LDB backend modulesMatthias Dieter Wallnöfer1-21/+21
This commit applies some cosmetic corrections for the LDB backend modules.
2007-12-21r26131: Ensure we show the right errors in the NULL base DN case. Based onAndrew Bartlett1-0/+2
bug 5090 by Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> Andrew Bartlett (This used to be commit cc2d0c9f15a9c687d212df14d8ffb6c60ad15242)
2007-12-21r25965: Remove duplicate block - thanks metze!Andrew Bartlett1-18/+0
Andrew Bartlett (This used to be commit d7e65da56454bc7721083e0aa7fa2e9c47f2b79d)
2007-12-21r25959: Add a new special DN to LDB: @OPTIONSAndrew Bartlett1-12/+110
Use the checkBaseOnSearch attribute to control if we should check the base DN on search requests. Also ensure we honour any errors in searching, not just errors in the supplied 'done' callback. Andrew Bartlett (This used to be commit deaac92f439ef001bfe052df170d6e34e8ba5845)
2007-12-21r25690: - only use a readonly traverse in ldb_search when not in a ↵Andrew Tridgell1-3/+13
transaction. When we are in a transaction then we could be in a top level modify operation (such as rename), so we must use a writeable traverse so that the async callbacks can do the modifies while the search is progressing. - don't do the lockall operation on the tdb during a ldb search if in a transaction, as this would prevent modifies by callbacks as well (This used to be commit aa9ab431e071882f42ebc882e809ae1d4b8778d4)
2007-10-10r25000: Fix some more C++ compatibility warnings.Jelmer Vernooij1-3/+3
(This used to be commit 08bb1ef643ab906f1645cf6f32763dc73b1884e4)
2007-10-10r23798: updated old Temple Place FSF addresses to new URLAndrew Tridgell1-2/+1
(This used to be commit 40c0919aaa9c1b14bbaebb95ecce53eb0380fdbb)
2007-10-10r23795: more v2->v3 conversionAndrew Tridgell1-1/+1
(This used to be commit 84b468b2f8f2dffda89593f816e8bc6a8b6d42ac)
2007-10-10r22681: Fix standalone ldb build when parent directory name != ldb.Jelmer Vernooij1-3/+2
(This used to be commit 1093875d59f1ea9b8bd82277d4f9d8366e584952)
2007-10-10r22471: Convert more code to use proper LDB error codes.Simo Sorce1-7/+8
This is a 1 to 1 convertion, next step is to make this code report an error if the basedn is not used, hopefully avoiding an explicit search on the base object in the most common cases. (This used to be commit 50534c84b4577b2d32565a74a4716088f706bfea)
2007-10-10r20184: change ldb_attrib_handler into ldb_schema_attribute, which has a pointerStefan Metzmacher1-3/+3
to a ldb_schema_syntax struct. the default attribute handler is now registered dynamicly as "*" attribute, instead of having its own code path. ldb_schema_attribute's can be added to the ldb_schema given a ldb_schema_syntax struct or the syntax name we may also need to introduce a ldb_schema_matching_rule, and add a pointer to a default ldb_schema_matching_rule in the ldb_schema_syntax. metze (This used to be commit b97b8f5dcbce006f005e53ca79df3330e62f117b)
2007-10-10r19832: better prototypes for the linearization functions:Simo Sorce1-1/+1
- ldb_dn_get_linearized returns a const string - ldb_dn_alloc_linearized allocs astring with the linearized dn (This used to be commit 3929c086d5d0b3f08b1c4f2f3f9602c3f4a9a4bd)
2007-10-10r19831: Big ldb_dn optimization and interfaces enhancement patchSimo Sorce1-3/+3
This patch changes a lot of the code in ldb_dn.c, and also removes and add a number of manipulation functions around. The aim is to avoid validating a dn if not necessary as the validation code is necessarily slow. This is mainly to speed up internal operations where input is not user generated and so we can assume the DNs need no validation. The code is designed to keep the data as a string if possible. The code is not yet 100% perfect, but pass all the tests so far. A memleak is certainly present, I'll work on that next. Simo. (This used to be commit a580c871d3784602a9cce32d33419e63c8236e63)
2007-10-10r19531: Make struct ldb_dn opaque and local to ldb_dn.cSimo Sorce1-1/+1
(This used to be commit 889fb983ba1cf8a11424a8b3dc3a5ef76e780082)
2007-10-10r19402: - use the new tdb_lockall_read() to make ldb_search() more efficient,Andrew Tridgell1-19/+2
by avoiding chain locks on each tdb_fetch() within the search - use the tdb_get_seqnum() call to avoid re-reading the @BASEINFO record when it hasn't changed. These speed up the LOCAL-DBSPEED test for ldb from 7k ops/sec to a bit over 11k ops/sec (This used to be commit 1347ad254eb8cd12ce22a5a2a37bec0a0ac8dbf1)
2007-10-10r19314: Commit tridge's fixes for a big mem leak in ltdb I introducedSimo Sorce1-2/+1
when the code has been changed to be async. With the other committed fixes now this works. (This used to be commit 49fc640b5c0398516ac3a9e3f7c55205cd60b1de)
2007-10-10r18439: 2nd try at a talloc_move() api. This type with the ** ptr interfaceAndrew Tridgell1-1/+1
exposed. Unfortunately this generates a large number of type punning warnings. We'll have to find some magic to hide those. (This used to be commit 254cbf09dee5a1e20c47e47a298f1a8d172b41b9)
2007-10-10r18436: converted ldb to use talloc_move() instead of talloc_steal() whenAndrew Tridgell1-1/+1
appropriate. Note that I also removed the error checks that were being done on the result of talloc_steal(). They are pointless as talloc_steal() doesn't have any failure modes that wouldn't cause a segv anyway, and they tend to clutter the code (This used to be commit c0d9e7d473b8e3eb2524a9fc29cf88680f994b36)
2007-10-10r17514: Simplify the way to set ldb errors and add anotherSimo Sorce1-1/+1
helper function to set them. (This used to be commit 260868bae56194fcb98d55afc22fc66d96a303df)
2007-10-10r17370: Fix tdb searches, we need to return an LDAP_REPLY_DONE packet when done.Simo Sorce1-0/+15
Awesome how this didn't break everything around... (This used to be commit 1b3b6176592314e91af9ed911e8a244519dea9aa)
2007-10-10r17186: "async" word abuse clean-up part 2Simo Sorce1-7/+7
(This used to be commit c6aa60c7e69abf1f83efc150b1c3ed02751c45fc)
2007-10-10r17185: Oh, I wanted to do this for sooo long time.Simo Sorce1-8/+8
Finally acknowledge that ldb is inherently async and does not have a dual personality anymore Rename all ldb_async_XXX functions to ldb_XXX except for ldb_async_result, it is now ldb_reply to reflect the real function of this structure. Simo. (This used to be commit 25fc7354049d62efeba17681ef1cdd326bc3f2ef)
2007-10-10r15942: Remove the sync internal ldb calls altogether.Simo Sorce1-90/+5
This means that some modules have been disabled as well as they have not been ported to the async interface One of them is the ugly objectclass module. I hope that the change in samldb module will make the MMC happy without the need of this crappy module, we need proper handling in a decent schema module. proxy and ldb_map have also been disabled ldb_sqlite3 need to be ported as well (currenlty just broken). (This used to be commit 51083de795bdcbf649de926e86969adc20239b6d)
2007-10-10r15927: Optimize ldb module traverse while keeping the API intact.Simo Sorce1-26/+33
I was sick of jumping inot each module for each request, even the ones not handle by that module. (This used to be commit 7d65105e885a28584e8555453b90232c43a92bf7)
2007-10-10r15913: Error passing in the async code is not in agood shapeSimo Sorce1-9/+5
Start enhancing it and fix some problems with incorrect evalutaion of the codes Implement rdn rename (async only) (This used to be commit 6af1d738b9668d4f0eb6194ac0f84af9e73f8c2e)
2007-10-10r13996: simplify ldb_async_wait() some moreSimo Sorce1-1/+1
(This used to be commit ef1b3e6368179fe86ae07b8d00e4668090175551)
2007-10-10r13827: Minor enhancements or cosmetic changesSimo Sorce1-7/+9
(This used to be commit 7ef63abae12f65835a82f9931ad1f5ea75e5f3f6)
2007-10-10r13823: make async_wait part of the modules opsSimo Sorce1-1/+1
(This used to be commit b4202cf030d5f154f0f94f5f501ecd648ba5c48f)
2007-10-10r13818: Make ldb_tdb 'fake' async.Simo Sorce1-93/+208
Simo. (This used to be commit 0db616ef59ed51cac7e0bfaea8a799d5aa42ef16)
2007-10-10r13609: Get in the initial work on making ldb asyncSimo Sorce1-0/+1
Currently only ldb_ildap is async, the plan is to first make all backend support the async calls, and then remove the sync functions from backends and keep the only in the API. Modules will need to be transformed along the way. Simo (This used to be commit 1e2c13b2d52de7c534493dd79a2c0596a3e8c1f5)
2007-10-10r13289: Check the tree is not NULLSimo Sorce1-0/+4
Thanks to Aaron J. Seigo <aseigo@kde.org> for spotting this (This used to be commit 4b5c0493e2276a9eba1bada7c4bac99999a465e2)
2007-10-10r13258: Fix the talloc heirachy for ldb_tdb.Andrew Bartlett1-15/+15
In the return value res->msgs, msgs was not a child of res, in the indexed path. Instead, it hung directly off the ldb, which was sometimes a long-term context. Also remove unused parameters. Found by --leak-report-full Andrew Bartlett (This used to be commit 29cb5af827c459758997c80dca034d471bb92449)
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-10r12733: Merge ldap/ldb controls into main treeSimo Sorce1-0/+1
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-10r11567: Ldb API change patch.Simo Sorce1-10/+19
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-10r10913: This patch isn't as big as it looks ...Andrew Tridgell1-10/+6
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-10r10892: - improved the handling of the special distinguishedName attributeAndrew Tridgell1-85/+43
- ensure we don't add attributes twice, should a user ask for the attribute twice. Do this in such a way that we don't become O(n^2) - removed some unused code (This used to be commit 7684cdb47b4ae516f066afb249d5f88032152ec9)
2007-10-10r10889: make searches for dn's less of a special case, and much faster whenAndrew Tridgell1-15/+0
part of more complex expressions (This used to be commit 40d304140b4cf22559d6b55c8cbaf1b984baf62f)
2007-10-10r10753: don't require every ldb module to implement both a search_bytree() andAndrew Tridgell1-34/+1
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-10r10667: cope with a NULL tree for base searches in ldb_search()Andrew Tridgell1-11/+11
(This used to be commit 26ff53857802ae4a63f2b6e46c9caa7ca2fbbe89)
2007-10-10r10422: ldb_search() can now use tdb_traverse_read() to ensure it can run inAndrew Tridgell1-1/+1
parallel with any transaction (This used to be commit ddff66298f1a668c5220e24fc47f98d7dfc3068a)
2007-10-10r10408: now that we are using tdb transactions we don't need any additionalAndrew Tridgell1-0/+36
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-10r10305: start implementing better error handlingSimo Sorce1-8/+4
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-10r10251: some more work on ldb_sqlite3Simo Sorce1-0/+6
I must say that writing a new module is a very good way to find lot of subtle bugs laying in the code We need more tests! commit oLschema2ldif.c to keep it safe from data losses (rm -fr :-) update test generic to reflect the fix made on comparsion functions (This used to be commit 4357a2db5eadb15519ed93b957b2bad25ebf2a7d)