summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/utils/net_rpc_printer.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index 8e8b140d37..a8221d0931 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -381,11 +381,20 @@ NTSTATUS net_copy_file(struct net_context *c,
while (is_file) {
/* copying file */
- int n;
- n = cli_read_old(cli_share_src, fnum_src, data, nread,
- read_size);
+ size_t n;
- if (n <= 0)
+ nt_status = cli_read(cli_share_src, fnum_src, data, nread,
+ read_size, &n);
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ d_fprintf(stderr,
+ _("Error reading file [\\\\%s\%s%s]: %s\n"),
+ cli_state_remote_name(cli_share_src),
+ cli_share_src->share,
+ src_name, nt_errstr(nt_status));
+ goto out;
+ }
+
+ if (n == 0)
break;
nt_status = cli_writeall(cli_share_dst, fnum_dst, 0,