From 18c3436f9d22b259aa1ee1ed40265a2d33a660fb Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 9 Sep 2002 03:22:39 +0000 Subject: Return WERR_UNKNOWN_LEVEL for unknown info levels. (This used to be commit d30da51956accfc4ea4662cece00d4df223421cd) --- source3/rpc_client/cli_spoolss.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index 448dc7ece5..ca24d95e33 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -661,7 +661,8 @@ WERROR cli_spoolss_setprinter(struct cli_state *cli, TALLOC_CTX *mem_ctx, prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL); prs_init(&rbuf, 0, mem_ctx, UNMARSHALL); - make_spoolss_q_setprinter(mem_ctx, &q, pol, level, ctr, command); + if (!make_spoolss_q_setprinter(mem_ctx, &q, pol, level, ctr, command)) + goto done; /* Marshall data and send request */ @@ -1335,8 +1336,16 @@ WERROR cli_spoolss_getform(struct cli_state *cli, TALLOC_CTX *mem_ctx, if (needed) *needed = r.needed; - if (W_ERROR_IS_OK(result)) - smb_io_form_1("", r.buffer, form, 0); + if (W_ERROR_IS_OK(result)) { + switch(level) { + case 1: + smb_io_form_1("", r.buffer, form, 0); + break; + default: + DEBUG(10, ("cli_spoolss_getform: unknown info level %d", level)); + return WERR_UNKNOWN_LEVEL; + } + } done: prs_mem_free(&qbuf); -- cgit