summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/repl
Commit message (Collapse)AuthorAgeFilesLines
* dsdb: Refuse to replicate an all-zero invocationID GUID in replPropertyMetaDataAndrew Bartlett2013-09-221-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>
* dsdb: Add assert in drepl_take_FSMO_roleAndrew Bartlett2013-07-241-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>
* dsdb: Allow dsdb_find_dn_by_guid to show deleted DNsAndrew Bartlett2013-06-121-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>
* dsdb: use the correct talloc parent in dsdb_repl_merge_working_schema()Stefan Metzmacher2013-06-111-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>
* dsdb-repl: merge the logic from libnet_vampire_cb_apply_schema()Stefan Metzmacher2013-05-231-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>
* dsdb-repl: split out dsdb_repl_resolve_working_schemaStefan Metzmacher2013-05-231-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>
* dsdb-drs: when replicating schema object checks ask for removal of previous ↵Matthieu Patou2013-05-231-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>
* dsdb-repl: Allow the name attribute (and name-based schema lookups) to be ↵Andrew Bartlett2013-05-161-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>
* dsdb-drepl: create a new schedulable event for running pending operationsMatthieu Patou2013-05-153-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>
* dsdb-repl: make message more clearerMatthieu Patou2013-02-081-2/+2
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb-repl: do not ask to add ref when doing getncchange for an exopMatthieu Patou2013-02-081-0/+7
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* drepl-notify: change misleading messageMatthieu Patou2013-01-221-1/+1
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* drs-fsmo: Improve handling of FSMO role takeover.Andrew Bartlett2013-01-171-3/+2
| | | | | | | | This needs to be more async, and give less scary errors. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:dsdb/drepl: update the source_dsa_obj/invocation_id in repsFromStefan Metzmacher2013-01-011-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>
* s4-repl: make dreplsrv_partition_find_for_nc return BAD_NC onlyMatthieu Patou2012-10-071-2/+7
|
* s4:dsdb/repl: fix the usage of 'GC/' prefixed principal namesStefan Metzmacher2012-08-141-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
* s4-dsdb: Use samdb_dn_is_our_ntdsa()Andrew Bartlett2012-08-142-19/+24
| | | | | | | This uses a GUID based comparison, and avoids re-fetching the samdb_ntds_settings_dn each time. Andrew Bartlett
* s4:dsdb/repl: ldb_errstring() takes a 'struct ldb_context' not 'int'Stefan Metzmacher2012-08-141-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
* s4:dsdb/repl: make sure instanceType_e is not changed by a reallocationStefan Metzmacher2012-08-141-1/+11
| | | | | | Pair-Programmed-With: Björn Baumbach <bb@sernet.de> metze
* s4:dsdb/repl: avoid reallocation of msg->elementsStefan Metzmacher2012-08-141-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
* s4-dsdb: Add mem_ctx argument to samdb_ntds_settings_dnAndrew Bartlett2012-08-143-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
* s4-dsdb: Take more care in handling of global schema memoryAndrew Bartlett2012-08-111-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
* s4:dsdb:replicated_objects: do not move 'instanceType' to the end of ↵Stefan Metzmacher2012-08-031-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
* s4-repl: Use ldb_dn_new() to create the rootDSE DNAndrew Bartlett2012-07-291-1/+5
| | | | | | Based on a patch proposal by Matthieu Patou <mat@matws.net>. Andrew Bartlett
* s4-repl: Use NULL for pointer test when checking for ldb_msg_new() failureAndrew Bartlett2012-07-291-1/+1
|
* s4-dsdb: Ensure we never write read-only objects onto a read-write replicaAndrew Bartlett2012-07-181-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
* s4-dsdb: Use parent_object_guid to find the correct parent for new objectsAndrew Bartlett2012-07-061-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
* s4-drepl: Ensure that the op->source does not get deallocated too earlyAndrew Bartlett2012-06-242-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
* s4-drs: if schema has changed during replication notify other process that ↵Matthieu Patou2012-06-221-0/+55
| | | | they have to reload the schema
* lib/param: Create a seperate server role for "active directory domain ↵Andrew Bartlett2012-06-151-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
* s4-dsdb: Fix the case for attribute name msDS-hasMasterNCsAmitay Isaacs2012-03-141-1/+1
| | | | | Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Wed Mar 14 11:59:02 CET 2012 on sn-devel-104
* Revert "s4-drs: do not try to contact for replication servers that are not ↵Andrew Tridgell2012-02-011-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
* s4-drs: do not try to contact for replication servers that are not anymore ↵Matthieu Patou2011-12-051-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
* s4-resolver: do not use all the A and AAAA records, those after a NS are not ↵Matthieu Patou2011-12-051-1/+1
| | | | the one we want to use
* s4-drs: mark WERR_DS_DRA_BUSY as a non error in DsReplicaUpdateRefsMatthieu Patou2011-12-051-2/+22
|
* s4-repl: Check if GC SPN exists before using it for replicationAmitay Isaacs2011-11-291-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>
* s4-drepl: Search for application partitions in addition to main onesAmitay Isaacs2011-11-021-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>
* s4-rodc: use the rodc_replica flag on the partitionAndrew Tridgell2011-10-061-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>
* s4-rodc: ensure we load replicated partitions for RODCsAndrew Tridgell2011-10-062-46/+35
| | | | Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-dsdb Allow repl server to start even when no master NCs are presentAndrew Bartlett2011-10-061-7/+1
|
* s4-repl: try harder to find the right SPN in replication serverAndrew Tridgell2011-10-041-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>
* s4-dsdb: added new control DSDB_MODIFY_PARTIAL_REPLICAAndrew Tridgell2011-10-041-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>
* s4-repl: support creation of new NCs via DsAddEntryAndrew Tridgell2011-10-041-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
* s4-repl: fixed formatting of some debug messagesAndrew Tridgell2011-10-041-5/+5
|
* s4-repl: update instanceType in partial_replica replicationAndrew Tridgell2011-10-041-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.
* s4-repl: add FULL_SYNC and PARTIAL_REPLICA flagsAndrew Tridgell2011-10-041-5/+27
| | | | | this sets the appropriate flags for replication with FULL_SYNC and partial replica replications
* s4-repl: remove unused principal_name elementAndrew Tridgell2011-09-221-3/+0
|
* s4-repl: fill in GUID and SID from partition informationAndrew Tridgell2011-09-221-2/+9
| | | | | when we find a NC via a DN string, fill in the GUID and SID so the caller can properly report them
* s4-dsdb: get GUID and SID for DSA from extended DNAndrew Tridgell2011-09-221-21/+27
| | | | | this allows us to use the DN from a hasPartialReplicaNCs attribute to create a reps1 object
* s4-dsdb: enable initial replication of partitions via DsReplicaSyncAndrew Tridgell2011-09-222-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