[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Wed Dec 15 10:19:03 MST 2010


The branch, master has been updated
       via  4a2d396 ldb: Bump API after symbol changes.
       via  a1eadc5 ldb: Build modules as .so files.
       via  186c347 join: Properly cancel transaction on exceptions.
       via  f98d9e0 Move get_loadparm() and get_credentials() to samba.tests.TestCase.
      from  8b47fce s3:rpc_client: implement rpc_transport_np_init() on top of rpc_transport_tstream_init()

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


- Log -----------------------------------------------------------------
commit 4a2d39697159c575721dfb3d2ff3940c6259f44b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Dec 15 17:29:59 2010 +0100

    ldb: Bump API after symbol changes.
    
    Autobuild-User: Jelmer Vernooij <jelmer at samba.org>
    Autobuild-Date: Wed Dec 15 18:18:52 CET 2010 on sn-devel-104

commit a1eadc5fb41852f07a8cffa136c5ea29f4b1d13e
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Dec 15 16:47:46 2010 +0100

    ldb: Build modules as .so files.

commit 186c3474c4cdeb366c056a40608abe6e69176145
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Dec 15 16:40:59 2010 +0100

    join: Properly cancel transaction on exceptions.

commit f98d9e06cfc9615834585864ed2348c63fb66adc
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Dec 15 14:57:43 2010 +0100

    Move get_loadparm() and get_credentials() to samba.tests.TestCase.

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

Summary of changes:
 source4/lib/ldb-samba/wscript_build              |    2 +-
 source4/lib/ldb/wscript                          |   11 +++-
 source4/scripting/python/samba/join.py           |   79 ++++++++++++----------
 source4/scripting/python/samba/tests/__init__.py |   23 ++++--
 4 files changed, 70 insertions(+), 45 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb-samba/wscript_build b/source4/lib/ldb-samba/wscript_build
index f7bd81c..fddf12f 100644
--- a/source4/lib/ldb-samba/wscript_build
+++ b/source4/lib/ldb-samba/wscript_build
@@ -9,7 +9,7 @@ bld.SAMBA_LIBRARY('ldbsamba',
                   autoproto='ldif_handlers_proto.h',
                   public_deps='ldb',
                   public_headers='ldb_wrap.h',
-                  deps='security ndr NDR_DRSBLOBS NDR_DNSP ldbwrap samdb-common SAMDB_SCHEMA',
+                  deps='security ndr NDR_DRSBLOBS NDR_DNSP ldbwrap samdb-common SAMDB_SCHEMA tdb',
                   private_library=True
                   )
 
diff --git a/source4/lib/ldb/wscript b/source4/lib/ldb/wscript
index 278bc7e..dd47942 100644
--- a/source4/lib/ldb/wscript
+++ b/source4/lib/ldb/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'ldb'
-VERSION = '0.9.20'
+VERSION = '0.9.21'
 
 blddir = 'bin'
 
@@ -145,6 +145,7 @@ def build(bld):
                          'modules/paged_results.c',
                          init_function='ldb_paged_results_init',
                          module_init_name='ldb_init_module',
+                         internal_module=False,
                          deps='ldb',
                          subsystem='ldb')
 
@@ -152,12 +153,14 @@ def build(bld):
                          'modules/asq.c',
                          init_function='ldb_asq_init',
                          module_init_name='ldb_init_module',
+                         internal_module=False,
                          deps='ldb',
                          subsystem='ldb')
 
         bld.SAMBA_MODULE('ldb_server_sort',
                          'modules/sort.c',
                          init_function='ldb_server_sort_init',
+                         internal_module=False,
                          module_init_name='ldb_init_module',
                          deps='ldb',
                          subsystem='ldb')
@@ -165,6 +168,7 @@ def build(bld):
         bld.SAMBA_MODULE('ldb_paged_searches',
                          'modules/paged_searches.c',
                          init_function='ldb_paged_searches_init',
+                         internal_module=False,
                          module_init_name='ldb_init_module',
                          deps='ldb',
                          subsystem='ldb')
