diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-01-16 15:05:15 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-01-16 15:05:15 +0100 |
commit | 673ca5145c9c120cdb522096fd625662407f6f3d (patch) | |
tree | 969bc18a9f8ce5bddbd5d90ad0be6fcab0c2b9c7 /source4/param/pyparam.c | |
parent | 0d7ca8e89e37d1aa07a4c8fad6a24ac41ceb4855 (diff) | |
download | samba-673ca5145c9c120cdb522096fd625662407f6f3d.tar.gz samba-673ca5145c9c120cdb522096fd625662407f6f3d.tar.bz2 samba-673ca5145c9c120cdb522096fd625662407f6f3d.zip |
Find default smb.conf path correctly, when it was not specified on the
command-line.
Diffstat (limited to 'source4/param/pyparam.c')
-rw-r--r-- | source4/param/pyparam.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index 0061eadc54..42775908ea 100644 --- a/source4/param/pyparam.c +++ b/source4/param/pyparam.c @@ -358,6 +358,17 @@ struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx) return ret; } +static PyObject *py_default_path(PyObject *self) +{ + return PyString_FromString(lp_default_path()); +} + +static PyMethodDef pyparam_methods[] = { + { "default_path", (PyCFunction)py_default_path, METH_NOARGS, + "Returns the default smb.conf path." }, + { NULL } +}; + void initparam(void) { PyObject *m; @@ -365,7 +376,7 @@ void initparam(void) if (PyType_Ready(&PyLoadparmContext) < 0) return; - m = Py_InitModule3("param", NULL, "Parsing and writing Samba configuration files."); + m = Py_InitModule3("param", pyparam_methods, "Parsing and writing Samba configuration files."); if (m == NULL) return; |