diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/net.c | 2 | ||||
-rw-r--r-- | source3/utils/net_rpc.c | 9 | ||||
-rw-r--r-- | source3/utils/net_rpc_printer.c | 20 |
3 files changed, 16 insertions, 15 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c index d4c96e9db8..e9332f58f7 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -219,7 +219,7 @@ NTSTATUS connect_to_ipc_anonymous(struct cli_state **c, * * @return Normal NTSTATUS return. **/ -NTSTATUS connect_pipe(struct cli_state **cli_dst, int pipe_num, BOOL *got_pipe) +NTSTATUS connect_dst_pipe(struct cli_state **cli_dst, int pipe_num, BOOL *got_pipe) { NTSTATUS nt_status; char *server_name = SMB_STRDUP("127.0.0.1"); diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 1c44e79f30..1134e718ad 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -2586,9 +2586,8 @@ static WERROR get_share_info(struct cli_state *cli, TALLOC_CTX *mem_ctx, init_enum_hnd(&hnd, 0); - result = cli_srvsvc_net_share_enum(cli, mem_ctx, level, ctr, - preferred_len, &hnd); - goto done; + return cli_srvsvc_net_share_enum(cli, mem_ctx, level, ctr, + preferred_len, &hnd); } /* request just one share */ @@ -2827,7 +2826,7 @@ rpc_share_migrate_shares_internals(const DOM_SID *domain_sid, const char *domain goto done; /* connect destination PI_SRVSVC */ - nt_status = connect_pipe(&cli_dst, PI_SRVSVC, &got_dst_srvsvc_pipe); + nt_status = connect_dst_pipe(&cli_dst, PI_SRVSVC, &got_dst_srvsvc_pipe); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; @@ -3235,7 +3234,7 @@ rpc_share_migrate_security_internals(const DOM_SID *domain_sid, const char *doma goto done; /* connect destination PI_SRVSVC */ - nt_status = connect_pipe(&cli_dst, PI_SRVSVC, &got_dst_srvsvc_pipe); + nt_status = connect_dst_pipe(&cli_dst, PI_SRVSVC, &got_dst_srvsvc_pipe); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index e2080cdc28..b47f43b178 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -780,8 +780,10 @@ copy_print_driver_3(TALLOC_CTX *mem_ctx, return nt_status; while (valid) { + rpcstr_pull(dependentfiles, i1->dependentfiles+length, sizeof(dependentfiles), -1, STR_TERMINATE); - length+=strlen(dependentfiles)+1; + length += strlen(dependentfiles)+1; + if (strlen(dependentfiles) > 0) { nt_status = net_copy_driverfile(mem_ctx, @@ -1468,7 +1470,7 @@ NTSTATUS rpc_printer_migrate_security_internals(const DOM_SID *domain_sid, const DEBUG(3,("copying printer ACLs\n")); /* connect destination PI_SPOOLSS */ - nt_status = connect_pipe(&cli_dst, PI_SPOOLSS, &got_dst_spoolss_pipe); + nt_status = connect_dst_pipe(&cli_dst, PI_SPOOLSS, &got_dst_spoolss_pipe); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; @@ -1617,7 +1619,7 @@ NTSTATUS rpc_printer_migrate_forms_internals(const DOM_SID *domain_sid, const ch DEBUG(3,("copying forms\n")); /* connect destination PI_SPOOLSS */ - nt_status = connect_pipe(&cli_dst, PI_SPOOLSS, &got_dst_spoolss_pipe); + nt_status = connect_dst_pipe(&cli_dst, PI_SPOOLSS, &got_dst_spoolss_pipe); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; @@ -1797,7 +1799,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(const DOM_SID *domain_sid, const DEBUG(3,("copying printer-drivers\n")); - nt_status = connect_pipe(&cli_dst, PI_SPOOLSS, &got_dst_spoolss_pipe); + nt_status = connect_dst_pipe(&cli_dst, PI_SPOOLSS, &got_dst_spoolss_pipe); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; @@ -1806,7 +1808,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(const DOM_SID *domain_sid, const nt_status = connect_to_service(&cli_share_src, &cli->dest_ip, cli->desthost, "print$", "A:"); if (!NT_STATUS_IS_OK(nt_status)) - return nt_status; + goto done; got_src_driver_share = True; @@ -1826,7 +1828,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(const DOM_SID *domain_sid, const goto done; } - if (!num_printers) { + if (num_printers == 0) { printf ("no printers found on server.\n"); nt_status = NT_STATUS_OK; goto done; @@ -2002,13 +2004,13 @@ NTSTATUS rpc_printer_migrate_printers_internals(const DOM_SID *domain_sid, const DEBUG(3,("copying printers\n")); /* connect destination PI_SPOOLSS */ - nt_status = connect_pipe(&cli_dst, PI_SPOOLSS, &got_dst_spoolss_pipe); + nt_status = connect_dst_pipe(&cli_dst, PI_SPOOLSS, &got_dst_spoolss_pipe); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; /* enum printers */ - if (!get_printer_info(cli, mem_ctx, 2, argc, argv, &num_printers, &ctr_enum)) { + if (!get_printer_info(cli, mem_ctx, level, argc, argv, &num_printers, &ctr_enum)) { nt_status = NT_STATUS_UNSUCCESSFUL; goto done; } @@ -2169,7 +2171,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(const DOM_SID *domain_sid, const DEBUG(3,("copying printer settings\n")); /* connect destination PI_SPOOLSS */ - nt_status = connect_pipe(&cli_dst, PI_SPOOLSS, &got_dst_spoolss_pipe); + nt_status = connect_dst_pipe(&cli_dst, PI_SPOOLSS, &got_dst_spoolss_pipe); if (!NT_STATUS_IS_OK(nt_status)) return nt_status; |