summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc_printer.c
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2011-07-22 13:39:05 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-23 09:18:46 +0200
commitfd7631c633ec0909b3d28f94f038e1e01f9e4886 (patch)
treeb90d7619df5bcf38789bd6f89cad68dbe5fa5002 /source3/utils/net_rpc_printer.c
parent4b76c108ba2e567a7a2c96274590488a39d1c045 (diff)
downloadsamba-fd7631c633ec0909b3d28f94f038e1e01f9e4886.tar.gz
samba-fd7631c633ec0909b3d28f94f038e1e01f9e4886.tar.bz2
samba-fd7631c633ec0909b3d28f94f038e1e01f9e4886.zip
s3-utils/net_rpc_printer.c: return on read error in net_copy_file()
replace cli_read_old() with cli_read() Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/utils/net_rpc_printer.c')
-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,