summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-09-09 04:43:38 +0000
committerTim Potter <tpot@samba.org>2002-09-09 04:43:38 +0000
commit8a362924714c53b5a5c02b7969a91b4240db57d2 (patch)
treef065e5233695ea5a9540dd9153b3eb71f4a1734a /source3
parentb32f4ccf5b2cf74c98f4755856d81e217ab458ef (diff)
downloadsamba-8a362924714c53b5a5c02b7969a91b4240db57d2.tar.gz
samba-8a362924714c53b5a5c02b7969a91b4240db57d2.tar.bz2
samba-8a362924714c53b5a5c02b7969a91b4240db57d2.zip
Fix crash bugs in getprinter info level code (yay unit tests).
Let the cli_spoolss function return invalid info level error rather than checking for it ourselves. (This used to be commit fc5e186821abc429ea8314d0785b76cbe1ec5f74)
Diffstat (limited to 'source3')
-rw-r--r--source3/python/py_spoolss_printers.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/source3/python/py_spoolss_printers.c b/source3/python/py_spoolss_printers.c
index 2a6d056bbf..a300eada86 100644
--- a/source3/python/py_spoolss_printers.c
+++ b/source3/python/py_spoolss_printers.c
@@ -135,11 +135,6 @@ PyObject *spoolss_hnd_getprinter(PyObject *self, PyObject *args, PyObject *kw)
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 */
@@ -224,7 +219,7 @@ PyObject *spoolss_hnd_setprinter(PyObject *self, PyObject *args, PyObject *kw)
case 1:
ctr.printers_1 = &pinfo.printers_1;
- if (!py_to_PRINTER_INFO_1(&pinfo.printers_1, info)){
+ if (!py_to_PRINTER_INFO_1(ctr.printers_1, info)){
PyErr_SetString(spoolss_error,
"error converting printer to info 1");
return NULL;
@@ -234,7 +229,7 @@ PyObject *spoolss_hnd_setprinter(PyObject *self, PyObject *args, PyObject *kw)
case 2:
ctr.printers_2 = &pinfo.printers_2;
- if (!py_to_PRINTER_INFO_2(&pinfo.printers_2, info,
+ if (!py_to_PRINTER_INFO_2(ctr.printers_2, info,
hnd->mem_ctx)){
PyErr_SetString(spoolss_error,
"error converting printer to info 2");
@@ -245,7 +240,7 @@ PyObject *spoolss_hnd_setprinter(PyObject *self, PyObject *args, PyObject *kw)
case 3:
ctr.printers_3 = &pinfo.printers_3;
- if (!py_to_PRINTER_INFO_3(&pinfo.printers_3, info,
+ if (!py_to_PRINTER_INFO_3(ctr.printers_3, info,
hnd->mem_ctx)) {
PyErr_SetString(spoolss_error,
"error converting to printer info 3");