summaryrefslogtreecommitdiff
path: root/source4
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
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')
-rw-r--r--source4/libnet/libnet_become_dc.c25
-rw-r--r--source4/libnet/libnet_become_dc.h4
-rw-r--r--source4/libnet/py_net.c47
3 files changed, 72 insertions, 4 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index aabb3b41a8..bfa637255c 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -2615,6 +2615,10 @@ static WERROR becomeDC_drsuapi_pull_partition_recv(struct libnet_BecomeDC_state
struct libnet_BecomeDC_Partition *partition,
struct drsuapi_DsGetNCChanges *r)
{
+ uint32_t req_level = 0;
+ struct drsuapi_DsGetNCChangesRequest5 *req5 = NULL;
+ struct drsuapi_DsGetNCChangesRequest8 *req8 = NULL;
+ struct drsuapi_DsGetNCChangesRequest10 *req10 = NULL;
uint32_t ctr_level = 0;
struct drsuapi_DsGetNCChangesCtr1 *ctr1 = NULL;
struct drsuapi_DsGetNCChangesCtr6 *ctr6 = NULL;
@@ -2628,6 +2632,23 @@ static WERROR becomeDC_drsuapi_pull_partition_recv(struct libnet_BecomeDC_state
return r->out.result;
}
+ switch (r->in.level) {
+ case 0:
+ /* none */
+ break;
+ case 5:
+ req5 = &r->in.req->req5;
+ break;
+ case 8:
+ req8 = &r->in.req->req8;
+ break;
+ case 10:
+ req10 = &r->in.req->req10;
+ break;
+ default:
+ return WERR_INVALID_PARAMETER;
+ }
+
if (*r->out.level_out == 1) {
ctr_level = 1;
ctr1 = &r->out.ctr->ctr1;
@@ -2691,6 +2712,10 @@ static WERROR becomeDC_drsuapi_pull_partition_recv(struct libnet_BecomeDC_state
s->_sc.source_dsa = &s->source_dsa;
s->_sc.dest_dsa = &s->dest_dsa;
s->_sc.partition = partition;
+ s->_sc.req_level = req_level;
+ s->_sc.req5 = req5;
+ s->_sc.req8 = req8;
+ s->_sc.req10 = req10;
s->_sc.ctr_level = ctr_level;
s->_sc.ctr1 = ctr1;
s->_sc.ctr6 = ctr6;
diff --git a/source4/libnet/libnet_become_dc.h b/source4/libnet/libnet_become_dc.h
index 604813f6bc..b3b08bd9b9 100644
--- a/source4/libnet/libnet_become_dc.h
+++ b/source4/libnet/libnet_become_dc.h
@@ -107,6 +107,10 @@ struct libnet_BecomeDC_StoreChunk {
const struct libnet_BecomeDC_SourceDSA *source_dsa;
const struct libnet_BecomeDC_DestDSA *dest_dsa;
const struct libnet_BecomeDC_Partition *partition;
+ uint32_t req_level;
+ const struct drsuapi_DsGetNCChangesRequest5 *req5;
+ const struct drsuapi_DsGetNCChangesRequest8 *req8;
+ const struct drsuapi_DsGetNCChangesRequest10 *req10;
uint32_t ctr_level;
const struct drsuapi_DsGetNCChangesCtr1 *ctr1;
const struct drsuapi_DsGetNCChangesCtr6 *ctr6;
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)) {