@@ -172,6 +176,7 @@ def build(bld):
         bld.SAMBA_MODULE('ldb_rdn_name',
                          'modules/rdn_name.c',
                          init_function='ldb_rdn_name_init',
+                         internal_module=False,
                          module_init_name='ldb_init_module',
                          deps='ldb',
                          subsystem='ldb')
@@ -179,6 +184,7 @@ def build(bld):
         bld.SAMBA_MODULE('ldb_sample',
                          'tests/sample_module.c',
                          init_function='ldb_sample_init',
+                         internal_module=False,
                          module_init_name='ldb_init_module',
                          deps='ldb',
                          subsystem='ldb')
@@ -186,6 +192,7 @@ def build(bld):
         bld.SAMBA_MODULE('ldb_skel',
                          'modules/skel.c',
                          init_function='ldb_skel_init',
+                         internal_module=False,
                          module_init_name='ldb_init_module',
                          deps='ldb',
                          subsystem='ldb')
@@ -193,6 +200,7 @@ def build(bld):
         bld.SAMBA_MODULE('ldb_sqlite3',
                          'sqlite3/ldb_sqlite3.c',
                          init_function='ldb_sqlite3_init',
+                         internal_module=False,
                          module_init_name='ldb_init_module',
                          enabled=False,
                          deps='ldb',
@@ -204,6 +212,7 @@ def build(bld):
                                     ldb_cache.c ldb_tdb_wrap.c'''),
                          init_function='ldb_tdb_init',
                          module_init_name='ldb_init_module',
+                         internal_module=False,
                          deps='tdb ldb',
                          subsystem='ldb')
 
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py
index 60f3ac3..09adf73 100644
--- a/source4/scripting/python/samba/join.py
+++ b/source4/scripting/python/samba/join.py
@@ -39,8 +39,8 @@ talloc.enable_null_tracking()
 class dc_join:
     '''perform a DC join'''
 
-    def __init__(ctx, server=None, creds=None, lp=None, site=None, netbios_name=None,
-                 targetdir=None, domain=None):
+    def __init__(ctx, server=None, creds=None, lp=None, site=None,
+            netbios_name=None, targetdir=None, domain=None):
         ctx.creds = creds
         ctx.lp = lp
         ctx.site = site
@@ -443,40 +443,49 @@ class dc_join:
 
         print "Starting replication"
         ctx.local_samdb.transaction_start()
-
-        source_dsa_invocation_id = misc.GUID(ctx.samdb.get_invocation_id())
-        destination_dsa_guid = ctx.ntds_guid
-
-        if ctx.RODC:
-            repl_creds = Credentials()
-            repl_creds.guess(ctx.lp)
-            repl_creds.set_kerberos_state(DONT_USE_KERBEROS)
-            repl_creds.set_username(ctx.samname)
-            repl_creds.set_password(ctx.acct_pass)
+        try:
+            source_dsa_invocation_id = misc.GUID(ctx.samdb.get_invocation_id())
+            destination_dsa_guid = ctx.ntds_guid
+
+            if ctx.RODC:
+                repl_creds = Credentials()
+                repl_creds.guess(ctx.lp)
+                repl_creds.set_kerberos_state(DONT_USE_KERBEROS)
+                repl_creds.set_username(ctx.samname)
+                repl_creds.set_password(ctx.acct_pass)
+            else:
+                repl_creds = ctx.creds
+
+            binding_options = "seal"
+            if ctx.lp.get("debug level") >= 5:
+                binding_options += ",print"
+            repl = drs_utils.drs_Replicate(
+                "ncacn_ip_tcp:%s[%s]" % (ctx.server, binding_options),
+                ctx.lp, repl_creds, ctx.local_samdb)
+
+            repl.replicate(ctx.schema_dn, source_dsa_invocation_id,
+                    destination_dsa_guid, schema=True, rodc=ctx.RODC,
+                    replica_flags=ctx.replica_flags)
+            repl.replicate(ctx.config_dn, source_dsa_invocation_id,
+                    destination_dsa_guid, rodc=ctx.RODC,
+                    replica_flags=ctx.replica_flags)
+            repl.replicate(ctx.base_dn, source_dsa_invocation_id,
+                    destination_dsa_guid, rodc=ctx.RODC,
+                    replica_flags=ctx.replica_flags)
+            if ctx.RODC:
+                repl.replicate(ctx.acct_dn, source_dsa_invocation_id,
+                        destination_dsa_guid,
+                        exop=drsuapi.DRSUAPI_EXOP_REPL_SECRET, rodc=True)
+                repl.replicate(ctx.new_krbtgt_dn, source_dsa_invocation_id,
+                        destination_dsa_guid,
+                        exop=drsuapi.DRSUAPI_EXOP_REPL_SECRET, rodc=True)
+
+            print "Committing SAM database"
+        except:
+            ctx.local_samdb.transaction_cancel()
+            raise
         else:
-            repl_creds = ctx.creds
-
-        binding_options = "seal"
-        if ctx.lp.get("debug level") >= 5:
-            binding_options += ",print"
-        repl = drs_utils.drs_Replicate("ncacn_ip_tcp:%s[%s]" % (ctx.server, binding_options),
-                                       ctx.lp, repl_creds, ctx.local_samdb)
-
-        repl.replicate(ctx.schema_dn, source_dsa_invocation_id, destination_dsa_guid,
-                       schema=True, rodc=ctx.RODC,
-                       replica_flags=ctx.replica_flags)
-        repl.replicate(ctx.config_dn, source_dsa_invocation_id, destination_dsa_guid,
-                       rodc=ctx.RODC, replica_flags=ctx.replica_flags)
-        repl.replicate(ctx.base_dn, source_dsa_invocation_id, destination_dsa_guid,
-                       rodc=ctx.RODC, replica_flags=ctx.replica_flags)
-        if ctx.RODC:
-            repl.replicate(ctx.acct_dn, source_dsa_invocation_id, destination_dsa_guid,
-                           exop=drsuapi.DRSUAPI_EXOP_REPL_SECRET, rodc=True)
-            repl.replicate(ctx.new_krbtgt_dn, source_dsa_invocation_id, destination_dsa_guid,
-                           exop=drsuapi.DRSUAPI_EXOP_REPL_SECRET, rodc=True)
-
-        print "Committing SAM database"
-        ctx.local_samdb.transaction_commit()
+            ctx.local_samdb.transaction_commit()
 
 
     def join_finalise(ctx):
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py
index 29016ea..10826ab 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -29,10 +29,22 @@ import subprocess
 import tempfile
 
 # Other modules import these two classes from here, for convenience:
-from testtools.testcase import TestCase, TestSkipped
+from testtools.testcase import (
+    TestCase as TesttoolsTestCase,
+    TestSkipped,
+    )
 
 
-class LdbTestCase(TestCase):
+class TestCase(TesttoolsTestCase):
+
+    def get_loadparm(self):
+        return env_loadparm()
+
+    def get_credentials(self):
+        return cmdline_credentials
+
+
+class LdbTestCase(TesttoolsTestCase):
     """Trivial test case for running tests against a LDB."""
 
     def setUp(self):
@@ -84,12 +96,7 @@ def env_get_var_value(var_name):
 cmdline_credentials = None
 
 class RpcInterfaceTestCase(TestCase):
-
-    def get_loadparm(self):
-        return env_loadparm()
-
-    def get_credentials(self):
-        return cmdline_credentials
+    """DCE/RPC Test case."""
 
 
 class ValidNetbiosNameTests(TestCase):


-- 
Samba Shared Repository


More information about the samba-cvs mailing list