Commit Graph

11230 Commits

Author SHA1 Message Date
djm@openbsd.org 41b019ac06 upstream: when scp is in SFTP mode, try to deal better with ~
prefixed paths. ~user paths aren't supported, but ~/ paths will be accepted
and prefixed with the SFTP server starting directory (more to come)

prompted by and discussed with deraadt@
ok markus@

OpenBSD-Commit-ID: 263a071f14555c045fd03132a8fb6cbd983df00d
2021-08-10 12:47:45 +10:00
djm@openbsd.org b4b3f3da6c upstream: on fatal errors, make scp wait for ssh connection before
exiting avoids LogLevel=verbose (or greater) messages from ssh appearing
after scp has returned exited and control has returned to the shell; ok
markus@

(this was originally committed as r1.223 along with unrelated stuff that
I rolled back in r1.224)

OpenBSD-Commit-ID: 1261fd667ad918484889ed3d7aec074f3956a74b
2021-08-10 12:47:45 +10:00
djm@openbsd.org 2ae7771749 upstream: rever r1.223 - I accidentally committed unrelated changes
OpenBSD-Commit-ID: fb73f3865b2647a27dd94db73d6589506a9625f9
2021-08-10 12:47:45 +10:00
djm@openbsd.org 986abe94d4 upstream: show only the final path component in the progress meter;
more useful with long paths (that may truncate) and better matches
traditional scp behaviour; spotted by naddy@ ok deraadt@

OpenBSD-Commit-ID: 26b544d0074f03ebb8a3ebce42317d8d7ee291a3
2021-08-10 12:47:39 +10:00
djm@openbsd.org 2b67932bb3 upstream: on fatal errors, make scp wait for ssh connection before
exiting avoids LogLevel=verbose (or greater) messages from ssh appearing
after scp has returned exited and control has returned to the shell; ok
markus@

OpenBSD-Commit-ID: ef9dab5ef5ae54a6a4c3b15d380568e94263456c
2021-08-10 12:47:39 +10:00
dtucker@openbsd.org 724eb900ac upstream: xstrdup environment variable used by ForwardAgent. bz#3328
from goetze at dovetail.com, ok djm@ deraadt@

OpenBSD-Commit-ID: 760320dac1c3b26904284ba417a7d63fccc5e742
2021-08-08 19:14:51 +10:00
dtucker@openbsd.org 86b4cb3a88 upstream: Although it's POSIX, not all shells used in Portable support
the implicit 'in "$@"' after 'for i'.

OpenBSD-Regress-ID: 3c9aec6bca4868f85d2742b6ba5223fce110bdbc
2021-08-08 18:43:41 +10:00
Darren Tucker f2ccf6c9f3 Move portable specific settings down.
This brings the top hunk of the file back in sync with OpenBSD
so patches to the CVS Id should apply instead of always being
rejected.
2021-08-08 17:39:56 +10:00
dtucker@openbsd.org 71b0eb997e upstream: Move setting of USER further down the startup In portable
we have to change this and having it in the same hunk as the CVS Id string
means applying changes fails every. single. time.

OpenBSD-Regress-ID: 87cd603eb6db58c9b430bf90adacb7f90864429b
2021-08-08 17:35:45 +10:00
dtucker@openbsd.org f0aca2706c upstream: Drop -q in ssh-log-wrapper.sh to preserve logs.
scp and sftp like to add -q to the command line passed to ssh which
overrides the LogLevel we set in the config files and suppresses output
to the debug logs so drop any "-q" from the invoked ssh.  In the one
case where we actually want to use -q in the banner test, call the ssh
binary directly bypassing the logging wrapper.

OpenBSD-Regress-ID: e2c97d3c964bda33a751374c56f65cdb29755b75
2021-08-08 17:19:56 +10:00
dtucker@openbsd.org cf27810a64 upstream: Fix prototype mismatch for do_cmd. ok djm@
OpenBSD-Commit-ID: 1c1598bb5237a7ae0be99152f185e0071163714d
2021-08-07 12:11:03 +10:00
djm@openbsd.org 85de69f646 upstream: sftp-client.c needs poll.h
remove unused variable

OpenBSD-Commit-ID: 233ac6c012cd23af62f237167a661db391055a16
2021-08-07 11:57:13 +10:00
Darren Tucker 397c4d72e5 Include poll.h and friends for struct pollfd. 2021-08-07 11:30:57 +10:00
djm@openbsd.org a9e2c53319 upstream: do_upload() used a near-identical structure for
tracking expected status replies from the server to what do_download() was
using.

Refactor it to use the same structure and factor out some common
code into helper functions.

OpenBSD-Commit-ID: 0c167df8ab6df4a5292c32421922b0cf379e9054
2021-08-07 10:20:31 +10:00
djm@openbsd.org 7b1cbcb759 upstream: make scp(1) in SFTP mode follow symlinks like
traditional scp(1) ok markus@

