diff options
author | Deryck Hodge <deryck@samba.org> | 2006-04-27 20:52:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:16:32 -0500 |
commit | 7ca24b996628707b7e8a05041d173f046f428413 (patch) | |
tree | 0b78abcfe6dca8ecb8a4ab880983020211f199ad /source | |
parent | dbc03125f2643f8ecff8e901cb23fa6408cce011 (diff) | |
download | samba-7ca24b996628707b7e8a05041d173f046f428413.tar.gz samba-7ca24b996628707b7e8a05041d173f046f428413.tar.xz samba-7ca24b996628707b7e8a05041d173f046f428413.zip |
r15299: Fix import of Python modules. Fixes Bug #3567.
The REGVAL_CTR part is taken from Daniel Jarboe's
patch he filed with the bug report.
deryck
Diffstat (limited to 'source')
-rw-r--r-- | source/python/py_common.c | 6 | ||||
-rw-r--r-- | source/python/py_spoolss_printerdata.c | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/source/python/py_common.c b/source/python/py_common.c index 70d478b9797..14c3b83e547 100644 --- a/source/python/py_common.c +++ b/source/python/py_common.c @@ -45,6 +45,8 @@ void py_samba_init(void) if (initialised) return; + load_case_tables(); + /* Load configuration file */ if (!lp_load(dyn_CONFIGFILE, True, False, False, True)) @@ -212,6 +214,7 @@ struct cli_state *open_pipe_creds(char *server, PyObject *creds, { char *username, *password, *domain; struct cli_state *cli; + struct rpc_pipe_client *pipe_hnd; NTSTATUS result; /* Extract credentials from the python dictionary */ @@ -230,7 +233,8 @@ struct cli_state *open_pipe_creds(char *server, PyObject *creds, return NULL; } - if (!cli_nt_session_open(cli, pipe_idx)) { + pipe_hnd = cli_rpc_pipe_open_noauth(cli, pipe_idx, &result); + if (!pipe_hnd) { cli_shutdown(cli); asprintf(errstr, "error opening pipe index %d", pipe_idx); return NULL; diff --git a/source/python/py_spoolss_printerdata.c b/source/python/py_spoolss_printerdata.c index 195f01f62d8..e89f985fefd 100644 --- a/source/python/py_spoolss_printerdata.c +++ b/source/python/py_spoolss_printerdata.c @@ -315,11 +315,16 @@ PyObject *spoolss_hnd_enumprinterdataex(PyObject *self, PyObject *args, PyObject char *key; WERROR werror; PyObject *result; - REGVAL_CTR ctr; + REGVAL_CTR *ctr; if (!PyArg_ParseTupleAndKeywords(args, kw, "s", kwlist, &key)) return NULL; + if (!(ctr = TALLOC_ZERO_P(hnd->mem_ctx, REGVAL_CTR))) { + PyErr_SetObject(spoolss_werror, py_werror_tuple(werror)); + return NULL; + } + /* Get max buffer sizes for value and data */ werror = rpccli_spoolss_enumprinterdataex( |