summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-07-06 16:04:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:07 -0500
commit924ddbac4826078066e07b4dc7f928cc65bff00a (patch)
tree50dc1e71c2a14adf285fc4e346b02f58f37c20fe /source3
parent776aa21df563495379c9666ca4aa478c46125590 (diff)
downloadsamba-924ddbac4826078066e07b4dc7f928cc65bff00a.tar.gz
samba-924ddbac4826078066e07b4dc7f928cc65bff00a.tar.bz2
samba-924ddbac4826078066e07b4dc7f928cc65bff00a.zip
r1361: patch from Guenther Deschner <gd@sernet.de> to ensure that REG_SZ values in the SetPrinterData actually get written in UNICODE strings rather than ASCII
(This used to be commit 29000c1f800c35d5434b39b7c76fe7f10afaaecc)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpcclient/cmd_spoolss.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 0d6740257d..38558ec3d4 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -1914,6 +1914,7 @@ static WERROR cmd_spoolss_setprinterdata(struct cli_state *cli,
PRINTER_INFO_CTR ctr;
PRINTER_INFO_0 info;
REGISTRY_VALUE value;
+ UNISTR2 data;
/* parse the command arguements */
if (argc != 4) {
@@ -1951,10 +1952,11 @@ static WERROR cmd_spoolss_setprinterdata(struct cli_state *cli,
/* Set the printer data */
+ init_unistr2(&data, argv[3], UNI_STR_TERMINATE);
fstrcpy(value.valuename, argv[2]);
value.type = REG_SZ;
- value.size = strlen(argv[3]) + 1;
- value.data_p = talloc_memdup(mem_ctx, argv[3], value.size);
+ value.size = data.uni_str_len * 2;
+ value.data_p = talloc_memdup(mem_ctx, data.buffer, value.size);
result = cli_spoolss_setprinterdata(cli, mem_ctx, &pol, &value);