1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-05 21:57:51 +03:00

122 Commits

Author SHA1 Message Date
Andrew Tridgell
d48237d547 s4-drs: re-resolve the DN in linked attribute processing
w2k8-r2 sometimes sends the DN with an old target
2010-01-02 08:16:54 +11:00
Andrew Tridgell
5dd6e089f1 s4-drs: use dsdb_module_rename()
Use the new dsdb_module_rename() for DRS rename handling, instead of
ldb_rename(). This stops us going to the top of the module stack on a
rename.
2010-01-02 08:16:54 +11:00
Andrew Tridgell
38160deac4 s4-drs: use dsdb linked attribute parse functions
This makes the code considerably more readable
2010-01-02 08:16:54 +11:00
Andrew Tridgell
db3f0e8ec1 s4-dsdb: fixed valgrind error in replmd modify
We are using the values from a search result, so we need to steal them
onto the msg before we free the search results

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:54 +11:00
Andrew Tridgell
9f053d43de s4-drs: don't try to remove backlinks directly
backlinks need to be removed as a side effect of removing the forward
link

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:53 +11:00
Andrew Tridgell
0bf7f95273 s4-drs: isRecycled only exists in FL W2K8-R2
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:53 +11:00
Andrew Tridgell
530503290d s4-drs: use DSDB_FLAG_OWN_MODULE
We need DRS driven replication changes to update replPropertyMetaData,
so it needs to call into the repl_meta_data module logic

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:53 +11:00
Andrew Tridgell
9572535940 s4-drs: update comment to refect only forward link in this fn
This function only update forward links

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:53 +11:00
Andrew Tridgell
5b31cb20dd s4-drs: fixed typo for uSNCreated
This broke DRS replication from samba to windows

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:53 +11:00
Andrew Tridgell
7a39340c8e s4-drs: use dsdb_module_guid_by_dn()
We should not be going to the top of the module stack
2010-01-02 08:16:53 +11:00
Andrew Tridgell
e3054ce0fe s4-drs: cope better with NULL GUIDS from DRS
It is valid to get a NULL GUID over DRS for a deleted forward link. We
need to match by DN if possible when seeing if we should update an
existing link.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:53 +11:00
Andrew Tridgell
2e114484e5 s4-drs: give an error message in repl_meta_data if we don't get a partition control 2010-01-02 08:16:53 +11:00
Andrew Tridgell
0d5d7f5847 s4-drs: treat a zero GUID as not present in replmd_add_fix_la
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:53 +11:00
Andrew Tridgell
dd33a22f1d s4-dsdb: use a common method for finding a link pair
Use ^1 everywhere, to ensure it works for both forward and backward
links
2010-01-02 08:16:51 +11:00
Andrew Tridgell
bf8ccd21f1 s4-dsdb: fill in the correct version number of links that come over DRS 2010-01-02 08:16:51 +11:00
Andrew Tridgell
5dcb903f26 s4-dsdb: move checking for single valued links to samba modules
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-02 08:16:51 +11:00
Andrew Tridgell
26ec526d02 s4-dsdb: auto-upgrade w2k formatted linked attributes when modified
When any value of a w2k formatted linked attribute is modified,
upgrade the links.
2010-01-02 08:16:50 +11:00
Andrew Tridgell
809bcfca3d s4-dsdb: minor cleanup in DRS replicated objects code 2010-01-02 08:16:50 +11:00
Andrew Tridgell
4dbcab45f2 s4-dsdb: store full meta data from DRS for linked attributes
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:50 +11:00
Andrew Tridgell
f1b6484232 s4-dsdb: split RMD_USN into RMD_LOCAL_USN and RMD_ORIGINATING_USN
We need a separate RMD_LOCAL_USN to allow us to tell what attributes
need to be sent in a getncchanges request. Thanks to Metze for
pointing this out.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:50 +11:00
Andrew Tridgell
e4a6f5c8b8 s4-dsdb: handle links with no backlinks in replmd_delete 2010-01-02 08:16:50 +11:00
Andrew Tridgell
e9699e9cb9 s4-dsdb: do the rename after the modify in replmd_delete
This makes updating the links a bit easier
2010-01-02 08:16:49 +11:00
Andrew Tridgell
2b5cd3dba2 s4-dsdb: some backlinks can be processed immediately
backlinks in add and delete operations can be processed immediately,
rather than at the end of a transaction. This can save on backlink
list processing time.
2010-01-02 08:16:49 +11:00
Andrew Tridgell
9e96ae8ddc s4-dsdb: add linked attributes meta_data handling to replmd_add
This also handles the backlink creation that was previously in the
linked_attributes module

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:49 +11:00
Andrew Tridgell
348bcfc8ff s4-dsdb: added replmd_delete, based on Eduardos work
This implements repmld_delete(), which handles the meta_data updates
for an object when deleting. A delete gets mapped to a combination
of a rename followed by a modify request, which has the effect of
moving the object into the Deleted Objects container.

This is based on the code from Eduardo Lima
<eduardoll@gmail.com>. Eduardo's code was modified to take account of
the linked attributes changes that Andrew and I have been working on.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:49 +11:00
Andrew Tridgell
3199e02884 s4-dsdb: add a comment on the use of ldb_rename()
We need to use ldb_rename() and not dsdb_module_rename() here as we
need the rename to be processed by the current module
2010-01-02 08:16:48 +11:00
Andrew Tridgell
3b056061ff s4-dsdb: added support for backlinks in repl_meta_data
backlinks need more careful handling now that we store the additional
meta data for deleted links. It is easier to handle this in
repl_meta_data than in linked_attributes.

