diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-24 07:18:21 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-24 10:37:19 -0700 |
commit | 3b7c668606c63d85eeb7f61920e8f40074d7829f (patch) | |
tree | f6e2646accca06a72975b58cc95382c016990a90 /source4/dsdb/samdb | |
parent | 41e409370b1c8c8572ead30d7f79bfd2dd6f4118 (diff) | |
download | samba-3b7c668606c63d85eeb7f61920e8f40074d7829f.tar.gz samba-3b7c668606c63d85eeb7f61920e8f40074d7829f.tar.bz2 samba-3b7c668606c63d85eeb7f61920e8f40074d7829f.zip |
s4-ldb: sort replPropertyMetaData by attid
We need to sort on both module add and modify
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 1af96220b5..df399e24f0 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -814,6 +814,20 @@ static int replmd_update_rpmd(struct ldb_module *module, if (*seq_num != 0) { struct ldb_val *md_value; struct ldb_message_element *el; + const char *rdn_name; + const struct dsdb_attribute *rdn_sa; + + rdn_name = ldb_dn_get_rdn_name(msg->dn); + if (!rdn_name) { + DEBUG(0,(__location__ ": No rDN for %s?\n", ldb_dn_get_linearized(msg->dn))); + return LDB_ERR_OPERATIONS_ERROR; + } + rdn_sa = dsdb_attribute_by_lDAPDisplayName(schema, rdn_name); + if (rdn_sa == NULL) { + DEBUG(0,(__location__ ": sa not found for rDN %s in %s?\n", + rdn_name, ldb_dn_get_linearized(msg->dn))); + return LDB_ERR_OPERATIONS_ERROR; + } md_value = talloc(msg, struct ldb_val); if (md_value == NULL) { @@ -821,6 +835,8 @@ static int replmd_update_rpmd(struct ldb_module *module, return LDB_ERR_OPERATIONS_ERROR; } + replmd_replPropertyMetaDataCtr1_sort(&omd.ctr.ctr1, &rdn_sa->attributeID_id); + ndr_err = ndr_push_struct_blob(md_value, msg, lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")), &omd, @@ -910,7 +926,6 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req) } /* TODO: - * - sort the attributes by attid with replmd_ldb_message_sort() * - replace the old object with the newly constructed one */ |