summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-16 23:38:05 +0100
committerGünther Deschner <gd@samba.org>2009-03-17 12:18:43 +0100
commite0c50aafce59ad4f4275ff91defb14ea44f42a65 (patch)
tree0e2d05acb1e29c6a67b0104e9e56c614d0918e49 /source3/utils
parentbc95ec04e6b555b1dd2ce9d253c5a3fc3f095443 (diff)
downloadsamba-e0c50aafce59ad4f4275ff91defb14ea44f42a65.tar.gz
samba-e0c50aafce59ad4f4275ff91defb14ea44f42a65.tar.bz2
samba-e0c50aafce59ad4f4275ff91defb14ea44f42a65.zip
s3-net: use rpccli_spoolss_enumprinterkey wrapper.
Guenther
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc_printer.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index 43ef412d90..effd23668f 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -846,12 +846,12 @@ static bool net_spoolss_enumprinterkey(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
POLICY_HND *hnd,
const char *keyname,
- uint16 **keylist)
+ const char ***keylist)
{
WERROR result;
/* enumprinterkey call */
- result = rpccli_spoolss_enumprinterkey(pipe_hnd, mem_ctx, hnd, keyname, keylist, NULL);
+ result = rpccli_spoolss_enumprinterkey(pipe_hnd, mem_ctx, hnd, keyname, keylist, 0);
if (!W_ERROR_IS_OK(result)) {
printf("enumprinterkey failed: %s\n", win_errstr(result));
@@ -2146,8 +2146,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
struct cli_state *cli_dst = NULL;
char *devicename = NULL, *unc_name = NULL, *url = NULL;
const char *longname;
-
- uint16 *keylist = NULL, *curkey;
+ const char **keylist = NULL;
/* FIXME GD */
ZERO_STRUCT(info_dst_publish);
@@ -2367,19 +2366,9 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
if (keylist == NULL)
continue;
- curkey = keylist;
- while (*curkey != 0) {
- char *subkey;
- rpcstr_pull_talloc(mem_ctx,
- &subkey,
- curkey,
- -1,
- STR_TERMINATE);
- if (!subkey) {
- return NT_STATUS_NO_MEMORY;
- }
+ for (i=0; keylist && keylist[i] != NULL; i++) {
- curkey += strlen(subkey) + 1;
+ const char *subkey = keylist[i];
if ( !(reg_ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) )
return NT_STATUS_NO_MEMORY;
@@ -2484,7 +2473,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
TALLOC_FREE( reg_ctr );
}
- SAFE_FREE(keylist);
+ TALLOC_FREE(keylist);
/* close printer handles here */
if (is_valid_policy_hnd(&hnd_src)) {