summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-09-23 19:52:19 -0700
committerAndrew Tridgell <tridge@samba.org>2010-09-25 10:38:45 -0700
commit3d7a4cf5b68a1adcc4b7b53819ffc0c580e92da0 (patch)
treeb338d78bbac3cdf5864fc68ddebda357d420328f /source4
parent805d9425c2ee06e1695e451500d1ffbf90ca8e72 (diff)
downloadsamba-3d7a4cf5b68a1adcc4b7b53819ffc0c580e92da0.tar.gz
samba-3d7a4cf5b68a1adcc4b7b53819ffc0c580e92da0.tar.bz2
samba-3d7a4cf5b68a1adcc4b7b53819ffc0c580e92da0.zip
s4-pynet: added server keyword to Net() initialisation
this sets up server_address in the libnet context Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/py_net.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c
index c9858a41a5..9775e246ed 100644
--- a/source4/libnet/py_net.c
+++ b/source4/libnet/py_net.c
@@ -534,12 +534,14 @@ static void py_net_dealloc(py_net_Object *self)
static PyObject *net_obj_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
PyObject *py_creds, *py_lp = Py_None;
- const char *kwnames[] = { "creds", "lp", NULL };
+ const char *kwnames[] = { "creds", "lp", "server", NULL };
py_net_Object *ret;
struct loadparm_context *lp;
+ const char *server_address = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O",
- discard_const_p(char *, kwnames), &py_creds, &py_lp))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|Oz",
+ discard_const_p(char *, kwnames), &py_creds, &py_lp,
+ &server_address))
return NULL;
ret = PyObject_New(py_net_Object, type);
@@ -565,6 +567,8 @@ static PyObject *net_obj_new(PyTypeObject *type, PyObject *args, PyObject *kwarg
return NULL;
}
+ ret->libnet_ctx->server_address = server_address;
+
ret->libnet_ctx->cred = cli_credentials_from_py_object(py_creds);
if (ret->libnet_ctx->cred == NULL) {
PyErr_SetString(PyExc_TypeError, "Expected credentials object");