summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/config.m41
-rw-r--r--source4/scripting/python/pyrpc.h5
-rw-r--r--source4/scripting/python/samba/provision.py9
-rw-r--r--source4/scripting/python/samba/tests/provision.py8
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",