[SCM] Samba Shared Repository - branch master updated

Kamen Mazdrashki kamenim at samba.org
Thu Dec 2 10:48:02 MST 2010


The branch, master has been updated
       via  03b078c s4-dsdb/syntax: Map remote ATTIDs for Class OID syntax
       via  c1fef7e s4-test/repl_schema: Test class inheritance through subClassOf
       via  5bc1185 s4-dsdb_syntax: Be a little bit more chatty when we can't an ATTID in our cache
       via  1b70700 s4-test/fsmo: Remove unused imports
       via  ad1ea5e s4-test/delete_object: Remove unused imports
       via  28f4711 s4-test/repl_schema: Make ERR_NO_SUCH_OBJECT visible to us
       via  ebdbf9b s4-test/repl_schema: Test classSchema and attributeSchema replication in separate tests
       via  d8e5624 s4-dsdb/descriptor: comment typo
      from  7a5e47b s4:auth/sam.c-"authsam_expand_nested_groups" - don't fail if we've memberships on non-SAM objects

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


- Log -----------------------------------------------------------------
commit 03b078c5677c94468386323e5910137d422360ef
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Thu Dec 2 02:57:06 2010 +0200

    s4-dsdb/syntax: Map remote ATTIDs for Class OID syntax
    
    Autobuild-User: Kamen Mazdrashki <kamenim at samba.org>
    Autobuild-Date: Thu Dec  2 18:47:59 CET 2010 on sn-devel-104

commit c1fef7efc7bfdd03049511cbfad8395439660912
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Thu Dec 2 01:01:20 2010 +0200

    s4-test/repl_schema: Test class inheritance through subClassOf

commit 5bc11855f6d1b9ae4a7a653028f0614e797dd974
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Thu Dec 2 00:32:10 2010 +0200

    s4-dsdb_syntax: Be a little bit more chatty when we can't an ATTID in our cache

commit 1b7070039f9e88b8ab0683cc9d1650c2feda7484
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Thu Dec 2 00:30:46 2010 +0200

    s4-test/fsmo: Remove unused imports

commit ad1ea5e1421763061d98f5a4fe07888f69a597bb
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Wed Dec 1 21:13:54 2010 +0200

    s4-test/delete_object: Remove unused imports

commit 28f47112d73502204b3571cbdbe32f24e128309e
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Wed Dec 1 21:01:47 2010 +0200

    s4-test/repl_schema: Make ERR_NO_SUCH_OBJECT visible to us
    
    We've lost this import somehow, now it is back in :)

commit ebdbf9bd900f710459804410a4cb2e4504384e42
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Wed Dec 1 20:22:06 2010 +0200

    s4-test/repl_schema: Test classSchema and attributeSchema replication in separate tests

commit d8e56245c064011902910dcef8f2e18eebaf0810
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Wed Dec 1 20:16:00 2010 +0200

    s4-dsdb/descriptor: comment typo

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

Summary of changes:
 source4/dsdb/samdb/ldb_modules/descriptor.c |    2 +-
 source4/dsdb/schema/schema_syntax.c         |   10 +++++-
 source4/torture/drs/python/delete_object.py |    7 ++--
 source4/torture/drs/python/fsmo.py          |    2 -
 source4/torture/drs/python/repl_schema.py   |   44 +++++++++++++++++++++++++++
 5 files changed, 58 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/descriptor.c b/source4/dsdb/samdb/ldb_modules/descriptor.c
