[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Mon May 24 06:01:29 MDT 2010


The branch, master has been updated
       via  8e1e6b0... s4:LogonGetDomainInfo - allow to set DNS hostname for the first time
       via  ee524d3... s4:"rdn_name" LDB module - fix the creation of the RDN attribute (try to normalise it)
       via  40ced1a... s4:setup/*.ldif - remove unneeded "cn" attributes
      from  8e069e2... s3: major overhaul of compiler and linker flags for HP-UX builds

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


- Log -----------------------------------------------------------------
commit 8e1e6b0112c06b8587c0823a62d2103c047f8310
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Mon May 24 12:42:32 2010 +0200

    s4:LogonGetDomainInfo - allow to set DNS hostname for the first time
    
    Otherwise it obviously can never be set.

commit ee524d3182de85dff2febaad2481e37ad5a8be8f
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Mon May 24 11:06:29 2010 +0200

    s4:"rdn_name" LDB module - fix the creation of the RDN attribute (try to normalise it)
    
    And return always the correct error codes on the failed add operations (should
    anyway be ERR_OPERATIONS_ERROR - therefore no behaviour change).

commit 40ced1a3be5ab04c7431ecda2c7924336a852994
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Mon May 24 10:38:16 2010 +0200

    s4:setup/*.ldif - remove unneeded "cn" attributes
    
    Should be generated automatically

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

Summary of changes:
 source4/lib/ldb/modules/rdn_name.c                |   26 ++++++++++++++++-----
 source4/rpc_server/netlogon/dcerpc_netlogon.c     |   25 +++++++++++---------
 source4/setup/provision_configuration_basedn.ldif |    1 -
 source4/setup/provision_schema_basedn.ldif        |    1 -
 4 files changed, 34 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/modules/rdn_name.c b/source4/lib/ldb/modules/rdn_name.c
index f1c167c..3a4068d 100644
--- a/source4/lib/ldb/modules/rdn_name.c
+++ b/source4/lib/ldb/modules/rdn_name.c
@@ -134,19 +134,33 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req)
 		attribute->num_values = 0;
 	}
 
-	if (ldb_msg_add_value(msg, "name", &rdn_val, NULL) != 0) {
+	ret = ldb_msg_add_value(msg, "name", &rdn_val, NULL);
+	if (ret != LDB_SUCCESS) {
+		return ret;
+	}
+
+	a = ldb_schema_attribute_by_name(ldb, rdn_name);
+	if (a == NULL) {
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
 
 	attribute = rdn_name_find_attribute(msg, rdn_name);
-
 	if (!attribute) {
-		if (ldb_msg_add_value(msg, rdn_name, &rdn_val, NULL) != 0) {
-			return LDB_ERR_OPERATIONS_ERROR;
+		/* add entry with normalised RDN information if possible */
+		if (a->name != NULL) {
+			ret = ldb_msg_add_value(msg, a->name, &rdn_val, NULL);
+		} else {
+			ret = ldb_msg_add_value(msg, rdn_name, &rdn_val, NULL);
+		}
+		if (ret != LDB_SUCCESS) {
+			return ret;
 		}
 	} else {
-		a = ldb_schema_attribute_by_name(ldb, rdn_name);
-
+		/* normalise attribute name if possible */
+		if (a->name != NULL) {
+			attribute->name = a->name;
+		}
+		/* normalise attribute value */
 		for (i = 0; i < attribute->num_values; i++) {
 			ret = a->syntax->comparison_fn(ldb, msg,
 					&rdn_val, &attribute->values[i]);
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index 0113416..c57f414 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1259,17 +1259,6 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
 		}
 
 		/*
-		 * Updates the DNS hostname when the client wishes that the
-		 * server should handle this for him
-		 * ("NETR_WS_FLAG_HANDLES_SPN_UPDATE" not set).
-		 * See MS-NRPC section 3.5.4.3.9
-		 */
-		if ((r->in.query->workstation_info->workstation_flags
-		    & NETR_WS_FLAG_HANDLES_SPN_UPDATE) != 0) {
-			update_dns_hostname = false;
-		}
-
-		/*
 		 * Checks that the computer name parameter without possible "$"
 		 * matches as prefix with the DNS hostname in the workstation
 		 * info structure.
@@ -1302,6 +1291,20 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
 		old_dns_hostname = samdb_result_string(res1[0], "dNSHostName",
 			NULL);
 
+		/*
+		 * Updates the DNS hostname when the client wishes that the
+		 * server should handle this for him
+		 * ("NETR_WS_FLAG_HANDLES_SPN_UPDATE" not set). And this is
+		 * obviously only checked when we do already have a
+		 * "dNSHostName".
+		 * See MS-NRPC section 3.5.4.3.9
+		 */
+		if ((old_dns_hostname != NULL) &&
+		    (r->in.query->workstation_info->workstation_flags
+		    & NETR_WS_FLAG_HANDLES_SPN_UPDATE) != 0) {
+			update_dns_hostname = false;
+		}
+
 		/* Gets host informations and put them in our directory */
 		new_msg = ldb_msg_new(mem_ctx);
 		NT_STATUS_HAVE_NO_MEMORY(new_msg);
diff --git a/source4/setup/provision_configuration_basedn.ldif b/source4/setup/provision_configuration_basedn.ldif
index 461aad9..710dac2 100644
--- a/source4/setup/provision_configuration_basedn.ldif
+++ b/source4/setup/provision_configuration_basedn.ldif
@@ -4,7 +4,6 @@
 dn: ${CONFIGDN}
 objectClass: top
 objectClass: configuration
-cn: Configuration
 msDS-NcType: 0
 nTSecurityDescriptor:: ${DESCRIPTOR}
 instanceType: 13
diff --git a/source4/setup/provision_schema_basedn.ldif b/source4/setup/provision_schema_basedn.ldif
index bc366ea..deb80dd 100644
--- a/source4/setup/provision_schema_basedn.ldif
+++ b/source4/setup/provision_schema_basedn.ldif
@@ -4,7 +4,6 @@
 dn: ${SCHEMADN}
 objectClass: top
 objectClass: dMD
-cn: Schema
 msDS-NcType: 0
 nTSecurityDescriptor:: ${DESCRIPTOR}
 instanceType: 13


-- 
Samba Shared Repository


More information about the samba-cvs mailing list