summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-05-27 06:29:58 +0000
committerTim Potter <tpot@samba.org>2002-05-27 06:29:58 +0000
commitbf7ca61cb4af4b156d954098ffa04cfa14a25641 (patch)
treed3009da6d7fbdde24392280803793b9054284f02 /source3
parent3ec6d94f959d55f83dc065aee99abf49603a118b (diff)
downloadsamba-bf7ca61cb4af4b156d954098ffa04cfa14a25641.tar.gz
samba-bf7ca61cb4af4b156d954098ffa04cfa14a25641.tar.bz2
samba-bf7ca61cb4af4b156d954098ffa04cfa14a25641.zip
Honour return value of to_struct() when converting to Samba structures.
(This used to be commit 1ef99e76632f6f6b866de491db8722c94f75a8c2)
Diffstat (limited to 'source3')
-rw-r--r--source3/python/py_spoolss_jobs_conv.c3
-rw-r--r--source3/python/py_spoolss_printers_conv.c18
2 files changed, 15 insertions, 6 deletions
diff --git a/source3/python/py_spoolss_jobs_conv.c b/source3/python/py_spoolss_jobs_conv.c
index 3481e96485..cb04ec6713 100644
--- a/source3/python/py_spoolss_jobs_conv.c
+++ b/source3/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/source3/python/py_spoolss_printers_conv.c b/source3/python/py_spoolss_printers_conv.c
index 676e21e99e..247db65b1e 100644
--- a/source3/python/py_spoolss_printers_conv.c
+++ b/source3/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;