diff options
Diffstat (limited to 'lib/smbconf')
-rw-r--r-- | lib/smbconf/pysmbconf.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/smbconf/pysmbconf.c b/lib/smbconf/pysmbconf.c index bf1540bbb50..ae06c52f0c2 100644 --- a/lib/smbconf/pysmbconf.c +++ b/lib/smbconf/pysmbconf.c @@ -309,6 +309,25 @@ static PyObject *obj_drop(py_SMBConf_Object * self, Py_RETURN_NONE; } +static PyObject *obj_set_parameter(py_SMBConf_Object * self, PyObject * args) +{ + sbcErr err; + char *servicename = NULL; + char *param = NULL; + char *val = NULL; + + if (!PyArg_ParseTuple(args, "sss", &servicename, ¶m, &val)) { + return NULL; + } + + err = smbconf_set_parameter(self->conf_ctx, servicename, param, val); + if (err != SBC_ERR_OK) { + py_raise_SMBConfError(err); + return NULL; + } + Py_RETURN_NONE; +} + PyDoc_STRVAR(obj_requires_messaging_doc, "requires_messaging() -> bool\n" "\n" @@ -348,6 +367,11 @@ PyDoc_STRVAR(obj_drop_doc, "drop() -> None\n" "Drop the entire configuration, resetting it to an empty state.\n"); +PyDoc_STRVAR(obj_set_parameter_doc, +"set_parameter(str, str, str) -> None\n" +"Set a configuration parmeter. Specify service name, parameter name,\n" +"and parameter value.\n"); + static PyMethodDef py_smbconf_obj_methods[] = { { "requires_messaging", (PyCFunction) obj_requires_messaging, METH_NOARGS, obj_requires_messaging_doc }, @@ -363,6 +387,8 @@ static PyMethodDef py_smbconf_obj_methods[] = { obj_create_share_doc }, { "drop", (PyCFunction) obj_drop, METH_NOARGS, obj_drop_doc }, + { "set_parameter", (PyCFunction) obj_set_parameter, METH_VARARGS, + obj_set_parameter_doc }, { 0 }, }; |