diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-01-31 09:49:15 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-01-31 09:49:15 +1100 |
commit | 8398982ac998d98cb1184f2b6d2631f1cfc9b3f8 (patch) | |
tree | d930f888211ce6f1353b4b41f2b1563957933e2b /source4/scripting/python | |
parent | 3a3ff8ebe7b7de24a7d3e2c9dd105d9fbeeb5d42 (diff) | |
parent | 1c22c925e5a7f45fbcbf9c2f8e206ee6b2b12192 (diff) | |
download | samba-8398982ac998d98cb1184f2b6d2631f1cfc9b3f8.tar.gz samba-8398982ac998d98cb1184f2b6d2631f1cfc9b3f8.tar.bz2 samba-8398982ac998d98cb1184f2b6d2631f1cfc9b3f8.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit f6a5848e5e211d4d4d66b7eca46b4b0ad4c9daab)
Diffstat (limited to 'source4/scripting/python')
-rw-r--r-- | source4/scripting/python/config.m4 | 1 | ||||
-rw-r--r-- | source4/scripting/python/pyrpc.h | 5 | ||||
-rw-r--r-- | source4/scripting/python/samba/provision.py | 9 | ||||
-rw-r--r-- | source4/scripting/python/samba/tests/provision.py | 8 |
4 files changed, 20 insertions, 3 deletions
diff --git a/source4/scripting/python/config.m4 b/source4/scripting/python/config.m4 index 4f46f92682..e4a34ece1e 100644 --- a/source4/scripting/python/config.m4 +++ b/source4/scripting/python/config.m4 @@ -66,6 +66,7 @@ if test $working_python = yes; then SMB_ENABLE(EXT_LIB_PYTHON,YES) SMB_ENABLE(smbpython,YES) SMB_ENABLE(LIBPYTHON,YES) + dnl AC_DEFINE(HAVE_WORKING_PYTHON, 1, [Whether we have working python support]) AC_MSG_RESULT([yes]) else SMB_ENABLE(EXT_LIB_PYTHON,NO) diff --git a/source4/scripting/python/pyrpc.h b/source4/scripting/python/pyrpc.h index 5390c6923d..3a5d235cfc 100644 --- a/source4/scripting/python/pyrpc.h +++ b/source4/scripting/python/pyrpc.h @@ -27,3 +27,8 @@ #define dom_sid28_Type dom_sid_Type #define dom_sid2_Check dom_sid_Check #define dom_sid28_Check dom_sid28_Check + +/* This macro is only provided by Python >= 2.3 */ +#ifndef PyAPI_DATA +# define PyAPI_DATA(RTYPE) extern RTYPE +#endif diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index f244679eb5..d2a4f28b64 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -203,7 +203,13 @@ def provision_paths_from_lp(lp, dnsdomain, private_dir=None): paths.s4_ldapi_path = os.path.join(private_dir, "ldapi") paths.phpldapadminconfig = os.path.join(private_dir, "phpldapadmin-config.php") - paths.hklm = os.path.join(private_dir, "hklm.ldb") + paths.hklm = "hklm.ldb" + paths.hkcr = "hkcr.ldb" + paths.hkcu = "hkcu.ldb" + paths.hku = "hku.ldb" + paths.hkpd = "hkpd.ldb" + paths.hkpt = "hkpt.ldb" + paths.sysvol = lp.get("sysvol", "path") if paths.sysvol is None: paths.sysvol = os.path.join(lp.get("lock dir"), "sysvol") @@ -442,6 +448,7 @@ def setup_registry(path, setup_path, session_info, credentials, lp): :param lp: Loadparm context """ reg = registry.Registry() + print path hive = registry.open_ldb(path, session_info=session_info, credentials=credentials, lp_ctx=lp) reg.mount_hive(hive, "HKEY_LOCAL_MACHINE") diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py index 1456b6751c..4e9fa9c3ef 100644 --- a/source4/scripting/python/samba/tests/provision.py +++ b/source4/scripting/python/samba/tests/provision.py @@ -21,6 +21,10 @@ import os from samba.provision import setup_secretsdb, secretsdb_become_dc import samba.tests from ldb import Dn +import param + +lp = param.LoadParm() +lp.load("st/dc/etc/smb.conf") setup_dir = "setup" def setup_path(file): @@ -30,7 +34,7 @@ def setup_path(file): class ProvisionTestCase(samba.tests.TestCaseInTempDir): def test_setup_secretsdb(self): path = os.path.join(self.tempdir, "secrets.ldb") - ldb = setup_secretsdb(path, setup_path, None, None, None) + ldb = setup_secretsdb(path, setup_path, None, None, lp=lp) try: self.assertEquals("LSA Secrets", ldb.searchone(basedn="CN=LSA Secrets", attribute="CN")) @@ -40,7 +44,7 @@ class ProvisionTestCase(samba.tests.TestCaseInTempDir): def test_become_dc(self): path = os.path.join(self.tempdir, "secrets.ldb") - secrets_ldb = setup_secretsdb(path, setup_path, None, None, None) + secrets_ldb = setup_secretsdb(path, setup_path, None, None, lp=lp) try: secretsdb_become_dc(secrets_ldb, setup_path, domain="EXAMPLE", realm="example", netbiosname="myhost", |