diff options
Diffstat (limited to 'source4/param/pyparam.c')
-rw-r--r-- | source4/param/pyparam.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index 043d8261d4..998eb9d325 100644 --- a/source4/param/pyparam.c +++ b/source4/param/pyparam.c @@ -272,6 +272,12 @@ static PyObject *py_lp_dump(PyObject *self, PyObject *args) Py_RETURN_NONE; } +static PyObject *py_samdb_url(PyObject *self) +{ + struct loadparm_context *lp_ctx = PyLoadparmContext_AsLoadparmContext(self); + return PyString_FromFormat("tdb://%s/sam.ldb", lpcfg_private_dir(lp_ctx)); +} + static PyMethodDef py_lp_ctx_methods[] = { { "load", (PyCFunction)py_lp_ctx_load, METH_VARARGS, @@ -298,6 +304,9 @@ static PyMethodDef py_lp_ctx_methods[] = { "S.services() -> list" }, { "dump", (PyCFunction)py_lp_dump, METH_VARARGS, "S.dump(stream, show_defaults=False)" }, + { "samdb_url", (PyCFunction)py_samdb_url, METH_NOARGS, + "S.samdb_url() -> string\n" + "Returns the current URL for sam.ldb." }, { NULL } }; |