From 5c261ce93d369d8c3901117777c3bb421178a186 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sat, 20 Apr 2002 07:17:36 +0000 Subject: Return exception text if getprinter level not [0..3] (This used to be commit c02a7a71d6ddae711c84094e410d1117efc031f0) --- source3/python/py_spoolss_printers.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/python') diff --git a/source3/python/py_spoolss_printers.c b/source3/python/py_spoolss_printers.c index 48321500e7..623e693124 100644 --- a/source3/python/py_spoolss_printers.c +++ b/source3/python/py_spoolss_printers.c @@ -119,12 +119,19 @@ PyObject *spoolss_getprinter(PyObject *self, PyObject *args, PyObject *kw) int level = 1; uint32 needed; static char *kwlist[] = {"level", NULL}; - + /* Parse parameters */ if (!PyArg_ParseTupleAndKeywords(args, kw, "|i", kwlist, &level)) return NULL; + if (level < 0 || level > 3) { + PyErr_SetString(spoolss_error, "Invalid info level"); + return NULL; + } + + ZERO_STRUCT(ctr); + /* Call rpc function */ werror = cli_spoolss_getprinter( -- cgit