diff --git a/python/pyglue.c b/python/pyglue.c index aff9365d11b..156eaf73150 100644 --- a/python/pyglue.c +++ b/python/pyglue.c @@ -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} }; diff --git a/python/samba/__init__.py b/python/samba/__init__.py index 0341cb36dfe..fa047a813e2 100644 --- a/python/samba/__init__.py +++ b/python/samba/__init__.py @@ -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