summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_spoolss_nt.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-09-29 06:17:09 +0000
committerTim Potter <tpot@samba.org>2003-09-29 06:17:09 +0000
commit5400952f7f74d6e656fcf4ded173868ecec3cb77 (patch)
tree24ac373cfcffe454faaac14ffd7c8f572d7c2c63 /source3/rpc_server/srv_spoolss_nt.c
parent64dbd7cbff3fa7a4e560571ec38207a7176e4646 (diff)
downloadsamba-5400952f7f74d6e656fcf4ded173868ecec3cb77.tar.gz
samba-5400952f7f74d6e656fcf4ded173868ecec3cb77.tar.bz2
samba-5400952f7f74d6e656fcf4ded173868ecec3cb77.zip
Merge from 3.0:
>Fix for #480. Change the interface for init_unistr2 to not take a length >but a flags field. We were assuming that 2*strlen(mb_string) == length of ucs2-le string. >This is not the case. Count it after conversion. >Jeremy. (This used to be commit e2ab9e54cd0ec0002175cf18ff364f4aebaf85a0)
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 7159527a7d..493f58f8a8 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -690,7 +690,7 @@ static void notify_string(struct spoolss_notify_msg *msg,
/* The length of the message includes the trailing \0 */
- init_unistr2(&unistr, msg->notify.data, msg->len);
+ init_unistr2(&unistr, msg->notify.data, UNI_STR_TERMINATE);
data->notify_data.data.length = msg->len * 2;
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, msg->len * 2);
@@ -6121,7 +6121,7 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
*/
if (!strequal(printer->info_2->comment, old_printer->info_2->comment)) {
- init_unistr2( &buffer, printer->info_2->comment, strlen(printer->info_2->comment)+1 );
+ init_unistr2( &buffer, printer->info_2->comment, UNI_STR_TERMINATE);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "description",
REG_SZ, (uint8*)buffer.buffer, buffer.uni_str_len*2 );
@@ -6129,7 +6129,7 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
}
if (!strequal(printer->info_2->sharename, old_printer->info_2->sharename)) {
- init_unistr2( &buffer, printer->info_2->sharename, strlen(printer->info_2->sharename)+1 );
+ init_unistr2( &buffer, printer->info_2->sharename, UNI_STR_TERMINATE);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "printerName",
REG_SZ, (uint8*)buffer.buffer, buffer.uni_str_len*2 );
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "shareName",
@@ -6139,7 +6139,7 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
}
if (!strequal(printer->info_2->portname, old_printer->info_2->portname)) {
- init_unistr2( &buffer, printer->info_2->portname, strlen(printer->info_2->portname)+1 );
+ init_unistr2( &buffer, printer->info_2->portname, UNI_STR_TERMINATE);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "portName",
REG_SZ, (uint8*)buffer.buffer, buffer.uni_str_len*2 );
@@ -6147,7 +6147,7 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
}
if (!strequal(printer->info_2->location, old_printer->info_2->location)) {
- init_unistr2( &buffer, printer->info_2->location, strlen(printer->info_2->location)+1 );
+ init_unistr2( &buffer, printer->info_2->location, UNI_STR_TERMINATE);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "location",
REG_SZ, (uint8*)buffer.buffer, buffer.uni_str_len*2 );
@@ -6157,7 +6157,7 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
/* here we need to update some more DsSpooler keys */
/* uNCName, serverName, shortServerName */
- init_unistr2( &buffer, global_myname(), strlen(global_myname())+1 );
+ init_unistr2( &buffer, global_myname(), UNI_STR_TERMINATE);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "serverName",
REG_SZ, (uint8*)buffer.buffer, buffer.uni_str_len*2 );
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "shortServerName",
@@ -6165,7 +6165,7 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
slprintf( asc_buffer, sizeof(asc_buffer)-1, "\\\\%s\\%s",
global_myname(), printer->info_2->sharename );
- init_unistr2( &buffer, asc_buffer, strlen(asc_buffer)+1 );
+ init_unistr2( &buffer, asc_buffer, UNI_STR_TERMINATE);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "uNCName",
REG_SZ, (uint8*)buffer.buffer, buffer.uni_str_len*2 );