OpenBSD-Commit-ID: 97255e55be37e8e26605e4ba1e69f9781765d231
2021-08-07 10:20:31 +10:00
djm@openbsd.org 133b44e500 upstream: fix incorrect directory permissions on scp -3
transfers; ok markus@

OpenBSD-Commit-ID: 64b2abaa5635a2be65ee2e77688ad9bcebf576c2
2021-08-07 10:20:31 +10:00
djm@openbsd.org 98b59244ca upstream: a bit more debugging of file attributes being
sent/received over the wire

OpenBSD-Commit-ID: f68c4e207b08ef95200a8b2de499d422808e089b
2021-08-07 10:20:31 +10:00
djm@openbsd.org c677e65365 upstream: make scp(1) in SFTP mode output better match original
scp(1) by suppressing "Retrieving [path]" lines that were emitted to support
the interactive sftp(1) client. ok markus@

OpenBSD-Commit-ID: 06be293df5f156a18f366079be2f33fa68001acc
2021-08-07 10:20:31 +10:00
djm@openbsd.org 48cd39b7a4 upstream: factor out a structure duplicated between downloading
and crossloading; ok markus@

OpenBSD-Commit-ID: 96eede24d520569232086a129febe342e4765d39
2021-08-07 10:20:31 +10:00
djm@openbsd.org 318c06bb04 upstream: use sftp_client crossloading to implement scp -3
feedback/ok markus@

OpenBSD-Commit-ID: 7db4c0086cfc12afc9cfb71d4c2fd3c7e9416ee9
2021-08-07 10:20:31 +10:00
djm@openbsd.org de7115b373 upstream: support for "cross"-loading files/directories, i.e.
downloading from one SFTP server while simultaneously uploading to another.

feedback & ok markus@

OpenBSD-Commit-ID: 3982878e29d8df0fa4ddc502f5ff6126ac714235
2021-08-07 10:20:24 +10:00
djm@openbsd.org a50bd0367f upstream: factor our SSH2_FXP_OPEN calls into their own function;
"looks fine" markus@

OpenBSD-Commit-ID: d3dea2153f08855c6d9dacc01973248944adeffb
2021-08-07 10:20:24 +10:00
djm@openbsd.org e3c0ba0587 upstream: prepare for scp -3 implemented via sftp
OpenBSD-Commit-ID: 194aac0dd87cb175334b71c2a30623a5ad55bb44
2021-08-07 10:20:24 +10:00
dtucker@openbsd.org 395d8fbdb0 upstream: Make diff invocation more portable.
POSIX does not require diff to have -N, so compare in both directions
with just -r, which should catch missing files in either directory.

OpenBSD-Regress-ID: 0e2ec8594556a6f369ed5a0a90c6806419b845f7
2021-08-06 19:33:31 +10:00
djm@openbsd.org d247a73ce2 upstream: regression test for scp -3
OpenBSD-Regress-ID: b44375d125c827754a1f722ec6b6b75b634de05d
2021-08-06 16:57:37 +10:00
dtucker@openbsd.org 35c8e41a6f upstream: Document "ProxyJump none". bz#3334.
OpenBSD-Commit-ID: f78cc6f55731f2cd35c3a41d5352ac1ee419eba7
2021-08-06 16:54:34 +10:00
dtucker@openbsd.org 911ec64118 upstream: Allow for different (but POSIX compliant) behaviour of
basename(3) and prevent a use-after-free in that case in the new sftp-compat
code.

POSIX allows basename(3) to either return a pointer to static storage
or modify the passed string and return a pointer to that.  OpenBSD does
the former and works as is, but on other platforms "filename" points
into "tmp" which was just freed.  This makes the freeing of tmp
consistent with the other variable in the loop.

Pinpointed by the -portable Valgrind regress test.  ok djm@ deraadt@

OpenBSD-Commit-ID: 750f3c19bd4440e4210e30dd5d7367386e833374
2021-08-04 12:04:33 +10:00
Damien Miller 6df1fecb5d use openbsd-compat glob.h is required 2021-08-04 11:05:11 +10:00
Darren Tucker 9ebd182888 Missing space between macro arg and punctuation.
From jmc@
2021-08-03 21:03:23 +10:00
Darren Tucker 0fd3f62edd Avoid lines >80 chars. From jmc@ 2021-08-03 21:02:33 +10:00
djm@openbsd.org af5d8094d8 upstream: regression tests for scp SFTP protocol support; mostly by
Jakub Jelen in GHPR#194 ok markus

OpenBSD-Regress-ID: 36f1458525bcb111741ec8547eaf58b13cddc715
2021-08-03 11:15:06 +10:00
anton@openbsd.org e4673b7f67 upstream: Treat doas with arguments as a valid SUDO variable.
Allows one to specify SUDO="doas -n" which I do while running make regress.

ok dtucker@

OpenBSD-Regress-ID: 4fe5814b5010dbf0885500d703bea06048d11005
2021-08-03 11:08:46 +10:00
djm@openbsd.org 197e29f1cc upstream: support for using the SFTP protocol for file transfers in
scp, via a new "-M sftp" option. Marked as experimental for now.

