From 3b94b64481a811482dbd01fd55c145a89f2c8c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 16 Jan 2013 13:41:28 +0100 Subject: spoolss: make spoolss deal with ndr64 SetForm by using proper container object. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Signed-off-by: Günther Deschner Reviewed-by: David Disseldorp --- source4/ntptr/simple_ldb/ntptr_simple_ldb.c | 22 +++++++++++----------- source4/torture/rpc/spoolss.c | 9 ++++++--- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'source4') diff --git a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c index d8bb754bd7a..fe81a0fec72 100644 --- a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c +++ b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c @@ -383,16 +383,16 @@ static WERROR sptr_SetPrintServerForm(struct ntptr_GenericHandle *server, TALLOC * } */ - switch (r->in.level) { + switch (r->in.info_ctr->level) { case 1: - if (!r->in.info.info1) { + if (!r->in.info_ctr->info.info1) { return WERR_FOOBAR; } count = sptr_db_search(sptr_db, mem_ctx, ldb_dn_new(mem_ctx, sptr_db, "CN=Forms,CN=PrintServer"), &msgs, attrs, "(&(form-name=%s)(objectClass=form))", - r->in.info.info1->form_name); + r->in.info_ctr->info.info1->form_name); if (count == 0) return WERR_FOOBAR; if (count > 1) return WERR_FOOBAR; @@ -409,17 +409,17 @@ static WERROR sptr_SetPrintServerForm(struct ntptr_GenericHandle *server, TALLOC /* add core elements to the ldb_message for the user */ msg->dn = msgs[0]->dn; - SET_UINT(sptr_db, msg, "flags", r->in.info.info1->flags); + SET_UINT(sptr_db, msg, "flags", r->in.info_ctr->info.info1->flags); - SET_STRING(sptr_db, msg, "form-name", r->in.info.info1->form_name); + SET_STRING(sptr_db, msg, "form-name", r->in.info_ctr->info.info1->form_name); - SET_UINT(sptr_db, msg, "size-width", r->in.info.info1->size.width); - SET_UINT(sptr_db, msg, "size-height", r->in.info.info1->size.height); + SET_UINT(sptr_db, msg, "size-width", r->in.info_ctr->info.info1->size.width); + SET_UINT(sptr_db, msg, "size-height", r->in.info_ctr->info.info1->size.height); - SET_UINT(sptr_db, msg, "area-left", r->in.info.info1->area.left); - SET_UINT(sptr_db, msg, "area-top", r->in.info.info1->area.top); - SET_UINT(sptr_db, msg, "area-right", r->in.info.info1->area.right); - SET_UINT(sptr_db, msg, "area-bottom", r->in.info.info1->area.bottom); + SET_UINT(sptr_db, msg, "area-left", r->in.info_ctr->info.info1->area.left); + SET_UINT(sptr_db, msg, "area-top", r->in.info_ctr->info.info1->area.top); + SET_UINT(sptr_db, msg, "area-right", r->in.info_ctr->info.info1->area.right); + SET_UINT(sptr_db, msg, "area-bottom", r->in.info_ctr->info.info1->area.bottom); break; default: return WERR_UNKNOWN_LEVEL; diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 25625829f4d..d13a11dc870 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -2713,14 +2713,17 @@ static bool test_SetForm(struct torture_context *tctx, union spoolss_AddFormInfo *info) { struct spoolss_SetForm r; + struct spoolss_AddFormInfoCtr info_ctr; + + info_ctr.level = level; + info_ctr.info = *info; r.in.handle = handle; r.in.form_name = form_name; - r.in.level = level; - r.in.info = *info; + r.in.info_ctr = &info_ctr; torture_comment(tctx, "Testing SetForm(%s) level %d\n", - form_name, r.in.level); + form_name, level); torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_SetForm_r(b, tctx, &r), "SetForm failed"); -- cgit v1.2.1