diff options
author | Günther Deschner <gd@samba.org> | 2009-09-23 20:46:08 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-09-30 00:29:49 +0200 |
commit | 2c11b73391551723e4ada8664b1ba77873420217 (patch) | |
tree | 9cd85bb729c6aa7e2801ebbcd9acbed39f7e8054 /source3/utils | |
parent | fcee9d2c97a673347baf58f749f35785a896e468 (diff) | |
download | samba-2c11b73391551723e4ada8664b1ba77873420217.tar.gz samba-2c11b73391551723e4ada8664b1ba77873420217.tar.bz2 samba-2c11b73391551723e4ada8664b1ba77873420217.zip |
s3-registry: use push_reg_sz().
Guenther
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rpc_printer.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index ea7465e33a..c3924efc6a 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -2418,7 +2418,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, for (j=0; j < count; j++) { struct regval_blob value; - UNISTR2 data; + DATA_BLOB blob; /* although samba replies with sane data in most cases we should try to avoid writing wrong registry data */ @@ -2432,7 +2432,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, if (strequal(info[j].value_name, SPOOL_REG_PORTNAME)) { /* although windows uses a multi-sz, we use a sz */ - init_unistr2(&data, SAMBA_PRINTER_PORT_NAME, UNI_STR_TERMINATE); + push_reg_sz(mem_ctx, &blob, SAMBA_PRINTER_PORT_NAME); fstrcpy(value.valuename, SPOOL_REG_PORTNAME); } @@ -2442,7 +2442,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, nt_status = NT_STATUS_NO_MEMORY; goto done; } - init_unistr2(&data, unc_name, UNI_STR_TERMINATE); + push_reg_sz(mem_ctx, &blob, unc_name); fstrcpy(value.valuename, SPOOL_REG_UNCNAME); } @@ -2456,27 +2456,27 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, nt_status = NT_STATUS_NO_MEMORY; goto done; } - init_unistr2(&data, url, UNI_STR_TERMINATE); + push_reg_sz(mem_ctx, &blob, url); fstrcpy(value.valuename, SPOOL_REG_URL); #endif } if (strequal(info[j].value_name, SPOOL_REG_SERVERNAME)) { - init_unistr2(&data, longname, UNI_STR_TERMINATE); + push_reg_sz(mem_ctx, &blob, longname); fstrcpy(value.valuename, SPOOL_REG_SERVERNAME); } if (strequal(info[j].value_name, SPOOL_REG_SHORTSERVERNAME)) { - init_unistr2(&data, global_myname(), UNI_STR_TERMINATE); + push_reg_sz(mem_ctx, &blob, global_myname()); fstrcpy(value.valuename, SPOOL_REG_SHORTSERVERNAME); } value.type = REG_SZ; - value.size = data.uni_str_len * 2; + value.size = blob.length; if (value.size) { - value.data_p = (uint8_t *)TALLOC_MEMDUP(mem_ctx, data.buffer, value.size); + value.data_p = blob.data; } else { value.data_p = NULL; } @@ -2492,7 +2492,6 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, } else { struct regval_blob v; - DATA_BLOB blob; result = push_spoolss_PrinterData(mem_ctx, &blob, info[j].type, |