Some corner-cases exist, in particular there is no attempt to
provide bug-compatibility with scp's weird "double shell" quoting
rules.

Mostly by Jakub Jelen in GHPR#194 with some tweaks by me. ok markus@
Thanks jmc@ for improving the scp.1 bits.

OpenBSD-Commit-ID: 6ce4c9157ff17b650ace571c9f7793d92874051c
2021-08-03 11:03:09 +10:00
jmc@openbsd.org dd533c7ab7 upstream: fix a formatting error and add some Xr; from debian at
helgefjell de

removed references to rlogin etc. as no longer relevant;
suggested by djm

ok djm dtucker

OpenBSD-Commit-ID: 3c431c303068d3aec5bb18573a0bd5e0cd77c5ae
2021-08-03 09:39:58 +10:00
jmc@openbsd.org c7cd347a88 upstream: fix a formatting error and mark up known_hosts
consistently; issues reported by debian at helgefjell de

ok djm dtucker

OpenBSD-Commit-ID: a1fd8d21dc77f507685443832df0c9700481b0ce
2021-08-03 09:39:58 +10:00
jmc@openbsd.org 4455aec2e4 upstream: no need to talk about version 2 with the -Q option, so
rewrite the text to read better;

issue reported by debian at helgefjell de
ok djm dtucker

OpenBSD-Commit-ID: 59fe2e8219c37906740ad062e0fdaea487dbe9cf
2021-08-03 09:39:57 +10:00
jmc@openbsd.org bec429338e upstream: word fix; reported by debian at helgefjell de
OpenBSD-Commit-ID: 0c6fd22142422a25343c5bd1a618f31618f41ece
2021-08-03 09:39:57 +10:00
jmc@openbsd.org efad4deb5a upstream: standardise the grammar in the options list; issue
reported by debian at helgefjell de

ok dtucker djm

OpenBSD-Commit-ID: 7ac15575045d82f4b205a42cc7d5207fe4c3f8e6
2021-08-03 09:39:57 +10:00
Darren Tucker 1e11fb2406 Check for RLIMIT_NOFILE before trying to use it. 2021-08-02 18:56:29 +10:00
Darren Tucker 0f494236b4 lastenv is only used in setenv.
Prevents an unused variable warning on platforms that have setenv but
not unsetenv.
2021-07-27 17:45:34 +10:00
Darren Tucker a1f78e08bd Move SUDO to "make test" command line.
Environment variables don't get passed by vmrun, so move to command
line.
2021-07-26 12:45:30 +10:00
Darren Tucker 02e624273b Set SUDO for tests and cleanup. 2021-07-25 23:26:36 +10:00
Darren Tucker 460ae5d930 Pass OPENSSL=no to make tests too. 2021-07-25 22:37:55 +10:00
dtucker@openbsd.org b398f499c6 upstream: Skip unit and makefile-based key conversion tests when
we're building with OPENSSL=no.

OpenBSD-Regress-ID: 20455ed9a977c93f846059d1fcb48e29e2c8d732
2021-07-25 22:37:19 +10:00
dtucker@openbsd.org 727ce36c8c upstream: Replace OPENSSL as the variable that points to the
openssl binary with OPENSSL_BIN.  This will allow us to use the OPENSSL
variable from mk.conf or the make(1) command line indicating if we're
building with our without OpenSSL, and ultimately get the regress tests
working in the OPENSSL=no configuration.

OpenBSD-Regress-ID: 2d788fade3264d7803e5b54cae8875963f688c4e
2021-07-25 22:35:24 +10:00
dtucker@openbsd.org 55e17101a9 upstream: Skip RFC4716 format import and export tests when built
without OpenSSL.

OpenBSD-Regress-ID: d2c2d5d38c1acc2b88cc99cfe00a2eb8bb39dfa4
2021-07-24 14:22:45 +10:00
dtucker@openbsd.org f5ccb5895d upstream: Don't omit ssh-keygen -y from usage when built without
OpenSSL.  It is actually available, albeit only for ed25519 keys.

OpenBSD-Commit-ID: 7a254c33d0e6a55c30c6b016a8d298d3cb7a7674
2021-07-24 14:22:26 +10:00
dtucker@openbsd.org 819d57ac23 upstream: Exclude key conversion options from usage when built
without OpenSSL since those are not available, similar to what we currently
do with the moduli screening options.  We can also use this to skip the
conversion regression tests in this case.

OpenBSD-Commit-ID: 3c82caa398cf99cd4518c23bba5a2fc66b16bafe
2021-07-24 14:22:26 +10:00
Darren Tucker b6673b1d2e Test OpenBSD upstream with and without OpenSSL. 2021-07-24 14:20:12 +10:00
djm@openbsd.org 9d38074b54 upstream: test for first-match-wins in authorized_keys environment=
options

OpenBSD-Regress-ID: 1517c90276fe84b5dc5821c59f88877fcc34c0e8
2021-07-24 12:31:05 +10:00