diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-09-15 18:51:09 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-09-16 07:24:01 +1000 |
commit | 2edbf74f35a49e5793ee2621061856e1167b41a0 (patch) | |
tree | b42336728948adbda3c1a530e8b5efab7d248a4c /source4/libnet | |
parent | e18c0030e065a70f7291eb269112e9f04d5788dc (diff) | |
download | samba-2edbf74f35a49e5793ee2621061856e1167b41a0.tar.gz samba-2edbf74f35a49e5793ee2621061856e1167b41a0.tar.bz2 samba-2edbf74f35a49e5793ee2621061856e1167b41a0.zip |
s4-pynet: return the full netlogon response from python finddc
this gives the caller the other server parameters
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/py_net.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c index c460a06583..c9858a41a5 100644 --- a/source4/libnet/py_net.c +++ b/source4/libnet/py_net.c @@ -470,7 +470,7 @@ static PyObject *py_net_finddc(py_net_Object *self, PyObject *args) const char *domain_name; unsigned server_type; NTSTATUS status; - struct finddcs io; + struct finddcs *io; TALLOC_CTX *mem_ctx; PyObject *ret; @@ -480,11 +480,11 @@ static PyObject *py_net_finddc(py_net_Object *self, PyObject *args) mem_ctx = talloc_new(self->mem_ctx); - ZERO_STRUCT(io); - io.in.domain_name = domain_name; - io.in.minimum_dc_flags = server_type; + io = talloc_zero(mem_ctx, struct finddcs); + io->in.domain_name = domain_name; + io->in.minimum_dc_flags = server_type; - status = finddcs_cldap(mem_ctx, &io, + status = finddcs_cldap(io, io, lpcfg_resolve_context(self->libnet_ctx->lp_ctx), self->ev); if (NT_STATUS_IS_ERR(status)) { PyErr_SetString(PyExc_RuntimeError, nt_errstr(status)); @@ -492,9 +492,10 @@ static PyObject *py_net_finddc(py_net_Object *self, PyObject *args) return NULL; } - ret = PyString_FromString(io.out.netlogon.data.nt5_ex.pdc_dns_name); - + ret = py_return_ndr_struct("samba.dcerpc.nbt", "NETLOGON_SAM_LOGON_RESPONSE_EX", + io, &io->out.netlogon.data.nt5_ex); talloc_free(mem_ctx); + return ret; } |