summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/linked_attributes.c
AgeCommit message (Collapse)AuthorFilesLines
2010-03-16s4:dsdb - fix up warningsMatthias Dieter Wallnöfer1-1/+1
2010-03-16s4:dsdb Change dsdb_get_schema() callers to use new talloc argumentAndrew Bartlett1-1/+8
This choses an appropriate talloc context to attach the schema too, long enough lived to ensure it does not go away before the operation compleates. Andrew Bartlett
2010-03-07s4:linked_attributes LDB module - change counter variables to "unsigned" ↵Matthias Dieter Wallnöfer1-3/+5
where appropriate
2010-01-02s4-dsdb: move checking for single valued links to samba modulesAndrew Tridgell1-1/+7
This uses the RELAX control and checking of single valued attributes in ldb modules to avoid problems with multi-valued links where all values but one are deleted
2010-01-02s4-dsdb: add REVEAL_INTERNALS in the search for linked_attributesAndrew Tridgell1-1/+2
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02s4-dsdb: simplify the linked_attributes moduleAndrew Tridgell1-853/+96
The linked_attributes module only has to deal with renames now, as other linked attribute updates happen in repl_meta_data. This allows it to be much simpler. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02s4-dsdb: remove linked_attributes_addAndrew Tridgell1-86/+0
This is now handled in the repl_meta_data module
2010-01-02s4-dsdb: the linked_attributes module no longer handles deletesAndrew Tridgell1-53/+0
delete handling is now moved into repl_meta_data Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02s4-dsdb: linked_attributes_modify no longer handles modifiesAndrew Tridgell1-183/+0
This functionality has moved into repl_meta_data
2009-12-10s4-dsdb: simplify linked attributes code using GUID functionsAndrew Tridgell1-18/+16
2009-11-27s4:dsdb Don't segfault with ldb_transaction_prepare_commit() without begin()Andrew Bartlett1-0/+4
It is up to other modules to complain if ldb_transaction_prepare_commit() is called before ldb_transaction_begin_transaction() Andrew Bartlett
2009-09-28s4-dsdb: removed extraneous debug messagesAndrew Tridgell1-4/+0
2009-09-28s4-samdb: free the linked_attributes list on prepare commit failureAndrew Tridgell1-0/+6
2009-09-06s4:"linked attributes" modules - correct the commentsMatthias Dieter Wallnöfer1-2/+2
2009-09-03another large change to the linked_attribute moduleAndrew Tridgell1-20/+64
This one copes with deleted objects where linked attributes have been set on the module. We hit this when we do the ldb wipe at the start of a provision, which trigers linked attribute updates, but for objects that have disappeared. We need to ensure that the linked attribute updates only happen on the right object, and if the object gets re-created (as happens with a provision) then it is not the right object. To cope with this we record the GUID of the object when the operation that triggered the linked attribute update comes in, and then find the DN by suing that GUID when we apply the change in the prepare commit hook.
2009-09-03fixed transaction handling in linked_attributes moduleAndrew Tridgell1-76/+4
We need to call down to the next transaction function when we finish in linked_attributes. This also changes linked_attributes to use the common dsdb_find_dn_by_guid() function
2009-09-02traverse the ac list in reverse orderAndrew Tridgell1-1/+6
items are added to the linked attribute list using DLIST_ADD(), which means to commit them to the database in the same order they came from the server we need to walk the list backwards when we traverse it
2009-09-02s4:dsdb rewrite the linked_atrributes code to commit in the end_transaction hookAndrew Tridgell1-107/+281
linked attribute changes can come in any order. This means it is possible for a forward link to come over the wire in DRS before the target even exists. To make this work this patch changed the linked attributes module to gather up all the changes it needs to make in a linked list, then execute the changes in the end_transaction hook for the module. During that commit phase we also fix up all the DNs that we got by searching for their GUID, as the objects may have moved after the linked attribute was sent, but before the end of the transaction
2009-09-02fixed spellingAndrew Tridgell1-1/+1
2009-07-19[SAMBA 4] Some cosmetic changes for the LDB modulesMatthias Dieter Wallnöfer1-6/+5
Some corrections which make the code a bit more readable (no functional changes here)
2009-02-23Fix headers, ldb_includes.h is a private header,Simo Sorce1-0/+1
do not reference it from ldb.h
2009-01-30Fix all other modules to use ldb_module.h instead of ldb_private.hSimo Sorce1-36/+66
The only 2 modules escaping the rule so far are rootdse and partitions
2008-12-17s4:dsdb: Make the linked_attributes module set an extended dnAndrew Bartlett1-192/+325
This means that linked attributes will always have the same case form as the actaul entry, as we search for that entry. We then also use the GUID and SID found on that entry to fill in the extended DN on disk. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-11-17Run the original operation before we update linked attrsAndrew Bartlett1-17/+24
This causes the linked attribute modifies to occour after the original operation is entered in the transaction (any failure still fails the lot). This means (I hope) that we can have another module search the originating record when the backlink is created, filling in the GUID and SID for the extended DN. Andrew Bartlett
2008-11-04Give a better error when ldb_dn_from_ldb_val failsAndrew Bartlett1-1/+3
2008-11-04Use ldb_dn_from_ldb_val to avoid possible over-run of the value.Andrew Bartlett1-8/+8
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-11-04Fix use of wrong union arm in linked_attributes moduleAndrew Bartlett1-1/+1
This bug occours frequenetly in ldb users because the union so happens to be layed out that this works. However, it is still incorrect usage... Andrew Bartlett
2008-10-23Clarify the linked attribute module behaviour with commentsAndrew Bartlett1-1/+9
2008-10-02s4:linked_attributes: fix a crash bug when the definition of a target ↵Stefan Metzmacher1-3/+35
attribute is missing Windows 2003 has a broken schema where the definition of msDS-IsDomainFor is missing (which is supposed to be the backlink of the msDS-HasDomainNCs attribute. Our schema is extracted from windows 2003, so we have the problem. As the NET-API-BECOME-DC test triggers this bug, windows 2003 seems to just skip creating a backlink. metze
2008-09-29LDB ASYNC: samba4 modulesSimo Sorce1-688/+627
2008-08-21Don't walk past the end of ldb values.Andrew Bartlett1-4/+4
This is a partial fix towards bugs due to us walking past the end of what we think are strings in ldb. There is much more work to do in this area. Andrew Bartlett (This used to be commit 5805a9a8f35fd90fa4f718f73534817fa3bbdfd2)
2008-03-29Fix more valgrind issues.Andrew Bartlett1-1/+29
This passes down the timeout more consistantly, and ensures that no matter how the modules screw up, we don't free() the memory we are going to write into the ASN1 packet until we actually write it out. Andrew Bartlett (This used to be commit eefd46289b90967ce6b4cd385fb1f7e1d6f9b343)
2008-02-20Fix use of some modules (needed _PUBLIC_).Jelmer Vernooij1-1/+1
(This used to be commit ce332130ea77159832da23bab760fa26921719e2)
2008-02-20Use struct-based rather than function-based initialization for ldb modules ↵Jelmer Vernooij1-6/+1
everywhere. (This used to be commit 85c96a325867f7bcdb412ebc53f8a47dbf7cd89b)
2008-01-16Rework linked_attributes module for the REPLACE case.Andrew Bartlett1-6/+86
This moves to a smarter 'find the delta' based operation of the linked attributes module, when the caller asks for a 'replace' of the link source. Previously we would spray operations all over the database, even if the net result was just to modify one record. This also means we need the transaction safety less, which may be useful for some LDAP backends that don't provide this functionality on the LDAP server. Andrew Bartlett (This used to be commit 8c88e4eb1c0a606e7899091525260e8d6558ffd0)
2007-12-21r26182: Extend our linked attribute testsuite to cover many more possibleAndrew Bartlett1-74/+218
modifications, and then extend our implementation to match. Andrew Bartlett (This used to be commit 65d17f0ad7ead438333abcccb0bd56b038ffb88e)
2007-12-21r25981: Don't create an ldb_request on NULL.Andrew Bartlett1-8/+11
A re-arrangment of the code due to the base DN checking meant that the ac->down_req array wasn't started, so was NULL Andrew Bartlett (This used to be commit 0a44b8e9f3e1a85c27d105cdd1572a0df936f612)
2007-12-21r25942: Make various ldb modules handle an LDB backend that enforces validityAndrew Bartlett1-30/+38
of Base DNs in searches (returning an error of LDB_ERR_NO_SUCH_ENTRY). We need to handle this if ldb_tdb is to behave correctly compared with LDAP, as well as if we are using an LDAP backend. In doing so, I realised that subtree_rename and subtree_delete (prevention) need rather different wait loops, so it seemed easier to split it out into it's own module. I've fixed the licence on both of these modules to be GPLv3. Andrew Bartlett (This used to be commit d3894c90f31fb45e038ab478cd9d7d34962d069b)
2007-12-21r25891: Test that we get the correct return value when we attempt to referenceAndrew Bartlett1-2/+2
invalid entries with a linked attribute. Make Samba4 pass that test, by fixing a silly bug in the linked_attributes module. (By passing down the 'original' request structure, tdb would override our handle, and therefore we would never be called for the 'wait', which collects the errors). Fix up the provision templates to handle the newly required referential integrity. Andrew Bartlett (This used to be commit 0377d85bbdcb2c4f110b0519005f0d1d10bc0c0b)
2007-12-21r25788: Use a single routine to handle the creation of modify requests in theAndrew Bartlett1-202/+132
linked_attributs code. This drasticly reduces the code duplication here. Andrew Bartlett (This used to be commit c66e188e6729a8e12854017d62067b4ae4a23af8)
2007-12-21r25781: Handle and test linked attribute renames.Andrew Bartlett1-7/+310
Andrew Bartlett (This used to be commit 56d9dd5140b6d7d7bbaa2f59ecdff7ee70c4faac)
2007-12-21r25763: Handle modifies, in the easy case (add/delete of elements), for theAndrew Bartlett1-1/+151
linked attributes. Andrew Bartlett (This used to be commit c6a6246fbde996ec7e85cb66f060cfe8b90044dd)
2007-12-21r25747: Implement linked attributes, for add operations.Andrew Bartlett1-0/+312
Much more work is still required here, particularly to handle this better during the provision, and to handle modifies and deletes, but this is a start. Andrew Bartlett (This used to be commit 2ba99d58e9fe1f8e4b15a58a2fdfce6e876f99b4)