summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-04-20 07:17:36 +0000
committerTim Potter <tpot@samba.org>2002-04-20 07:17:36 +0000
commit5c261ce93d369d8c3901117777c3bb421178a186 (patch)
tree78378f647fb2fe95b7118e221c80bc855a12165e /source3
parentca2e14ddc3d753f79319060f3024a0c9b3a57b98 (diff)
downloadsamba-5c261ce93d369d8c3901117777c3bb421178a186.tar.gz
samba-5c261ce93d369d8c3901117777c3bb421178a186.tar.bz2
samba-5c261ce93d369d8c3901117777c3bb421178a186.zip
Return exception text if getprinter level not [0..3]
(This used to be commit c02a7a71d6ddae711c84094e410d1117efc031f0)
Diffstat (limited to 'source3')
-rw-r--r--source3/python/py_spoolss_printers.c9
1 files changed, 8 insertions, 1 deletions
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(