summaryrefslogtreecommitdiff
path: root/source4/libnet/py_net.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-08-08 10:29:05 +0200
committerStefan Metzmacher <metze@samba.org>2011-08-12 12:39:05 +0200
commit47fcbd71ae811eb479fe479f4526fe11c0fa86b6 (patch)
treeaca1f9f11332ff0a8e75285e57bb0689776d5bc8 /source4/libnet/py_net.c
parentda7d22dadeec3bb41da0bd1e49c28ab20e83cf9f (diff)
downloadsamba-47fcbd71ae811eb479fe479f4526fe11c0fa86b6.tar.gz
samba-47fcbd71ae811eb479fe479f4526fe11c0fa86b6.tar.bz2
samba-47fcbd71ae811eb479fe479f4526fe11c0fa86b6.zip
s4:libnet: passdown the DsGetNCChangesReq* to the libnet_BecomeDC_StoreChunk handler
metze Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/libnet/py_net.c')
-rw-r--r--source4/libnet/py_net.c47
1 files changed, 43 insertions, 4 deletions
diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c
index 0fae791d69..c4b684077c 100644
--- a/source4/libnet/py_net.c
+++ b/source4/libnet/py_net.c
@@ -463,16 +463,20 @@ static PyObject *py_net_replicate_init(py_net_Object *self, PyObject *args, PyOb
*/
static PyObject *py_net_replicate_chunk(py_net_Object *self, PyObject *args, PyObject *kwargs)
{
- const char *kwnames[] = { "state", "level", "ctr", "schema", NULL };
- PyObject *py_state, *py_ctr, *py_schema;
+ const char *kwnames[] = { "state", "level", "ctr",
+ "schema", "req_level", "req",
+ NULL };
+ PyObject *py_state, *py_ctr, *py_schema, *py_req;
struct replicate_state *s;
unsigned level;
+ unsigned req_level = 0;
NTSTATUS (*chunk_handler)(void *private_data, const struct libnet_BecomeDC_StoreChunk *c);
NTSTATUS status;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OIO|O",
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OIO|OIO",
discard_const_p(char *, kwnames),
- &py_state, &level, &py_ctr, &py_schema)) {
+ &py_state, &level, &py_ctr,
+ &py_schema, &req_level, &py_req)) {
return NULL;
}
@@ -510,6 +514,41 @@ static PyObject *py_net_replicate_chunk(py_net_Object *self, PyObject *args, PyO
return NULL;
}
+ s->chunk.req5 = NULL;
+ s->chunk.req8 = NULL;
+ s->chunk.req10 = NULL;
+ if (py_req) {
+ switch (req_level) {
+ case 0:
+ break;
+ case 5:
+ if (!py_check_dcerpc_type(py_req, "samba.dcerpc.drsuapi", "DsGetNCChangesRequest5")) {
+ return NULL;
+ }
+
+ s->chunk.req5 = pytalloc_get_ptr(py_req);
+ break;
+ case 8:
+ if (!py_check_dcerpc_type(py_req, "samba.dcerpc.drsuapi", "DsGetNCChangesRequest8")) {
+ return NULL;
+ }
+
+ s->chunk.req8 = pytalloc_get_ptr(py_req);
+ break;
+ case 10:
+ if (!py_check_dcerpc_type(py_req, "samba.dcerpc.drsuapi", "DsGetNCChangesRequest10")) {
+ return NULL;
+ }
+
+ s->chunk.req10 = pytalloc_get_ptr(py_req);
+ break;
+ default:
+ PyErr_Format(PyExc_TypeError, "Bad req_level %u in replicate_chunk", req_level);
+ return NULL;
+ }
+ }
+ s->chunk.req_level = req_level;
+
chunk_handler = libnet_vampire_cb_store_chunk;
if (py_schema) {
if (!PyBool_Check(py_schema)) {