[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Fri Aug 3 02:31:02 MDT 2012


The branch, master has been updated
       via  d12831d docs-xml: fix pid directory example
       via  5beb345 docs-xml: fix dfree cache time example
       via  8dafdb5 s4:dsdb:replicated_objects: do not move 'instanceType' to the end of msg->elements on RODC replication
       via  d642831 s4: samba_spnupdate: fix "if we are DNS server" check
      from  8dde55c build: fix typo

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


- Log -----------------------------------------------------------------
commit d12831d4b413ab917526f05d3d542f7dd88361d2
Author: Björn Baumbach <bb at sernet.de>
Date:   Mon Jul 30 17:09:07 2012 +0200

    docs-xml: fix pid directory example
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Fri Aug  3 10:30:37 CEST 2012 on sn-devel-104

commit 5beb3458ce9ff91efdfea1cb8cd9e4e8e4fe56d2
Author: Björn Baumbach <bb at sernet.de>
Date:   Mon Jul 30 17:02:55 2012 +0200

    docs-xml: fix dfree cache time example
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 8dafdb54e339813c1980c074c574505e3bdfee5a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Aug 2 16:27:20 2012 +0200

    s4:dsdb:replicated_objects: do not move 'instanceType' to the end of msg->elements on RODC replication
    
    It's very important that the order of msg->elements and md->ctr.ctr1.array
    is the same.
    
    metze

commit d6428319d4b13b0f37fac591fba83a62f356c7e5
Author: Björn Baumbach <bb at sernet.de>
Date:   Wed Aug 1 15:09:00 2012 +0200

    s4: samba_spnupdate: fix "if we are DNS server" check
    
    We need to check if we have hasMasterNCs. If we are RODC we have
    hasFullReplicaNCs instead of hasMasterNCs.
    
    TODO: maybe check for hasFullReplicaNCs, too?
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

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

Summary of changes:
 docs-xml/smbdotconf/misc/dfreecachetime.xml |    2 +-
 docs-xml/smbdotconf/misc/piddirectory.xml   |    2 +-
 source4/dsdb/repl/replicated_objects.c      |   23 ++++++++++++++++++++++-
 source4/scripting/bin/samba_spnupdate       |   11 ++++++-----
 4 files changed, 30 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/smbdotconf/misc/dfreecachetime.xml b/docs-xml/smbdotconf/misc/dfreecachetime.xml
index 2a8805e..62d3557 100644
--- a/docs-xml/smbdotconf/misc/dfreecachetime.xml
+++ b/docs-xml/smbdotconf/misc/dfreecachetime.xml
@@ -23,5 +23,5 @@
 	</para>
 
 </description>
-<value type="example">dfree cache time = 60</value>
+<value type="example">60</value>
 </samba:parameter>
diff --git a/docs-xml/smbdotconf/misc/piddirectory.xml b/docs-xml/smbdotconf/misc/piddirectory.xml
index c9f0533..35e0223 100644
--- a/docs-xml/smbdotconf/misc/piddirectory.xml
+++ b/docs-xml/smbdotconf/misc/piddirectory.xml
@@ -10,5 +10,5 @@
 </description>
 
 <value type="default">${prefix}/var/locks</value>
-<value type="example">pid directory = /var/run/</value>
+<value type="example">/var/run/</value>
 </samba:parameter>
diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c
index dadb9a1..a8c210f 100644
--- a/source4/dsdb/repl/replicated_objects.c
+++ b/source4/dsdb/repl/replicated_objects.c
@@ -203,6 +203,7 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb,
 	struct ldb_message *msg;
 	struct replPropertyMetaDataBlob *md;
 	int instanceType;
+	struct ldb_message_element *instanceType_e = NULL;
 	struct ldb_val guid_value;
 	struct ldb_val parent_guid_value;
 	NTTIME whenChanged = 0;
@@ -289,6 +290,13 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb,
 			continue;
 		}
 
+		if (a->attid == DRSUAPI_ATTID_instanceType) {
+			if (instanceType_e != NULL) {
+				return WERR_FOOBAR;
+			}
+			instanceType_e = e;
+		}
+
 		for (j=0; j<a->value_ctr.num_values; j++) {
 			status = drsuapi_decrypt_attribute(a->value_ctr.values[j].blob, gensec_skey, rid, a);
 			W_ERROR_NOT_OK_RETURN(status);
@@ -353,6 +361,10 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb,
 
 	}
 
+	if (instanceType_e == NULL) {
+		return WERR_FOOBAR;
+	}
+
 	instanceType = ldb_msg_find_attr_as_int(msg, "instanceType", 0);
 	if (dsdb_repl_flags & DSDB_REPL_FLAG_PARTIAL_REPLICA) {
 		/* the instanceType type for partial_replica
@@ -361,7 +373,16 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb,
 		*/
 		if (instanceType & INSTANCE_TYPE_WRITE) {
 			instanceType &= ~INSTANCE_TYPE_WRITE;
-			ldb_msg_remove_attr(msg, "instanceType");
+			/*
+			 * Make sure we do not change the order
+			 * of msg->elements!
+			 *
+			 * That's why we use
+			 * instanceType_e->num_values = 0
+			 * instead of
+			 * ldb_msg_remove_attr(msg, "instanceType");
+			 */
+			instanceType_e->num_values = 0;
 			if (ldb_msg_add_fmt(msg, "instanceType", "%d", instanceType) != LDB_SUCCESS) {
 				return WERR_INTERNAL_ERROR;
 			}
diff --git a/source4/scripting/bin/samba_spnupdate b/source4/scripting/bin/samba_spnupdate
index 69406a8..977de68 100755
--- a/source4/scripting/bin/samba_spnupdate
+++ b/source4/scripting/bin/samba_spnupdate
@@ -130,11 +130,12 @@ res = samdb.search(base=samdb.get_config_basedn(),
 
 basedn = str(samdb.get_default_basedn())
 if len(res) == 1:
-    for e in res[0]["msDS-hasMasterNCs"]:
-        if str(e) == "DC=DomainDnsZones,%s" % basedn:
-            has_domain_dns = True
-        if str(e) == "DC=ForestDnsZones,%s" % basedn:
-            has_forest_dns = True
+    if "msDS-hasMasterNCs" in res[0]:
+        for e in res[0]["msDS-hasMasterNCs"]:
+            if str(e) == "DC=DomainDnsZones,%s" % basedn:
+                has_domain_dns = True
+            if str(e) == "DC=ForestDnsZones,%s" % basedn:
+                has_forest_dns = True
 
 
 # build the spn list


-- 
Samba Shared Repository


More information about the samba-cvs mailing list