mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
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
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
dbc03125f2
commit
7ca24b9966
@ -45,6 +45,8 @@ void py_samba_init(void)
|
|||||||
if (initialised)
|
if (initialised)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
load_case_tables();
|
||||||
|
|
||||||
/* Load configuration file */
|
/* Load configuration file */
|
||||||
|
|
||||||
if (!lp_load(dyn_CONFIGFILE, True, False, False, True))
|
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;
|
char *username, *password, *domain;
|
||||||
struct cli_state *cli;
|
struct cli_state *cli;
|
||||||
|
struct rpc_pipe_client *pipe_hnd;
|
||||||
NTSTATUS result;
|
NTSTATUS result;
|
||||||
|
|
||||||
/* Extract credentials from the python dictionary */
|
/* Extract credentials from the python dictionary */
|
||||||
@ -230,7 +233,8 @@ struct cli_state *open_pipe_creds(char *server, PyObject *creds,
|
|||||||
return NULL;
|
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);
|
cli_shutdown(cli);
|
||||||
asprintf(errstr, "error opening pipe index %d", pipe_idx);
|
asprintf(errstr, "error opening pipe index %d", pipe_idx);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -315,11 +315,16 @@ PyObject *spoolss_hnd_enumprinterdataex(PyObject *self, PyObject *args, PyObject
|
|||||||
char *key;
|
char *key;
|
||||||
WERROR werror;
|
WERROR werror;
|
||||||
PyObject *result;
|
PyObject *result;
|
||||||
REGVAL_CTR ctr;
|
REGVAL_CTR *ctr;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "s", kwlist, &key))
|
if (!PyArg_ParseTupleAndKeywords(args, kw, "s", kwlist, &key))
|
||||||
return NULL;
|
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 */
|
/* Get max buffer sizes for value and data */
|
||||||
|
|
||||||
werror = rpccli_spoolss_enumprinterdataex(
|
werror = rpccli_spoolss_enumprinterdataex(
|
||||||
|
Reference in New Issue
Block a user