diff options
Diffstat (limited to 'sftp-client.c')
-rw-r--r-- | sftp-client.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sftp-client.c b/sftp-client.c index 30bef8936..df9838648 100644 --- a/sftp-client.c +++ b/sftp-client.c | |||
@@ -28,7 +28,7 @@ | |||
28 | /* XXX: copy between two remote sites */ | 28 | /* XXX: copy between two remote sites */ |
29 | 29 | ||
30 | #include "includes.h" | 30 | #include "includes.h" |
31 | RCSID("$OpenBSD: sftp-client.c,v 1.36 2002/11/05 20:10:37 markus Exp $"); | 31 | RCSID("$OpenBSD: sftp-client.c,v 1.37 2002/11/21 23:03:51 deraadt Exp $"); |
32 | 32 | ||
33 | #include "openbsd-compat/sys-queue.h" | 33 | #include "openbsd-compat/sys-queue.h" |
34 | 34 | ||
@@ -857,9 +857,9 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, | |||
857 | (unsigned long long)req->offset + len - 1); | 857 | (unsigned long long)req->offset + len - 1); |
858 | if (len > req->len) | 858 | if (len > req->len) |
859 | fatal("Received more data than asked for " | 859 | fatal("Received more data than asked for " |
860 | "%u > %u", len, req->len); | 860 | "%u > %u", len, req->len); |
861 | if ((lseek(local_fd, req->offset, SEEK_SET) == -1 || | 861 | if ((lseek(local_fd, req->offset, SEEK_SET) == -1 || |
862 | atomicio(write, local_fd, data, len) != len) && | 862 | atomicio(write, local_fd, data, len) != len) && |
863 | !write_error) { | 863 | !write_error) { |
864 | write_errno = errno; | 864 | write_errno = errno; |
865 | write_error = 1; | 865 | write_error = 1; |
@@ -930,7 +930,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, | |||
930 | if (pflag && chmod(local_path, mode) == -1) | 930 | if (pflag && chmod(local_path, mode) == -1) |
931 | #endif /* HAVE_FCHMOD */ | 931 | #endif /* HAVE_FCHMOD */ |
932 | error("Couldn't set mode on \"%s\": %s", local_path, | 932 | error("Couldn't set mode on \"%s\": %s", local_path, |
933 | strerror(errno)); | 933 | strerror(errno)); |
934 | if (pflag && (a->flags & SSH2_FILEXFER_ATTR_ACMODTIME)) { | 934 | if (pflag && (a->flags & SSH2_FILEXFER_ATTR_ACMODTIME)) { |
935 | struct timeval tv[2]; | 935 | struct timeval tv[2]; |
936 | tv[0].tv_sec = a->atime; | 936 | tv[0].tv_sec = a->atime; |
@@ -938,7 +938,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, | |||
938 | tv[0].tv_usec = tv[1].tv_usec = 0; | 938 | tv[0].tv_usec = tv[1].tv_usec = 0; |
939 | if (utimes(local_path, tv) == -1) | 939 | if (utimes(local_path, tv) == -1) |
940 | error("Can't set times on \"%s\": %s", | 940 | error("Can't set times on \"%s\": %s", |
941 | local_path, strerror(errno)); | 941 | local_path, strerror(errno)); |
942 | } | 942 | } |
943 | } | 943 | } |
944 | close(local_fd); | 944 | close(local_fd); |
@@ -1047,7 +1047,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, | |||
1047 | buffer_put_string(&msg, data, len); | 1047 | buffer_put_string(&msg, data, len); |
1048 | send_msg(conn->fd_out, &msg); | 1048 | send_msg(conn->fd_out, &msg); |
1049 | debug3("Sent message SSH2_FXP_WRITE I:%u O:%llu S:%u", | 1049 | debug3("Sent message SSH2_FXP_WRITE I:%u O:%llu S:%u", |
1050 | id, (unsigned long long)offset, len); | 1050 | id, (unsigned long long)offset, len); |
1051 | } else if (TAILQ_FIRST(&acks) == NULL) | 1051 | } else if (TAILQ_FIRST(&acks) == NULL) |
1052 | break; | 1052 | break; |
1053 | 1053 | ||
@@ -1081,7 +1081,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, | |||
1081 | 1081 | ||
1082 | if (status != SSH2_FX_OK) { | 1082 | if (status != SSH2_FX_OK) { |
1083 | error("Couldn't write to remote file \"%s\": %s", | 1083 | error("Couldn't write to remote file \"%s\": %s", |
1084 | remote_path, fx2txt(status)); | 1084 | remote_path, fx2txt(status)); |
1085 | do_close(conn, handle, handle_len); | 1085 | do_close(conn, handle, handle_len); |
1086 | close(local_fd); | 1086 | close(local_fd); |
1087 | goto done; | 1087 | goto done; |