summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_search.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-05ldb: make ldb a top level library for Samba 4.0Andrew Bartlett1-618/+0
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-20tdb_traverse/tdb_traverse_read: check returns for negative, not -1.Rusty Russell1-1/+1
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>
2011-06-20tdb_fetch_compat: use instead of tdb_fetch.Rusty Russell1-2/+3
This is a noop for tdb1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-11-26ldb-tdb: Add more information about full scanMatthieu Patou1-1/+7
2010-11-23s4-ldb: added an environment varibale LDB_WARN_UNINDEXEDAndrew Tridgell1-7/+7
when LDB_WARN_UNINDEXED is set, we produce warnings about unindexed searches. This makes it easier to find performance problems caused by unindexed searches.
2010-11-05s4-ldb: much more memory efficient msg filteringAndrew Tridgell1-3/+20
this ensures we don't leave unnecessary attributes in returned ldb objects Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-13s4-ldb: take advantage of ldb_match_msg_error() in more placesAndrew Tridgell1-2/+8
this gives better error checking
2010-08-17s4-ldb: ensure element flags are zero in ldb search returnAndrew Tridgell1-0/+2
the distinguishedName element was getting an uninitialised flags value
2010-06-06ldb:ltdb_filter_attrs - fix a counter variable typeMatthias Dieter Wallnöfer1-2/+3
2010-03-08LDB:TDB backend - change counter variables to "unsigned" where appropriateMatthias Dieter Wallnöfer1-2/+3
2009-12-09s4-ldb: added a missing ltdb_unlock_read()Andrew Tridgell1-0/+1
2009-09-15s4-ldb: cope better with corruption of tdb recordsAndrew Tridgell1-1/+17
When doing an indexed search if we hit a corrupt record we abandoned the indexed search and did a full search. The problem was that we might have sent some records to the caller already, which means the caller ended up with duplicate records. Fix this by returning a search error if indexing returns an error and we have given any records to the caller.
2009-05-28a useful debugging toolAndrew Tridgell1-0/+7
When looking at performance problems with ldb it can be useful to see which searches causes unindexed full searches. This makes it easy to enable that.
2009-03-09Fix potential segfaults using freed memory.Simo Sorce1-3/+3
In some code paths ltdb_context was still referenced even after we were returned an error by one of the callbacks. Because the interface assumes that once an error is returned the ldb_request may be freed, and because the ltdb_context was allocated as a child of the request, this might cause access to freed memory. Allocate the ltdb_context on ldb, and keep track of what's going on with the request by adding a spy children on it. This way even if the request is freed before the ltdb_callback is called, we will safely free the ctx and just quietly return.
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)