]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
py3: Add is_ad_dc_built option to python glue
authorDavid Mulder <dmulder@suse.com>
Fri, 18 Sep 2020 17:27:24 +0000 (11:27 -0600)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 23 Oct 2020 03:25:34 +0000 (03:25 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/pyglue.c
python/samba/__init__.py

index aff9365d11b2c05d7dba5f24dd0ba783efe4bb0c..156eaf731505c70426538f3dfededdf0871639ad 100644 (file)
@@ -203,6 +203,16 @@ static PyObject *py_is_heimdal_built(PyObject *self,
 #endif
 }
 
+static PyObject *py_is_ad_dc_built(PyObject *self,
+               PyObject *Py_UNUSED(ignored))
+{
+#ifdef AD_DC_BUILD_IS_ENABLED
+        Py_RETURN_TRUE;
+#else
+        Py_RETURN_FALSE;
+#endif
+}
+
 /*
   return the list of interface IPs we have configured
   takes an loadparm context, returns a list of IPs in string form
@@ -389,6 +399,8 @@ static PyMethodDef py_misc_methods[] = {
                METH_VARARGS,
                "generate_random_bytes(len) -> bytes\n"
                "Generate random bytes with specified length." },
+       { "is_ad_dc_built", (PyCFunction)py_is_ad_dc_built, METH_NOARGS,
+               "is Samba built with AD DC?" },
        {0}
 };
 
index 0341cb36dfeaf4b5deb41c26d5d62aa54f66e132..fa047a813e29c383b5fab40e1cdc1bddad580359 100644 (file)
@@ -379,6 +379,7 @@ strcasecmp_m = _glue.strcasecmp_m
 strstr_m = _glue.strstr_m
 is_ntvfs_fileserver_built = _glue.is_ntvfs_fileserver_built
 is_heimdal_built = _glue.is_heimdal_built
+is_ad_dc_built = _glue.is_ad_dc_built
 
 NTSTATUSError = _glue.NTSTATUSError
 HRESULTError = _glue.HRESULTError