summaryrefslogtreecommitdiff
path: root/source4/dsdb/repl
AgeCommit message (Collapse)AuthorFilesLines
2013-09-22dsdb: Refuse to replicate an all-zero invocationID GUID in replPropertyMetaDataAndrew Bartlett1-0/+9
This matches Windows 2008R2. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-07-24dsdb: Add assert in drepl_take_FSMO_roleAndrew Bartlett1-4/+3
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-06-12dsdb: Allow dsdb_find_dn_by_guid to show deleted DNsAndrew Bartlett1-1/+1
This helps us in the KCC as we need to return the deleted DN for the GUID in DsReplicaGetInfo calls (tested for deleted servers against Windows 2008R2). Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-06-11dsdb: use the correct talloc parent in dsdb_repl_merge_working_schema()Stefan Metzmacher1-2/+2
schema->{classes,attributes} are the DLIST pointer not an array. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-23dsdb-repl: merge the logic from libnet_vampire_cb_apply_schema()Stefan Metzmacher1-6/+113
This way libnet_vampire_cb_apply_schema() is able to use dsdb_repl_resolve_working_schema(). Pair-Programmed-With: Matthieu Patou <mat@matws.net> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-23dsdb-repl: split out dsdb_repl_resolve_working_schemaStefan Metzmacher1-53/+94
This can be reused later in other places. Pair-Programmed-With: Matthieu Patou <mat@matws.net> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-23dsdb-drs: when replicating schema object checks ask for removal of previous ↵Matthieu Patou1-3/+4
version if exists (bug #8680) Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-16dsdb-repl: Allow the name attribute (and name-based schema lookups) to be ↵Andrew Bartlett1-12/+19
skipped in dsdb_repl_make_working_schema() This allows us to use a schema that may only be valid for attributeID based lookups, during the schema load. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-05-15dsdb-drepl: create a new schedulable event for running pending operationsMatthieu Patou3-1/+79
So instead of running dreplsrv_periodic_schedule when receiving a DRS_REPLICA_SYNC request which will force the DC to look for changes with all the DC it usually replicate to, we reduce it to the DC specified in the DRS_REPLICA_SYNC request. It will allow also to do have the correct options as set by the client who send the DRS_REPLICA_SYNC. Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-08dsdb-repl: make message more clearerMatthieu Patou1-2/+2
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-08dsdb-repl: do not ask to add ref when doing getncchange for an exopMatthieu Patou1-0/+7
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-22drepl-notify: change misleading messageMatthieu Patou1-1/+1
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-17drs-fsmo: Improve handling of FSMO role takeover.Andrew Bartlett1-3/+2
This needs to be more async, and give less scary errors. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-01s4:dsdb/drepl: update the source_dsa_obj/invocation_id in repsFromStefan Metzmacher1-0/+4
The highwatermark is relative to the source_dsa_invocation_id. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-10-07s4-repl: make dreplsrv_partition_find_for_nc return BAD_NC onlyMatthieu Patou1-2/+7
2012-08-14s4:dsdb/repl: fix the usage of 'GC/' prefixed principal namesStefan Metzmacher1-21/+6
The "serverReference" attribute is available on the "server" object not on the "nTDSA" object. This allows connections to RODCs, as they don't have a E3514235-4B06-11D1-AB04-00C04FC2DCD2/${NTDSGUID}/${DNSDOMAIN} principal. Pair-Programmed-With: Björn Baumbach <bb@sernet.de> metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Aug 14 18:57:41 CEST 2012 on sn-devel-104
2012-08-14s4-dsdb: Use samdb_dn_is_our_ntdsa()Andrew Bartlett2-19/+24
This uses a GUID based comparison, and avoids re-fetching the samdb_ntds_settings_dn each time. Andrew Bartlett
2012-08-14s4:dsdb/repl: ldb_errstring() takes a 'struct ldb_context' not 'int'Stefan Metzmacher1-1/+2
metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Aug 14 13:58:31 CEST 2012 on sn-devel-104
2012-08-14s4:dsdb/repl: make sure instanceType_e is not changed by a reallocationStefan Metzmacher1-1/+11
Pair-Programmed-With: Björn Baumbach <bb@sernet.de> metze
2012-08-14s4:dsdb/repl: avoid reallocation of msg->elementsStefan Metzmacher1-1/+1
The index into the elements needs to match between msg->elements and md->ctr.ctr1.array, which means we should pre-allocate them with the same size. Pair-Programmed-With: Björn Baumbach <bb@sernet.de> metze
2012-08-14s4-dsdb: Add mem_ctx argument to samdb_ntds_settings_dnAndrew Bartlett3-4/+10
As this value is calculated new each time, we need to give it a context to live on. If the value is the forced value during provision, a reference is taken. This was responsible for the memory leak in the replication process. In the example I was given, this DN appeared in memory 13596 times! Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Aug 14 10:05:14 CEST 2012 on sn-devel-104
2012-08-11s4-dsdb: Take more care in handling of global schema memoryAndrew Bartlett1-27/+61
This reworks dsdb_replicated_objects_commit() to have a proper local tmp_ctx and to be more careful about what schema is set (only setting a global schema if the original schema was global). In particular, the new working_schema is not given a talloc reference to the old schema. This ensures that the old schema can go away when no longer used. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Aug 11 10:31:57 CEST 2012 on sn-devel-104
2012-08-03s4:dsdb:replicated_objects: do not move 'instanceType' to the end of ↵Stefan Metzmacher1-1/+22
msg->elements on RODC replication It's very important that the order of msg->elements and md->ctr.ctr1.array is the same. metze
2012-07-29s4-repl: Use ldb_dn_new() to create the rootDSE DNAndrew Bartlett1-1/+5
Based on a patch proposal by Matthieu Patou <mat@matws.net>. Andrew Bartlett
2012-07-29s4-repl: Use NULL for pointer test when checking for ldb_msg_new() failureAndrew Bartlett1-1/+1
2012-07-18s4-dsdb: Ensure we never write read-only objects onto a read-write replicaAndrew Bartlett1-1/+8
We should prevent this much further up the stack, but at least add a choke at this point for now. Additionally, this avoids administrator-forced replications causing considerable damange to the directory. Andrew Bartlett
2012-07-06s4-dsdb: Use parent_object_guid to find the correct parent for new objectsAndrew Bartlett1-0/+11
This allows the parent to be renmaed while a new object is added on another replica. This rename may also be a delete, in which case we must move it to lostandfound. Andrew Bartlett
2012-06-24s4-drepl: Ensure that the op->source does not get deallocated too earlyAndrew Bartlett2-9/+25
We need to have the struct dreplsrv_partition_source_dsa around until the end of the async op, so we use talloc_reference after carefully checking the callers and making the modifications required. This prevents a crash when replicating partitions in the vampire_dc test after adding DNS replication at join time. Andrew Bartlett
2012-06-22s4-drs: if schema has changed during replication notify other process that ↵Matthieu Patou1-0/+55
they have to reload the schema
2012-06-15lib/param: Create a seperate server role for "active directory domain ↵Andrew Bartlett1-1/+1
controller" This will allow us to detect from the smb.conf if this is a Samba4 AD DC which will allow smarter handling of (for example) accidentially starting smbd rather than samba. To cope with upgrades from existing Samba4 installs, 'domain controller' is a synonym of 'active directory domain controller' and new parameters 'classic primary domain controller' and 'classic backup domain controller' are added. Andrew Bartlett
2012-03-14s4-dsdb: Fix the case for attribute name msDS-hasMasterNCsAmitay Isaacs1-1/+1
Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Wed Mar 14 11:59:02 CET 2012 on sn-devel-104
2012-02-01Revert "s4-drs: do not try to contact for replication servers that are not ↵Andrew Tridgell1-38/+4
anymore in reps*" This reverts commit 5bfd6251eb22ff701184a95649822a73cf4d157b. This change has been causing regular segfaults in the build farm since it was applied. I also think it may be unnecessary as dreplsrv_refresh_partitions() should already be achieving the same thing (removing stale replication targets). I think the segfaults were caused by freeing an in-flight DSA, but I have been unable to reproduce it outside of the build farm Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Wed Feb 1 07:49:42 CET 2012 on sn-devel-104
2011-12-05s4-drs: do not try to contact for replication servers that are not anymore ↵Matthieu Patou1-6/+40
in reps* Servers connection can be removed from repsTo and respFrom either due to DC demote or topology change by the KCC, if a server is removed from the reps* it must be effectivly removed from the list of server that we will contact for getNcChanges and for replicaSync. Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Mon Dec 5 19:56:09 CET 2011 on sn-devel-104
2011-12-05s4-resolver: do not use all the A and AAAA records, those after a NS are not ↵Matthieu Patou1-1/+1
the one we want to use
2011-12-05s4-drs: mark WERR_DS_DRA_BUSY as a non error in DsReplicaUpdateRefsMatthieu Patou1-2/+22
2011-11-29s4-repl: Check if GC SPN exists before using it for replicationAmitay Isaacs1-3/+54
Sometimes windows DC will set up dNSHostname before setting up GC SPN and that causes replication errors since samba tries to use GC SPN, which does not yet exist locally. Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
2011-11-02s4-drepl: Search for application partitions in addition to main onesAmitay Isaacs1-3/+16
To replicate application partitions (e.g. DNS partitions) consult msDs-hasMasterNCs attribute as well. Also, make sure we don't add same partition twice in the list. hasMasterNCs and msDs-hasMasterNCs have domain, configuration and schema partitions common. Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-10-06s4-rodc: use the rodc_replica flag on the partitionAndrew Tridgell1-2/+2
this sets DSDB_REPL_FLAG_PARTIAL_REPLICA when replicating a RODC partition, which tells the replication code to map instanceType to remove the INSTANCE_TYPE_WRITE bit Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06s4-rodc: ensure we load replicated partitions for RODCsAndrew Tridgell2-46/+35
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-06s4-dsdb Allow repl server to start even when no master NCs are presentAndrew Bartlett1-7/+1
2011-10-04s4-repl: try harder to find the right SPN in replication serverAndrew Tridgell1-23/+72
when doing DRS between domains, using the right SPN is essential so the KDC can generate referrals to point us at the right DC. We prefer the GC/hostname/DNSDOMAIN form if possible, but if we can't find the hostname then this changes the code that generates the target principal name to use either the msDS-HasDomainNCs or hasMasterNCs attributes to try to find the target DC domainname so we can use the E3514235-4B06-11D1-AB04-00C04FC2DCD2/GUID/DNSDOMAIN SPN form. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-04s4-dsdb: added new control DSDB_MODIFY_PARTIAL_REPLICAAndrew Tridgell1-60/+3
this control tells the partition module that the DN being created is a partial replica, so it should modify the @PARTITION object to add the partialReplica attribute Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-04s4-repl: support creation of new NCs via DsAddEntryAndrew Tridgell1-0/+84
this adds a flag to dsdb_origin_objects_commit that tells it to create a new NC based on the nCName in a crossRef object
2011-10-04s4-repl: fixed formatting of some debug messagesAndrew Tridgell1-5/+5
2011-10-04s4-repl: update instanceType in partial_replica replicationAndrew Tridgell1-0/+20
when we receive objects to a partial replica, we need to change the incoming instanceType to not include the INSTANCE_TYPE_WRITE flag. Partial replicas unset this flag.
2011-10-04s4-repl: add FULL_SYNC and PARTIAL_REPLICA flagsAndrew Tridgell1-5/+27
this sets the appropriate flags for replication with FULL_SYNC and partial replica replications
2011-09-22s4-repl: remove unused principal_name elementAndrew Tridgell1-3/+0
2011-09-22s4-repl: fill in GUID and SID from partition informationAndrew Tridgell1-2/+9
when we find a NC via a DN string, fill in the GUID and SID so the caller can properly report them
2011-09-22s4-dsdb: get GUID and SID for DSA from extended DNAndrew Tridgell1-21/+27
this allows us to use the DN from a hasPartialReplicaNCs attribute to create a reps1 object
2011-09-22s4-dsdb: enable initial replication of partitions via DsReplicaSyncAndrew Tridgell2-0/+52
we need to create a temporary dsa object to allow the replication task to replicate a NC that is not listed in a repsFrom attribute