index baf00ad..0ea91ba 100644
--- a/source4/dsdb/samdb/ldb_modules/descriptor.c
+++ b/source4/dsdb/samdb/ldb_modules/descriptor.c
@@ -601,7 +601,7 @@ static int descriptor_do_mod(struct descriptor_context *ac)
 		if (ac->sd_val != NULL) {
 			ac->sd_element->values[0] = *sd;
 		} else if (sd_control2 != NULL) {
-			/* In this branche we really do force the recalculation
+			/* In this branch we really do force the recalculation
 			 * of the SD */
 			ldb_msg_remove_attr(ac->msg, "nTSecurityDescriptor");
 
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index ab37f66..2f8f9a5 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -984,8 +984,15 @@ static WERROR _dsdb_syntax_OID_obj_drsuapi_to_ldb(const struct dsdb_syntax_ctx *
 
 		v = IVAL(in->value_ctr.values[i].blob->data, 0);
 
+		/* convert remote ATTID to local ATTID */
+		if (!dsdb_syntax_attid_from_remote_attid(ctx, mem_ctx, v, &v)) {
+			DEBUG(1,(__location__ ": Failed to map remote ATTID to local ATTID!\n"));
+			return WERR_FOOBAR;
+		}
+
 		c = dsdb_class_by_governsID_id(ctx->schema, v);
 		if (!c) {
+			DEBUG(1,(__location__ ": Unknown governsID 0x%08X\n", v));
 			return WERR_FOOBAR;
 		}
 
@@ -1032,12 +1039,13 @@ static WERROR _dsdb_syntax_OID_attr_drsuapi_to_ldb(const struct dsdb_syntax_ctx
 
 		/* convert remote ATTID to local ATTID */
 		if (!dsdb_syntax_attid_from_remote_attid(ctx, mem_ctx, v, &v)) {
-			DEBUG(0,(__location__ "Failed to map remote ATTID to local ATTID!\n"));
+			DEBUG(1,(__location__ ": Failed to map remote ATTID to local ATTID!\n"));
 			return WERR_FOOBAR;
 		}
 
 		a = dsdb_attribute_by_attributeID_id(ctx->schema, v);
 		if (!a) {
+			DEBUG(1,(__location__ ": Unknown attributeID_id 0x%08X\n", v));
 			return WERR_FOOBAR;
 		}
 
diff --git a/source4/torture/drs/python/delete_object.py b/source4/torture/drs/python/delete_object.py
index 2936a57..1762d8f 100644
--- a/source4/torture/drs/python/delete_object.py
+++ b/source4/torture/drs/python/delete_object.py
@@ -32,9 +32,10 @@ import os
 
 sys.path.append("bin/python")
 
-from samba.auth import system_session
-from ldb import SCOPE_BASE, SCOPE_SUBTREE
-from samba.samdb import SamDB
+from ldb import (
+    SCOPE_BASE,
+    SCOPE_SUBTREE
+    )
 
 import samba.tests
 
diff --git a/source4/torture/drs/python/fsmo.py b/source4/torture/drs/python/fsmo.py
index 30120cc..880c8db 100644
--- a/source4/torture/drs/python/fsmo.py
+++ b/source4/torture/drs/python/fsmo.py
@@ -31,9 +31,7 @@ import os
 
 sys.path.append("bin/python")
 
-from samba.auth import system_session
 from ldb import SCOPE_BASE
-from samba.samdb import SamDB
 
 import samba.tests
 
diff --git a/source4/torture/drs/python/repl_schema.py b/source4/torture/drs/python/repl_schema.py
index 02e2afe..9bb12a2 100644
--- a/source4/torture/drs/python/repl_schema.py
+++ b/source4/torture/drs/python/repl_schema.py
@@ -38,6 +38,7 @@ samba.ensure_external_module("testtools", "testtools")
 samba.ensure_external_module("subunit", "subunit/python")
 
 from ldb import (
+    ERR_NO_SUCH_OBJECT,
     LdbError,
     SCOPE_BASE,
     Message,
@@ -172,6 +173,49 @@ class DrsReplSchemaTestCase(samba.tests.TestCase):
         self.assertEquals(len(res_dc2), 1,
                           "%s doesn't exists on %s" % (obj_dn, self.dnsname_dc2))
 
+    def test_class(self):
+        """Simple test for classSchema replication"""
+        # add new classSchema object
+        (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, "cls-S")
+        # force replication from DC1 to DC2
+        self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, nc_dn=self.schema_dn)
+        # check object is replicated
+        self._check_object(c_dn)
+
+    def test_classInheritance(self):
+        """Test inheritance through subClassOf
+           I think 5 levels of inheritance is pretty decent for now."""
+        # add 5 levels deep hierarchy
+        c_dn_list = []
+        c_ldn_last = None
+        for i in range(1, 6):
+            base_name = "cls-I-%02d" % i
+            (c_ldn, c_dn) = self._schema_new_class(self.ldb_dc1, base_name)
+            c_dn_list.append(c_dn)
+            if c_ldn_last:
+                # inherit from last class added
+                m = Message.from_dict(self.ldb_dc1,
+                                      {"dn": c_dn,
+                                       "subClassOf": c_ldn_last},
+                                      FLAG_MOD_REPLACE)
+                self.ldb_dc1.modify(m)
+            # store last class ldapDisplayName
+            c_ldn_last = c_ldn
+        # force replication from DC1 to DC2
+        self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, nc_dn=self.schema_dn)
+        # check objects are replicated
+        for c_dn in c_dn_list:
+            self._check_object(c_dn)
+
+    def test_attribute(self):
+        """Simple test for attributeSchema replication"""
+        # add new attributeSchema object
+        (a_ldn, a_dn) = self._schema_new_attr(self.ldb_dc1, "attr-S")
+        # force replication from DC1 to DC2
+        self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, nc_dn=self.schema_dn)
+        # check object is replicated
+        self._check_object(a_dn)
+
     def test_all(self):
         """Basic plan is to create bunch of classSchema
            and attributeSchema objects, replicate Schema NC


-- 
Samba Shared Repository


More information about the samba-cvs mailing list