Eventually linked_attributes will disappear, with the functionality
moved into repl_meta_data.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:48 +11:00
Andrew Tridgell
dee6b6fb3d s4-dsdb: implemeneted replmd_modify_la_replace()
We now have the core code for handling storage of linked attribute
meta-data with local modifies

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:48 +11:00
Andrew Tridgell
41c3c979ff s4-dsdb: add support for storing linked attribute meta data in extended DNs
When in functional levels above w2k, we need to store much richer meta
data about linkked attributes. We also need to keep deleted linked
attributes around to allow the deletion to be propogated to other DCs.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:48 +11:00
Andrew Tridgell
d3708109a1 s4-drs: another two unsigned comparison bugs 2009-12-21 23:41:07 +11:00
Andrew Tridgell
8d3fc23157 s4-dsdb: also mark the relax control non-critical when done 2009-12-16 20:56:24 +11:00
Andrew Tridgell
33976711e3 s4-dsdb: use dsdb_module_search_dn in repl_meta_data
This allows us to search below the current module. That
will be important when we start using the results of this
search to get the linked attributes meta data right
2009-12-09 18:18:25 +11:00
Andrew Tridgell
b65b88740c s4-drs: fixed updating of uSNChanged in replmd_modify
Updating of uSNChanged broke in a recent change
2009-12-03 10:27:59 +11:00
Fernando J V da Silva
71e29cbf56 s4-drs: Using dsdb_msg_add_guid() utility function
Uses the dsdb_msg_add_guid() to add any kind of GUID attribute
to a ldb_message in several places of samba4 code.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-30 21:17:27 +11:00
Andrew Tridgell
dda28a9a78 s4-dsdb: make sure mod_usn list is zeroed on each transaction 2009-11-20 12:23:55 +11:00
Andrew Bartlett
bbe4a9cf0f s4:repl_meta_data Parse linked attributes with schema syntaxes
The bug here was that by assuming all linked attributes were 'normal
DNs', we would miss the binary portion of DN+Binary.

This patch then has us reparse the string to determine it's GUID, for
the GUID lookup, but maintains the binary porition into the on-disk
format.

Andrew Bartlett
2009-11-12 16:34:44 +11:00
Andrew Bartlett
398188fb9b s4:dsdb Remove potentially confusing 'partition' control from result
This ensures that the partition control, needed here for repl_meta_data's
internal work, is not pushed up to other callers.

Andrew Bartlett
2009-10-21 22:43:56 +11:00
Andrew Bartlett
da7c778741 s4:dsdb Remove default instanceType from repl_meta_data
This is no longer required, as the instancetype module is now above
repl_meta_data.

Andrew Bartlett
2009-10-21 22:43:54 +11:00
Andrew Bartlett
96c9bc18d5 s4:dsdb Use 'partition modified' information to update @REPLCHANGED
This major rework of repl_meta_data changes it from using a static
list of partitions to a dynamic list created from the controls placed
on returned ldb results.

To process these in one place, the similar but distinct callbacks are
combined into a single replmd_op_callback(), which handles both the
'normal operation' and 'inbound replication' case.

This allows new partitions to be created, and replication events for
these new partitions to be scheduled immediately.

Also in this commit: We no longer specify the target partition for new
or modified objects - instead we allow the partitions module to use
the DN as normal.  THis avoids the issue where we would create two
partition head records.

Andrew Bartlett
2009-10-21 22:43:54 +11:00
Andrew Bartlett
d3a5037f2a s4:repl Pass schema as argument to replmd_update_rpmd() 2009-10-21 22:43:53 +11:00
Andrew Bartlett
8ea2a8b785 s4:dsdb Set 'notification' after the success of a change.
This allows the partition to be created before we try and set a
notification on it.  (perhaps extra work required here for partition
heads).

Andrew Bartlett
2009-10-21 22:43:50 +11:00
Matthias Dieter Wallnöfer
90828cc702 s4:dsdb Don't allow creation of systemOnly objectclasses
(except as part of the provision, which specifies the 'relax' control)

Andrew Bartlett
2009-10-03 10:52:53 +02:00
Matthias Dieter Wallnöfer
2ab27d78b0 s4:repl_meta_data - various
- Add more "talloc_free"s and right error values where needed
- Add a pre-lookup for entries before searching for metadata attribute
  (also suggested by TODO list)
- Now the most part of "ldap.py" works again
2009-10-02 23:28:52 +02:00
Andrew Bartlett
ab9c232066 s4:dsdb Pass down the exact error code on failure in repl_meta_data 2009-10-02 17:49:46 +02:00
Matthieu Patou
8d7a987766 s4-ldb: Use relax control to check in replace metadata module if we accept request that specify objectGUID attribute. 2009-10-02 12:45:00 +02:00
Andrew Tridgell
cf55f78c29 s4-dsdb: update replPropertyMetaData on linked attribute source attributes 2009-09-28 10:25:17 +10:00
Andrew Tridgell
c82a816f4b s4-repl: free the la list on prepare commit failure 2009-09-28 10:24:04 +10:00
Andrew Tridgell
a130ad27c4 s4-repl: use GUID to resolve target in linked attributes
When we vampire from w2k8-r2, the DC sends us a linked attribute for
our machine account which has a target DN with a GUID of the OU=Domain
Controllers objects, but has a DN of CN=Computers. We need to use the
GUID to resolve the real DN.
2009-09-28 10:23:47 +10:00
Andrew Tridgell
557b177b04 s4-drs: fixed sorting of replPropertyMetaData
This also ensures we add the SHOW_DELETED control on searches for old
replPropertyMetaData attributes
2009-09-28 10:16:19 +10:00
Andrew Tridgell
547a6da58e s4-drs: add defines for replication flags on attributes 2009-09-24 10:37:24 -07:00