summaryrefslogtreecommitdiffstats
path: root/source4/param/pyparam.c
diff options
context:
space:
mode:
authorRicardo Jorge <rvelhote@gmail.com>2009-08-04 00:00:25 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-08-04 00:18:42 +0200
commit1174177c8f5851762ab0d3724df9efbdc0f34b1c (patch)
treeb6db653caca77186000a241fa74899f44d130edd /source4/param/pyparam.c
parent15d73317ea90cdc02083cb132663ef198ef5e60d (diff)
downloadsamba-1174177c8f5851762ab0d3724df9efbdc0f34b1c.tar.gz
samba-1174177c8f5851762ab0d3724df9efbdc0f34b1c.tar.xz
samba-1174177c8f5851762ab0d3724df9efbdc0f34b1c.zip
python/loadparm: Get shares listing working.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4/param/pyparam.c')
-rw-r--r--source4/param/pyparam.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c
index 979182c678..37e882e1cc 100644
--- a/source4/param/pyparam.c
+++ b/source4/param/pyparam.c
@@ -235,13 +235,14 @@ static PyObject *py_lp_ctx_private_path(py_talloc_Object *self, PyObject *args)
static PyObject *py_lp_ctx_services(py_talloc_Object *self)
{
struct loadparm_context *lp_ctx = PyLoadparmContext_AsLoadparmContext(self);
- const char **names;
PyObject *ret;
int i;
- names = lp_server_services(lp_ctx);
- ret = PyList_New(str_list_length(names));
- for (i = 0; names[i]; i++) {
- PyList_SetItem(ret, i, PyString_FromString(names[i]));
+ ret = PyList_New(lp_numservices(lp_ctx));
+ for (i = 0; i < lp_numservices(lp_ctx); i++) {
+ struct loadparm_service *service = lp_servicebynum(lp_ctx, i);
+ if (service != NULL) {
+ PyList_SetItem(ret, i, PyString_FromString(lp_servicename(service)));
+ }
}
return ret;
}