X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/30e37ee6a39f14e649ce9905eaa8631be74c35a5..e2ef2342e2ea26be7a29beb55ea2674e2cd9cf6c:/sftp-client.c diff --git a/sftp-client.c b/sftp-client.c index c797482a..df983864 100644 --- a/sftp-client.c +++ b/sftp-client.c @@ -28,9 +28,9 @@ /* XXX: copy between two remote sites */ #include "includes.h" -RCSID("$OpenBSD: sftp-client.c,v 1.34 2002/06/27 10:35:47 deraadt Exp $"); +RCSID("$OpenBSD: sftp-client.c,v 1.37 2002/11/21 23:03:51 deraadt Exp $"); -#include "openbsd-compat/fake-queue.h" +#include "openbsd-compat/sys-queue.h" #include "buffer.h" #include "bufaux.h" @@ -414,12 +414,6 @@ do_lsreaddir(struct sftp_conn *conn, char *path, int printflag, return(0); } -int -do_ls(struct sftp_conn *conn, char *path) -{ - return(do_lsreaddir(conn, path, 1, NULL)); -} - int do_readdir(struct sftp_conn *conn, char *path, SFTP_DIRENT ***dir) { @@ -666,7 +660,7 @@ do_symlink(struct sftp_conn *conn, char *oldpath, char *newpath) status = get_status(conn->fd_in, id); if (status != SSH2_FX_OK) - error("Couldn't rename file \"%s\" to \"%s\": %s", oldpath, + error("Couldn't symlink file \"%s\" to \"%s\": %s", oldpath, newpath, fx2txt(status)); return(status); @@ -863,9 +857,9 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, (unsigned long long)req->offset + len - 1); if (len > req->len) fatal("Received more data than asked for " - "%u > %u", len, req->len); + "%u > %u", len, req->len); if ((lseek(local_fd, req->offset, SEEK_SET) == -1 || - atomicio(write, local_fd, data, len) != len) && + atomicio(write, local_fd, data, len) != len) && !write_error) { write_errno = errno; write_error = 1; @@ -936,7 +930,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, if (pflag && chmod(local_path, mode) == -1) #endif /* HAVE_FCHMOD */ error("Couldn't set mode on \"%s\": %s", local_path, - strerror(errno)); + strerror(errno)); if (pflag && (a->flags & SSH2_FILEXFER_ATTR_ACMODTIME)) { struct timeval tv[2]; tv[0].tv_sec = a->atime; @@ -944,7 +938,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, tv[0].tv_usec = tv[1].tv_usec = 0; if (utimes(local_path, tv) == -1) error("Can't set times on \"%s\": %s", - local_path, strerror(errno)); + local_path, strerror(errno)); } } close(local_fd); @@ -1053,7 +1047,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, buffer_put_string(&msg, data, len); send_msg(conn->fd_out, &msg); debug3("Sent message SSH2_FXP_WRITE I:%u O:%llu S:%u", - id, (unsigned long long)offset, len); + id, (unsigned long long)offset, len); } else if (TAILQ_FIRST(&acks) == NULL) break; @@ -1087,7 +1081,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, if (status != SSH2_FX_OK) { error("Couldn't write to remote file \"%s\": %s", - remote_path, fx2txt(status)); + remote_path, fx2txt(status)); do_close(conn, handle, handle_len); close(local_fd); goto done;