r26513: Update substitution dictionary for ldifs.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 17 Dec 2007 19:03:06 +0000 (20:03 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:51:18 +0000 (05:51 +0100)
source/scripting/python/misc.i
source/scripting/python/misc.py
source/scripting/python/misc_wrap.c
source/scripting/python/samba/__init__.py
source/scripting/python/samba/provision.py

index 518011ea43fbf38f295338c5f2aa5d27783d3df3..eda0db2c3d5b50010e086741db70d91fb0e677f5 100644 (file)
@@ -59,3 +59,6 @@ bool samdb_set_domain_sid(struct ldb_context *ldb,
                           const struct dom_sid *dom_sid_in);
 
 WERROR dsdb_attach_schema_from_ldif_file(struct ldb_context *ldb, const char *pf, const char *df);
+
+%rename(version) samba_version_string;
+const char *samba_version_string(void);
index 525869ff5826aa6a9f4d3d935d3d598a11a50c6f..228ab24dbff8e667e6029326a2abd2b2fc4ab225 100644 (file)
@@ -67,5 +67,6 @@ ldb_set_session_info = _misc.ldb_set_session_info
 ldb_set_loadparm = _misc.ldb_set_loadparm
 samdb_set_domain_sid = _misc.samdb_set_domain_sid
 dsdb_attach_schema_from_ldif_file = _misc.dsdb_attach_schema_from_ldif_file
+version = _misc.version
 
 
index 7db909d3926abd930e022e31af532b16149bed76..effabdecef97be59b47ffc331f7fa7e32129306a 100644 (file)
@@ -3038,6 +3038,19 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *result = 0 ;
+  
+  if (!SWIG_Python_UnpackTuple(args,"version",0,0,0)) SWIG_fail;
+  result = (char *)samba_version_string();
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 static PyMethodDef SwigMethods[] = {
         { (char *)"random_password", (PyCFunction) _wrap_random_password, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"ldb_set_credentials", (PyCFunction) _wrap_ldb_set_credentials, METH_VARARGS | METH_KEYWORDS, NULL},
@@ -3045,6 +3058,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"ldb_set_loadparm", (PyCFunction) _wrap_ldb_set_loadparm, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"samdb_set_domain_sid", (PyCFunction) _wrap_samdb_set_domain_sid, METH_VARARGS | METH_KEYWORDS, NULL},
         { (char *)"dsdb_attach_schema_from_ldif_file", (PyCFunction) _wrap_dsdb_attach_schema_from_ldif_file, METH_VARARGS | METH_KEYWORDS, NULL},
+        { (char *)"version", (PyCFunction)_wrap_version, METH_NOARGS, NULL},
         { NULL, NULL, 0, NULL }
 };
 
index 511dcd905a02c8e72b6f246748182e79904a6b6c..f89ac39ac7717fe59841b407d661717d0cc25620 100644 (file)
@@ -122,6 +122,8 @@ def substitute_var(text, values):
     for (name, value) in values.items():
         text = text.replace("${%s}" % name, value)
 
+    assert "${" not in text, text
+
     return text
 
 
@@ -133,3 +135,4 @@ def valid_netbios_name(name):
         return False
     return True
 
+version = misc.version
index 34191b726949bd06c9f1a9297e0f3c4152b1e59e..7d7b85c13edb33fce4c2ad9449a9b95b93e876df 100644 (file)
@@ -14,6 +14,7 @@ import uuid, misc
 from socket import gethostname, gethostbyname
 import param
 import registry
+import samba
 from samba import Ldb, substitute_var, valid_netbios_name
 from samba.samdb import SamDB
 import security
@@ -56,6 +57,7 @@ class ProvisionSettings(object):
         self.schemedn_ldb = None
         self.s4_ldapi_path = None
         self.policyguid = None
+        self.extensibleobject = None
 
     def subst_vars(self):
         return {"SCHEMADN": self.schemadn,
@@ -77,6 +79,7 @@ class ProvisionSettings(object):
                 "NETBIOSNAME": self.netbiosname,
                 "DNSNAME": self.dnsname,
                 "ROOTDN": self.rootdn,
+                "DOMAIN": self.domain,
                 "DNSDOMAIN": self.dnsdomain,
                 "REALM": self.realm,
                 "DEFAULTSITE": self.defaultsite,
@@ -89,6 +92,9 @@ class ProvisionSettings(object):
                 "POLICYGUID": self.policyguid,
                 "RDN_DC": self.rdn_dc,
                 "DOMAINGUID_MOD": self.domainguid_mod,
+                "VERSION": samba.version(),
+                "ACI": "# no aci for local ldb",
+                "EXTENSIBLEOBJECT": self.extensibleobject,
                 }
 
     def fix(self, paths):