[SCM] Samba Shared Repository - branch master updated

[email protected] (Andrew Bartlett)
Newsgroups gmane.network.samba.cvs
Message-ID <[email protected]>
The branch, master has been updated
       via  ec0297b s4:repl_meta_data: normalize rdn attribute name via the schema
      from  50dff7e pidl: Make dcesrv\_$name\_interface "static const"

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ec0297bbd0110f8bfddda2e21d94a882094d1c11
Author: Stefan Metzmacher <[email protected]>
Date:   Sun Oct 30 23:54:44 2016 +0100

    s4:repl_meta_data: normalize rdn attribute name via the schema
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12399
    
    Signed-off-by: Stefan Metzmacher <[email protected]>
    
    Autobuild-User(master): Andrew Bartlett <[email protected]>
    Autobuild-Date(master): Thu Dec  8 17:16:47 CET 2016 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 4a66697..7d12c23 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -1446,15 +1446,21 @@ static int replmd_update_rpmd_rdn_attr(struct ldb_context *ldb,
 				       NTTIME now,
 				       bool is_schema_nc)
 {
+	const char *rdn_name = ldb_dn_get_rdn_name(msg->dn);
+	const struct dsdb_attribute *rdn_attr =
+		dsdb_attribute_by_lDAPDisplayName(ar->schema, rdn_name);
+	const char *attr_name = rdn_attr != NULL ?
+				rdn_attr->lDAPDisplayName :
+				rdn_name;
 	struct ldb_message_element new_el = {
 		.flags = LDB_FLAG_MOD_REPLACE,
-		.name = ldb_dn_get_rdn_name(msg->dn),
+		.name = attr_name,
 		.num_values = 1,
 		.values = discard_const_p(struct ldb_val, rdn_new)
 	};
 	struct ldb_message_element old_el = {
 		.flags = LDB_FLAG_MOD_REPLACE,
-		.name = ldb_dn_get_rdn_name(msg->dn),
+		.name = attr_name,
 		.num_values = rdn_old ? 1 : 0,
 		.values = discard_const_p(struct ldb_val, rdn_old)
 	};


-- 
Samba Shared Repository
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.