summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-06-10 09:10:09 +1000
committerAndrew Tridgell <tridge@samba.org>2011-06-10 10:14:56 +1000
commit3e4c08096d913834143b23f4fbc662d92659a83f (patch)
tree9c1c8716bbd104b042600bc5642f08bdf29058c0 /source4
parentfe02f47de04e5e83273ad012effbe15794cd99c1 (diff)
downloadsamba-3e4c08096d913834143b23f4fbc662d92659a83f.tar.gz
samba-3e4c08096d913834143b23f4fbc662d92659a83f.tar.bz2
samba-3e4c08096d913834143b23f4fbc662d92659a83f.zip
s4-drs: cope with missing RMD_ADDTIME in linked attributes
upgraded links can be missing the RMD_ADDTIME field
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/common/util.c2
-rw-r--r--source4/rpc_server/drsuapi/getncchanges.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 0cba20b465..3fa8f67447 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -3192,7 +3192,7 @@ bool dsdb_dn_is_deleted_val(const struct ldb_val *val)
*/
bool dsdb_dn_is_upgraded_link_val(struct ldb_val *val)
{
- return memmem(val->data, val->length, "<RMD_ADDTIME=", 13) != NULL;
+ return memmem(val->data, val->length, "<RMD_VERSION=", 13) != NULL;
}
/*
diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c
index 0c196aab55..72f954d2b2 100644
--- a/source4/rpc_server/drsuapi/getncchanges.c
+++ b/source4/rpc_server/drsuapi/getncchanges.c
@@ -360,10 +360,6 @@ static WERROR get_nc_changes_add_la(TALLOC_CTX *mem_ctx,
la->attid = sa->attributeID_id;
la->flags = active?DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE:0;
- status = dsdb_get_extended_dn_nttime(dsdb_dn->dn, &la->originating_add_time, "RMD_ADDTIME");
- if (!NT_STATUS_IS_OK(status)) {
- return ntstatus_to_werror(status);
- }
status = dsdb_get_extended_dn_uint32(dsdb_dn->dn, &la->meta_data.version, "RMD_VERSION");
if (!NT_STATUS_IS_OK(status)) {
return ntstatus_to_werror(status);
@@ -381,6 +377,12 @@ static WERROR get_nc_changes_add_la(TALLOC_CTX *mem_ctx,
return ntstatus_to_werror(status);
}
+ status = dsdb_get_extended_dn_nttime(dsdb_dn->dn, &la->originating_add_time, "RMD_ADDTIME");
+ if (!NT_STATUS_IS_OK(status)) {
+ /* this is possible for upgraded links */
+ la->originating_add_time = la->meta_data.originating_change_time;
+ }
+
werr = dsdb_dn_la_to_blob(sam_ctx, sa, schema, *la_list, dsdb_dn, &la->value.blob);
W_ERROR_NOT_OK_RETURN(werr);