summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-05-10 14:44:30 +0200
committerGünther Deschner <gd@samba.org>2010-05-10 14:51:14 +0200
commit83736066a3f94eaadb422016c9f22cb18bec2cd7 (patch)
treeddf6ef1e61c7401003a2d85e88084eef88577c9f /source3/rpcclient
parented39e9b67f38312b6786172e80b4d7057dbd513a (diff)
downloadsamba-83736066a3f94eaadb422016c9f22cb18bec2cd7.tar.gz
samba-83736066a3f94eaadb422016c9f22cb18bec2cd7.tar.bz2
samba-83736066a3f94eaadb422016c9f22cb18bec2cd7.zip
s3-rpcclient: fix two more invalid typecasts in spoolss commands.
Guenther
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c56
1 files changed, 47 insertions, 9 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 2a04a8c64e..6b62bdeb52 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -462,6 +462,7 @@ static WERROR cmd_spoolss_setprinter(struct rpc_pipe_client *cli,
uint32_t info_level = 2;
union spoolss_PrinterInfo info;
struct spoolss_SetPrinterInfoCtr info_ctr;
+ struct spoolss_SetPrinterInfo2 info2;
const char *printername, *comment = NULL;
struct spoolss_DevmodeContainer devmode_ctr;
struct sec_desc_buf secdesc_ctr;
@@ -501,12 +502,30 @@ static WERROR cmd_spoolss_setprinter(struct rpc_pipe_client *cli,
/* Modify the comment. */
- info.info2.comment = comment;
- info.info2.secdesc = NULL;
- info.info2.devmode = NULL;
+ info2.servername = info.info2.servername;
+ info2.printername = info.info2.printername;
+ info2.sharename = info.info2.sharename;
+ info2.portname = info.info2.portname;
+ info2.drivername = info.info2.drivername;
+ info2.comment = comment;
+ info2.location = info.info2.location;
+ info2.devmode_ptr = 0;
+ info2.sepfile = info.info2.sepfile;
+ info2.printprocessor = info.info2.printprocessor;
+ info2.datatype = info.info2.datatype;
+ info2.parameters = info.info2.parameters;
+ info2.secdesc_ptr = 0;
+ info2.attributes = info.info2.attributes;
+ info2.priority = info.info2.priority;
+ info2.defaultpriority = info.info2.defaultpriority;
+ info2.starttime = info.info2.starttime;
+ info2.untiltime = info.info2.untiltime;
+ info2.status = info.info2.status;
+ info2.cjobs = info.info2.cjobs;
+ info2.averageppm = info.info2.averageppm;
info_ctr.level = 2;
- info_ctr.info.info2 = (struct spoolss_SetPrinterInfo2 *)&info.info2;
+ info_ctr.info.info2 = &info2;
status = rpccli_spoolss_SetPrinter(cli, mem_ctx,
&pol,
@@ -540,6 +559,7 @@ static WERROR cmd_spoolss_setprintername(struct rpc_pipe_client *cli,
const char *printername,
*new_printername = NULL;
struct spoolss_SetPrinterInfoCtr info_ctr;
+ struct spoolss_SetPrinterInfo2 info2;
struct spoolss_DevmodeContainer devmode_ctr;
struct sec_desc_buf secdesc_ctr;
@@ -577,12 +597,30 @@ static WERROR cmd_spoolss_setprintername(struct rpc_pipe_client *cli,
goto done;
/* Modify the printername. */
- info.info2.printername = new_printername;
- info.info2.devmode = NULL;
- info.info2.secdesc = NULL;
+ info2.servername = info.info2.servername;
+ info2.printername = new_printername;
+ info2.sharename = info.info2.sharename;
+ info2.portname = info.info2.portname;
+ info2.drivername = info.info2.drivername;
+ info2.comment = info.info2.comment;
+ info2.location = info.info2.location;
+ info2.devmode_ptr = 0;
+ info2.sepfile = info.info2.sepfile;
+ info2.printprocessor = info.info2.printprocessor;
+ info2.datatype = info.info2.datatype;
+ info2.parameters = info.info2.parameters;
+ info2.secdesc_ptr = 0;
+ info2.attributes = info.info2.attributes;
+ info2.priority = info.info2.priority;
+ info2.defaultpriority = info.info2.defaultpriority;
+ info2.starttime = info.info2.starttime;
+ info2.untiltime = info.info2.untiltime;
+ info2.status = info.info2.status;
+ info2.cjobs = info.info2.cjobs;
+ info2.averageppm = info.info2.averageppm;
- info_ctr.level = info_level;
- info_ctr.info.info2 = (struct spoolss_SetPrinterInfo2 *)&info.info2;
+ info_ctr.level = 2;
+ info_ctr.info.info2 = &info2;
status = rpccli_spoolss_SetPrinter(cli, mem_ctx,
&pol,