diff options
author | Tim Potter <tpot@samba.org> | 2002-05-27 06:29:58 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-05-27 06:29:58 +0000 |
commit | 1ef99e76632f6f6b866de491db8722c94f75a8c2 (patch) | |
tree | 8ced1dddeb40368619309b064bc8aad82af73db2 /source | |
parent | 736eb3c7485c0e65a463f14f27ada55a1a3fd453 (diff) | |
download | samba-1ef99e76632f6f6b866de491db8722c94f75a8c2.tar.gz samba-1ef99e76632f6f6b866de491db8722c94f75a8c2.tar.xz samba-1ef99e76632f6f6b866de491db8722c94f75a8c2.zip |
Honour return value of to_struct() when converting to Samba structures.
Diffstat (limited to 'source')
-rw-r--r-- | source/python/py_spoolss_jobs_conv.c | 3 | ||||
-rw-r--r-- | source/python/py_spoolss_printers_conv.c | 18 |
2 files changed, 15 insertions, 6 deletions
diff --git a/source/python/py_spoolss_jobs_conv.c b/source/python/py_spoolss_jobs_conv.c index 3481e964851..cb04ec6713c 100644 --- a/source/python/py_spoolss_jobs_conv.c +++ b/source/python/py_spoolss_jobs_conv.c @@ -98,6 +98,5 @@ BOOL py_from_DOC_INFO_1(PyObject **dict, DOC_INFO_1 *info) BOOL py_to_DOC_INFO_1(DOC_INFO_1 *info, PyObject *dict) { - to_struct(info, dict, py_DOC_INFO_1); - return True; + return to_struct(info, dict, py_DOC_INFO_1); } diff --git a/source/python/py_spoolss_printers_conv.c b/source/python/py_spoolss_printers_conv.c index 676e21e99ea..247db65b1ef 100644 --- a/source/python/py_spoolss_printers_conv.c +++ b/source/python/py_spoolss_printers_conv.c @@ -163,7 +163,8 @@ BOOL py_to_DEVICEMODE(DEVICEMODE *devmode, PyObject *dict) { PyObject *obj; - to_struct(devmode, dict, py_DEVICEMODE); + if (!to_struct(devmode, dict, py_DEVICEMODE)) + return False; if (!(obj = PyDict_GetItemString(dict, "private"))) return False; @@ -203,7 +204,14 @@ BOOL py_from_PRINTER_INFO_1(PyObject **dict, PRINTER_INFO_1 *info) BOOL py_to_PRINTER_INFO_1(PRINTER_INFO_1 *info, PyObject *dict) { - return False; + PyObject *dict_copy = PyDict_Copy(dict); + BOOL result; + + PyDict_DelItemString(dict_copy, "level"); + result = to_struct(info, dict_copy, py_PRINTER_INFO_1); + + Py_DECREF(dict_copy); + return result; } /* @@ -232,7 +240,8 @@ BOOL py_to_PRINTER_INFO_2(PRINTER_INFO_2 *info, PyObject *dict, { PyObject *obj; - to_struct(info, dict, py_PRINTER_INFO_2); + if (!to_struct(info, dict, py_PRINTER_INFO_2)) + return False; if (!(obj = PyDict_GetItemString(dict, "security_descriptor"))) return False; @@ -274,7 +283,8 @@ BOOL py_to_PRINTER_INFO_3(PRINTER_INFO_3 *info, PyObject *dict, { PyObject *obj; - to_struct(info, dict, py_PRINTER_INFO_3); + if (!to_struct(info, dict, py_PRINTER_INFO_3)) + return False; if (!(obj = PyDict_GetItemString(dict, "security_descriptor"))) return False; |