if (copy_acls) {
/* get the security descriptor */
- sd = cli_query_secdesc(cli_share_src, fnum_src, mem_ctx);
+ sd = cli_query_secdesc_old(cli_share_src, fnum_src, mem_ctx);
if (!sd) {
DEBUG(0,("failed to get security descriptor: %s\n",
cli_errstr(cli_share_src)));
d_printf(_("copying [\\\\%s\\%s%s] => [\\\\%s\\%s%s] "
"%s ACLs and %s DOS Attributes %s\n"),
- cli_share_src->desthost, cli_share_src->share, src_name,
- cli_share_dst->desthost, cli_share_dst->share, dst_name,
+ cli_state_remote_name(cli_share_src),
+ cli_share_src->share, src_name,
+ cli_state_remote_name(cli_share_dst),
+ cli_share_dst->share, dst_name,
copy_acls ? _("with") : _("without"),
copy_attrs ? _("with") : _("without"),
copy_timestamps ? _("(preserving timestamps)") : "" );
while (is_file) {
/* copying file */
- int n;
- n = cli_read(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,
(uint8_t *)data, nread, n, NULL);
if (!NT_STATUS_IS_OK(nt_status)) {
- d_fprintf(stderr, _("Error writing file: %s\n"),
- nt_errstr(nt_status));
+ d_fprintf(stderr,
+ _("Error writing file: [\\\\%s\%s%s]: %s\n"),
+ cli_state_remote_name(cli_share_dst),
+ cli_share_dst->share,
+ dst_name, nt_errstr(nt_status));
goto out;
}
b_dst = pipe_hnd_dst->binding_handle;
/* open print$-share on the src server */
- nt_status = connect_to_service(c, &cli_share_src, &cli->dest_ss,
- cli->desthost, "print$", "A:");
+ nt_status = connect_to_service(c, &cli_share_src,
+ cli_state_remote_sockaddr(cli),
+ cli_state_remote_name(cli),
+ "print$", "A:");
if (!NT_STATUS_IS_OK(nt_status))
goto done;
/* open print$-share on the dst server */
- nt_status = connect_to_service(c, &cli_share_dst, &cli_dst->dest_ss,
- cli_dst->desthost, "print$", "A:");
+ nt_status = connect_to_service(c, &cli_share_dst,
+ cli_state_remote_sockaddr(cli_dst),
+ cli_state_remote_name(cli_dst),
+ "print$", "A:");
if (!NT_STATUS_IS_OK(nt_status))
return nt_status;