From a5868d58c718e9122f65db50f1799bcb82c778a0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 15 Jul 2005 18:13:40 +0000 Subject: r8507: BUG 2557: don't give and rpc fault when you get an unsupported SetPrinter() level (This used to be commit f617ca33f45fbc779356c52664c1e689114accdd) --- source3/rpc_parse/parse_spoolss.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/rpc_parse') diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 8050712d97..2663b09381 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -3817,6 +3817,22 @@ BOOL spoolss_io_q_setprinter(const char *desc, SPOOL_Q_SETPRINTER *q_u, prs_stru return False; if(!prs_uint32("level", ps, depth, &q_u->level)) return False; + + /* check for supported levels and structures we know about */ + + switch ( q_u->level ) { + case 0: + case 2: + case 3: + case 7: + /* supported levels */ + break; + default: + DEBUG(0,("spoolss_io_q_setprinter: unsupported printer info level [%d]\n", + q_u->level)); + return True; + } + if(!spool_io_printer_info_level("", &q_u->info, ps, depth)) return False; -- cgit