svn commit: samba r15299 - branches/SAMBA_3_0/source/python trunk/source/python

deryck at samba.org deryck at samba.org
Thu Apr 27 20:52:05 GMT 2006


Author: deryck
Date: 2006-04-27 20:52:04 +0000 (Thu, 27 Apr 2006)
New Revision: 15299

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15299

Log:
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

Modified:
   branches/SAMBA_3_0/source/python/py_common.c
   branches/SAMBA_3_0/source/python/py_spoolss_printerdata.c
   trunk/source/python/py_common.c
   trunk/source/python/py_spoolss_printerdata.c


Changeset:
Modified: branches/SAMBA_3_0/source/python/py_common.c
===================================================================
--- branches/SAMBA_3_0/source/python/py_common.c	2006-04-27 19:50:13 UTC (rev 15298)
+++ branches/SAMBA_3_0/source/python/py_common.c	2006-04-27 20:52:04 UTC (rev 15299)
@@ -45,6 +45,8 @@
 	if (initialised)
 		return;
 
+	load_case_tables();
+
 	/* Load configuration file */
 
 	if (!lp_load(dyn_CONFIGFILE, True, False, False, True))
@@ -212,6 +214,7 @@
 {
 	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 @@
 		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;

Modified: branches/SAMBA_3_0/source/python/py_spoolss_printerdata.c
===================================================================
--- branches/SAMBA_3_0/source/python/py_spoolss_printerdata.c	2006-04-27 19:50:13 UTC (rev 15298)
+++ branches/SAMBA_3_0/source/python/py_spoolss_printerdata.c	2006-04-27 20:52:04 UTC (rev 15299)
@@ -315,11 +315,16 @@
 	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(

Modified: trunk/source/python/py_common.c
===================================================================
--- trunk/source/python/py_common.c	2006-04-27 19:50:13 UTC (rev 15298)
+++ trunk/source/python/py_common.c	2006-04-27 20:52:04 UTC (rev 15299)
@@ -45,6 +45,8 @@
 	if (initialised)
 		return;
 
+	load_case_tables();
+
 	/* Load configuration file */
 
 	if (!lp_load(dyn_CONFIGFILE, True, False, False, True))
@@ -212,6 +214,7 @@
 {
 	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 @@
 		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;

Modified: trunk/source/python/py_spoolss_printerdata.c
===================================================================
--- trunk/source/python/py_spoolss_printerdata.c	2006-04-27 19:50:13 UTC (rev 15298)
+++ trunk/source/python/py_spoolss_printerdata.c	2006-04-27 20:52:04 UTC (rev 15299)
@@ -315,11 +315,16 @@
 	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(



More information about the samba-cvs mailing list