diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2022-02-01 23:11:12 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2022-02-01 23:11:12 +0000 |
commit | 9e937c9519df724bdae5c7d36189fb443f52a933 (patch) | |
tree | 9faa247af43ddd33f74e96e02a170db2735f1782 /usr.bin | |
parent | 3f50e850559be59f608433482954b819a5fdd3ac (diff) |
better match legacy scp behaviour: show un-expanded paths in error
messages. Spotted by and ok tb@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/scp.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index 7f94d74b94d..709eaf75902 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scp.c,v 1.243 2022/01/17 21:39:51 djm Exp $ */ +/* $OpenBSD: scp.c,v 1.244 2022/02/01 23:11:11 djm Exp $ */ /* * scp - secure remote copy. This is basically patched BSD rcp which * uses ssh to do the data transfer (instead of using rcmd). @@ -1279,12 +1279,11 @@ source_sftp(int argc, char *src, char *targ, struct sftp_conn *conn) if (src_is_dir && iamrecursive) { if (upload_dir(conn, src, abs_dst, pflag, SFTP_PROGRESS_ONLY, 0, 0, 1) != 0) { - error("failed to upload directory %s to %s", - src, abs_dst); + error("failed to upload directory %s to %s", src, targ); errs = 1; } } else if (do_upload(conn, src, abs_dst, pflag, 0, 0) != 0) { - error("failed to upload file %s to %s", src, abs_dst); + error("failed to upload file %s to %s", src, targ); errs = 1; } @@ -1477,9 +1476,9 @@ sink_sftp(int argc, char *dst, const char *src, struct sftp_conn *conn) debug3_f("copying remote %s to local %s", abs_src, dst); if ((r = remote_glob(conn, abs_src, GLOB_MARK, NULL, &g)) != 0) { if (r == GLOB_NOSPACE) - error("%s: too many glob matches", abs_src); + error("%s: too many glob matches", src); else - error("%s: %s", abs_src, strerror(ENOENT)); + error("%s: %s", src, strerror(ENOENT)); err = -1; goto out; } @@ -1878,7 +1877,7 @@ throughlocal_sftp(struct sftp_conn *from, struct sftp_conn *to, targetisdir = remote_is_dir(to, target); if (!targetisdir && targetshouldbedirectory) { - error("%s: destination is not a directory", target); + error("%s: destination is not a directory", targ); err = -1; goto out; } @@ -1886,9 +1885,9 @@ throughlocal_sftp(struct sftp_conn *from, struct sftp_conn *to, debug3_f("copying remote %s to remote %s", abs_src, target); if ((r = remote_glob(from, abs_src, GLOB_MARK, NULL, &g)) != 0) { if (r == GLOB_NOSPACE) - error("%s: too many glob matches", abs_src); + error("%s: too many glob matches", src); else - error("%s: %s", abs_src, strerror(ENOENT)); + error("%s: %s", src, strerror(ENOENT)); err = -1; goto out; } |