summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/repl/replicated_objects.c
Commit message (Collapse)AuthorAgeFilesLines
* dsdb: Do not update notify_uSN until the transaction is genuinely committed ↵Andrew Bartlett2014-03-271-7/+7
| | | | | | | | to the DB Signed-off-by: Andrew Bartlett <abartlet@samba.org> Change-Id: I734bc75ed348de8f0a5ff92e18e08de2340b8951 Reviewed-by: Stefan Metzmacher <metze@samba.org>
* 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: 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-repl: make message more clearerMatthieu Patou2013-02-081-2/+2
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* 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: 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-drs: if schema has changed during replication notify other process that ↵Matthieu Patou2012-06-221-0/+55
| | | | they have to reload the schema
* 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: 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-dsdb clarify that failure to load the schema items from DRS is expectedAndrew Bartlett2011-08-091-3/+3
| | | | | | | | | | This happens if we have a custom schema - we need to build up the schema until it loads, by converting more objects. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Aug 9 13:10:25 CEST 2011 on sn-devel-104
* s4-repl/working_schema: Ignore some attributes when bulding working schema cacheKamen Mazdrashki2011-03-011-0/+9
| | | | | We don't need all object attributes resolved and converted for a working schema to be functional.
* s4-replicated_objects: Implement a mechanism to relax some attributes conversionKamen Mazdrashki2011-03-011-4/+31
| | | | | | | | during replicated object convert stage. The problem is that we may have loops in schema graph and we can't resolve those loops in just one pass. Ignoring some attributes conversion will allow us to have a functional schema cache that we can use later to resolve all attribute OIDs on another pass
* ldb: use #include <ldb.h> for ldbAndrew Tridgell2011-02-101-1/+1
| | | | | | | | thi ensures we are using the header corresponding to the version of ldb we're linking against. Otherwise we could use the system ldb for link and the in-tree one for include Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-drepl: During Schema replication, we need to save updated prefixMap if ↵Kamen Mazdrashki2010-12-181-0/+18
| | | | | | | everything is OK Autobuild-User: Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date: Sat Dec 18 05:53:48 CET 2010 on sn-devel-104
* s4-drepl: Make refreshed schema a global oneKamen Mazdrashki2010-12-181-0/+7
| | | | | | | | | | | | | | | We need to do this as dsdb_reference_schema() function clears "use_global_schema" ldb flag. Basically what is going to happen is that after dsdb_reference_schema() global_schema pointer will continue to point at old schema cache, while "dsdb_schema" for LDB will point at the working_schema. After replication is done, we reset "dsdb_schema" for the ldb with an updated Schema cache, but this leaves global_schema pointer with its old value, which is not up to date. So we need to call dsdb_make_schema_global() again so that global_schema points to a valid Schema cache.
* s4-drepl: Reference current Schema cache into working_schema contextKamen Mazdrashki2010-12-171-1/+1
| | | | | | | | | working_schema is a shallow copy of current schema and thus depends on part of it. So we want it to be around as long as working_schema is used. Autobuild-User: Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date: Fri Dec 17 23:34:29 CET 2010 on sn-devel-104
* s4-repl: Allow dsdb_replicated_objects_commit() to use different schema ↵Kamen Mazdrashki2010-12-151-0/+55
| | | | | | | | | | | | | | | | | | while committing objects working_schema is to be used while committing a Schema replica. When we replicate Schema, then we most probably won't be able to convert all replicated objects using the current Schema cache (as we don't know anything about those new objects). Thus, during Schema replication, we make a temporary working_schema that contains both our current Schema + all objects we get on the wire. When we commit those new objects, we should use our working_schema (by setting it to the ldb), and after all changes are commited, we can refresh the schema cache so we have a brand new, full-featured Schema cache
* s4:dsdb/repl/replicated_objects.c - proof if "talloc_reference" doesn't ↵Matthias Dieter Wallnöfer2010-12-011-1/+2
| | | | | | | return NULL Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Wed Dec 1 17:14:01 CET 2010 on sn-devel-104
* s4-dsdb/schema: Implement multi-pass working schema creation functionKamen Mazdrashki2010-12-011-0/+132
| | | | | | | | | | | | | | It is heavily based on implementation in libnet_vampire_cb_apply_schema() function, except that it actually creates a new copy of the supplied initial_schema + resolving all incoming objects and add them to supplied initial_schema. We are going to need this 'working_schema' later so we are able to fully resolve all objects we receive on wire during DRS replication. Working schema created is to be used only as an index to search in. It is not supposed to be set to an ldb_context as it doesn't contain all information for classSchema and attributeSchema objects.
* s4-repl: Let dsdb_replicated_objects_convert() to accept schema from callerKamen Mazdrashki2010-12-011-7/+6
| | | | | This allows us to use schema that is different than the one set to 'ldb' to decode objects.
* s4-repl: Propagate remote prefixMap in DRSUAPI data conversion functionsKamen Mazdrashki2010-11-111-3/+19
|
* s4-repl: dsdb_extended_replicated_objects_convert -> ↵Kamen Mazdrashki2010-11-111-12/+12
| | | | | | dsdb_replicated_objects_convert/ It is part of dsdb_replicated_* family of functions
* s4-repl: dsdb_extended_replicated_objects_commit -> ↵Kamen Mazdrashki2010-11-111-3/+3
| | | | | | dsdb_replicated_objects_commit It is part of dsdb_replicated_* family of functions
* s4-repl: dsdb_convert_object -> dsdb_origin_object_convertKamen Mazdrashki2010-11-111-7/+7
| | | | | It is used in dsdb_origin_objects_commit() func, hence the dsdb_origin_ prefix
* idl: Use DRSUAPI_ATTID_ prefix instead of DRSUAPI_ATTRIBUTE_ for ATTID valuesKamen Mazdrashki2010-10-311-1/+1
| | | | | Those values are actually ATTID values and such, they are used for ATTIDs for Attributes, Classes and Syntaxes.
* s4-dsdb-repl: Print what the error code for failure isKamen Mazdrashki2010-10-101-1/+3
|
* s4-drs: Check for schema changes only in case we are *not* applying Schema ↵Kamen Mazdrashki2010-09-181-8/+19
| | | | | | | | replica This fixes the problem when we fail to replicate with a partner DC that has a newer Schema with attributeSchema objects with OIDs that we don't have in our local prefixMap.
* s4:dsdb Allow calling dsdb_convert_object_ex() directlyAndrew Bartlett2010-06-121-6/+6
| | | | | | | This will allow the libnet_vampire code to manually convert individual schema objects. Andrew Bartlett
* s4:dsdb Change dsdb_get_schema() callers to use new talloc argumentAndrew Bartlett2010-03-161-11/+19
| | | | | | | | 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
* s4:repl - change also here the counter variables to "unsigned"Matthias Dieter Wallnöfer2010-03-051-2/+2
| | | | | I changed also some "uint32_t" to "unsigned" since the LDB interface doesn't specify the bitlength of the unsigned type.
* s4-drs: Store uSNUrgent for Urgent ReplicationFernando J V da Silva2010-01-141-2/+2
| | | | | | | | When a object or attribute is created/updated/deleted, according to [MS-ADTS] 3.1.1.5.1.6, it stores the uSNUrgent on @REPLCHANGED for the partitions that it belongs. Signed-off-by: Andrew Tridgell <tridge@samba.org>
* Revert "s4-drs: cope with bogus empty attributes from w2k8-r2"Kamen Mazdrashki2009-12-211-17/+0
| | | | | | | | This reverts commit 1287c1d115fb7e8f3954bc05ff65007968403a9c. Next patch should fix the "not recognized ATTIDs" problem Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s4-repl: give a reason why the prepare commit failedAndrew Tridgell2009-12-211-1/+2
|
* s4-dsdb: use GUID_to_ndr_blob()Andrew Tridgell2009-12-101-7/+2
|
* s4-drs: cope with bogus empty attributes from w2k8-r2Andrew Tridgell2009-11-281-0/+17
| | | | | | w2k8-r2 sometimes sends empty attributes with completely bogus attrid values in a DRS replication response. This allows us to continue with the vampire operation despite these broken elements.
* Revert "s4:dsdb/repl/replicated_objects - Applicate also here the new ↵Matthias Dieter Wallnöfer2009-11-161-4/+1
| | | | | | | | | | "lDAPDisplayName" generator" This reverts commit df95d5c29292968b465bff24c3cf78800677a4d4. abartlet pointed out in a post on the samba-technical list that this isn't necessary at all (lDAPDisplayName normalisation algorithm). Rather it breaks functionality of the replication.
* s4:dsdb/repl/replicated_objects - Applicate also here the new ↵Matthias Dieter Wallnöfer2009-11-151-1/+4
| | | | | | | "lDAPDisplayName" generator Also here we've to be sure to generate the attribute correctly if it doesn't exist yet.
* s4:dsdb/repl Split the 'convert' or 'commit' stages in the DRS importAndrew Bartlett2009-11-121-34/+29
| | | | | | | This will allow us in future to do tests on the LDB values we generate from the DRS replication. Andrew Bartlett