summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/modules/ldb_map.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r19832: better prototypes for the linearization functions:Simo Sorce1-5/+5
- 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-18/+76
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-10r19731: Modify the ldb_map infrustructure to always map from requestedAndrew Bartlett1-9/+12
attributes to backend (remote) attributes. We can't do a reverse mapping safely where the remote attribute may be a source for multiple local attributes. (We end up with the wrong attributes returned). In doing this, I've modified the samba3sam.js test to be more realistic, and fixed some failures in the handling of primaryGroupID. I've added a new (private) helper function ldb_msg_remove_element() to avoid a double lookup of the element name. I've also re-formatted many of the function headers, to fit into standard editor widths. Andrew Bartlett (This used to be commit 186766e3095e71ba716c69e681592e217a3bc420)
2007-10-10r19531: Make struct ldb_dn opaque and local to ldb_dn.cSimo Sorce1-72/+44
(This used to be commit 889fb983ba1cf8a11424a8b3dc3a5ef76e780082)
2007-10-10r19507: Merge my DSO fixes branch. Building Samba's libraries as shared ↵Jelmer Vernooij1-2/+2
libraries works again now, by specifying --enable-dso to configure. (This used to be commit 7a01235067a4800b07b8919a6a475954bfb0b04c)
2007-10-10r19489: Change ldb_msg_add_value and ldb_msg_add_empty to take a foruth ↵Simo Sorce1-1/+1
argument. This is a pointer to an element pointer. If it is not null it will be filled with the pointer of the manipulated element. Will avoid double searches on the elements list in some cases. (This used to be commit 0fa5d4bc225b83e9f63ac6d75bffc4c08eb6b620)
2007-10-10r19299: Fix possible memleaksSimo Sorce1-0/+2
(This used to be commit 6fad80bb09113a60689061a2de67711c9924708b)
2007-10-10r18495: More work on the LDAP backend (which now passes a lot of our tests!)Andrew Bartlett1-3/+35
This adds a list of attributes that are in our wildcard seaches, but the remote server requires to be explicitly listed. This also cleans up the handling of wildcards in ldb_map to be more consistant. Also fix the partitions module to rebase the search, if on the GC port, we do a subtree search. (Otherwise backends can rightly complain that the search is not in their scope). Andrew Bartlett (This used to be commit bc58792b7102f086b19353635d5d5ef9d40a0aae)
2007-10-10r17698: The original code assumed that &data->context was a valid tallocAndrew Bartlett1-12/+20
pointer. This only works when this is the only structure member, but when I added a new context pointer, it failed. Andrew Bartlett (This used to be commit 5bcfa12cef0d9eba5d5d1f65f676e7852297667f)
2007-10-10r17596: apply patch from MartinSimo Sorce1-4/+4
(This used to be commit e9d101bc3c1e7c1e8b6560a1f7161e6eb270c7df)
2007-10-10r17542: In using ldb_map, I ran across some very odd behaviours when we searchAndrew Bartlett1-0/+21
for objectClass=xyz. The code has been warning at me 'no covert_operator set', and indeed this is the case. (It then proceeds to strip this as a search expression) In this commit, I have implemented a convert_operator for objectClass, by pretending it is a simple MAP_CONVERT operator for the search requests. I also have changed the logic for when we should bail out. I can only see reason to bail out on the search if we have both local and remote trees. How can a remote-only search be un-splittable? Andrew Bartlett (This used to be commit 656e58672c357121647a080400fcab4e5d30b46b)
2007-10-10r17525: This is a merge from the Google Summer of Code 2006 project by ↵Andrew Bartlett1-1201/+1009
Martin Kühl <mkhl@samba.org>. Martin took over the work done last year by Jelmer, in last year's SoC. This was a substanital task, as the the ldb modules API changed significantly during the past year, with the addition of async calls. This changeset reimplements and enables the ldb_map ldb module and adapts the example module and test case, both named samba3sam, to the implementation. The ldb_map module supports splitting an ldb database into two parts (called the "local" and "remote" part) and storing the data in one of them (the remote database) in a different format while the other acts as a fallback. This allows ldb to e.g. store to and load data from a remote LDAP server and present it according to the Samba4 schema while still allowing the LDAP to present and modify its data separately. A complex example of this is the samba3sam module (by Jelmer Vernooij), which maps data between the samba3 and samba4 schemas. A simpler example is given by the entryUUID module (by Andrew Bartlett), which handles some of the differences between AD and OpenLDAP in operational attributes. It principally maps objectGUID, to and from entryUUID elements. This is also an example of a module that doesn't use the local backend as fallback storage. This merge also splits the ldb_map.c file into smaller, more manageable parts. (This used to be commit af2bece4d343a9f787b2e3628848b266cec2b9f0)
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-10r16090: Fix standalone build after the rename of enum ldb_request_type inTim Potter1-9/+9
r15944. Hey idra I think a better rename would be to keep the LDB_REQ suffix here to remain consistent with the other enums (e.g ldb_reply_type, ldb_async_wait_type and ldb_async_state). (This used to be commit d44ee8c43bd8f6f978330a8ded8bf30ffad494d6)
2007-10-10r14436: mixing of boolean expressions and integers isn't allowedAndrew Tridgell1-3/+3
(This used to be commit 6f7d09262d2e92df137167da55f5a22f32490781)
2007-10-10r13615: Make ldb_set_errstring get ldb instead of module as parameter.Simo Sorce1-1/+1
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-10r11958: - fixed memory leaks in the ldb_result handling in ldb operationsAndrew Tridgell1-20/+26
- 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-65/+133
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-18/+19
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-10r10759: make modules easier to write by allowing modules to only implement theAndrew Tridgell1-19/+1
functions they care about, instead of all functions. This also makes it more likely that future changes to ldb will not break existing modules (This used to be commit 45f0c967b58e7c1b2e900a4d74cfde2a2c527dfa)
2007-10-10r10753: don't require every ldb module to implement both a search_bytree() andAndrew Tridgell1-29/+8
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-3/+9
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-10r10305: start implementing better error handlingSimo Sorce1-23/+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-10r10299: remove the public (un)lock functions and introduce a transaction basedSimo Sorce1-14/+14
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-10r9948: Be a bit less verboseJelmer Vernooij1-1/+1
(This used to be commit 071dba2d0ae964e9901adf0c4870894deed43650)
2007-10-10r9915: Some more mappings. Fix weird sAMAccountName values.Jelmer Vernooij1-4/+32
(This used to be commit 8ff1358f401e0086b941f4ff73af5d4c38a1f8bf)
2007-10-10r9912: Fix another bug in ldb_map.Jelmer Vernooij1-72/+93
(This used to be commit 4c3b37d660e798764e35a31221f4939ab6f36948)
2007-10-10r9908: Generate posixUser and posixGroup as wellJelmer Vernooij1-55/+61
(This used to be commit ebed25b47d3d8bd350b51b462d605d713f17602d)
2007-10-10r9899: Be more conservative about what is sent to the remote server in ldb_map.Jelmer Vernooij1-166/+341
(This used to be commit 76e943d4416e38ce4cce27d5403bc3e133d0025b)
2007-10-10r9881: I can't believe this can make a difference...Tim Potter1-2/+2
(This used to be commit 31069bfd18c4b7355dbf85df9fb479705b0e3b4b)
2007-10-10r9880: Convert remaining initialisers to more portable form. This shouldTim Potter1-6/+10
clean out a lot of build farm breakage. (This used to be commit c34fbdc6c3fd2c066c713bdd84e6f40f6aa8cd43)
2007-10-10r9879: A quick check to see if nested initialisers (?) is portable across theTim Potter1-1/+5
build farm. I have a feeling it isn't. (This used to be commit 7cc8df0c2f46fb9ce753e368ce645bcb69585334)
2007-10-10r9857: Fix rename/delete issuesJelmer Vernooij1-11/+24
(This used to be commit d6dce7ef3eb21a5e90244cf2ce7403ab43b12d63)
2007-10-10r9854: Finish ldb_map testsuiteJelmer Vernooij1-13/+12
Update PLAN Some more small other fixes (This used to be commit de2bde2526ffaf521253e3b9e58fc11417986321)
2007-10-10r9842: More error checks in the ldb_map modules, extend testsuiteJelmer Vernooij1-44/+99
(This used to be commit b7992de4b7d42a55e00509c887a269a07c19627d)
2007-10-10r9835: Make ldb_map compile in the stand-alone LDB buildJelmer Vernooij1-39/+42
(This used to be commit 2283a336e0e31e6857621d9806bba54c400bd986)
2007-10-10r9789: Patch from Volker that fixes the build on AIX.Jelmer Vernooij1-21/+32
(This used to be commit 9a1a7fb60e6531ff74e6817313548f3cee37a990)
2007-10-10r9786: Move ldb_map into ldb/modules/Jelmer Vernooij1-0/+1151
Move samba3sam to dsdb/ (This used to be commit eb9d615bcd49328131613f64745760a90553b7f2)