Commit Graph

9237 Commits

Author SHA1 Message Date
djm@openbsd.org 95344c2574 upstream: allow sshd_config PermitUserEnvironment to accept a
pattern-list of whitelisted environment variable names in addition to yes|no.

bz#1800, feedback and ok markus@

OpenBSD-Commit-ID: 77dc2b468e0bf04b53f333434ba257008a1fdf24
2018-07-03 21:01:30 +10:00
millert@openbsd.org 6f56fe4b95 upstream: Fix "WARNING: line 6 disappeared in /etc/moduli, giving up"
when choosing a prime.  An extra increment of linenum snuck in as part of the
conversion to getline().  OK djm@ markus@

OpenBSD-Commit-ID: 0019225cb52ed621b71cd9f19ee2e78e57e3dd38
2018-07-03 11:08:29 +10:00
dtucker@openbsd.org 1eee79a11c upstream: One ampersand is enough to backgroud an process. OpenBSD
doesn't seem to mind, but some platforms in -portable object to the second.

OpenBSD-Regress-ID: d6c3e404871764343761dc25c3bbe29c2621ff74
2018-07-03 00:45:40 +10:00
Darren Tucker 6301e6c787 Add implementation of getline.
Add getline for the benefit of platforms that don't have it.  Sourced
from NetBSD (OpenBSD's implementation is a little too chummy with the
internals of FILE).
2018-07-02 21:36:31 +10:00
djm@openbsd.org 84623e0037 upstream: whitespace
OpenBSD-Commit-ID: 9276951caf4daf555f6d262e95720e7f79244572
2018-06-26 12:03:25 +10:00
djm@openbsd.org 90e51d6727 upstream: fix NULL dereference in open_listen_match_tcpip()
OpenBSD-Commit-ID: c968c1d29e392352383c0f9681fcc1e93620c4a9
2018-06-26 08:30:43 +10:00
jmc@openbsd.org f535ff922a upstream: spelling;
OpenBSD-Commit-ID: db542918185243bea17202383a581851736553cc
2018-06-26 08:30:43 +10:00
djm@openbsd.org 80e199d617 upstream: test PermitListen with bare port numbers
OpenBSD-Regress-ID: 4b50a02dfb0ccaca08247f3877c444126ba901b3
2018-06-19 13:03:03 +10:00
djm@openbsd.org 87ddd676da upstream: allow bare port numbers to appear in PermitListen directives,
e.g.

PermitListen 2222 8080

is equivalent to:

PermitListen *:2222 *:8080

Some bonus manpage improvements, mostly from markus@

"looks fine" markus@

OpenBSD-Commit-ID: 6546b0cc5aab7f53d65ad0a348ca0ae591d6dd24
2018-06-19 13:00:50 +10:00
djm@openbsd.org 26f96ca10a upstream: invalidate supplemental group cache used by
temporarily_use_uid() when the target uid differs; could cause failure to
read authorized_keys under some configurations. patch by Jakub Jelen via
bz2873; ok dtucker, markus

OpenBSD-Commit-ID: 48a345f0ee90f6c465a078eb5e89566b23abd8a1
2018-06-15 17:07:49 +10:00
djm@openbsd.org 89a85d7247 upstream: unbreak SendEnv; patch from tb@
OpenBSD-Commit-ID: fc808daced813242563b80976e1478de95940056
2018-06-11 09:50:06 +10:00
jmc@openbsd.org acf4260f09 upstream: sort previous;
OpenBSD-Commit-ID: 27d80d8b8ca99bc33971dee905e8ffd0053ec411
2018-06-11 09:50:06 +10:00
djm@openbsd.org 1678d42364 upstream: slightly better wording re handing of $TERM, from Jakub
Jelen via bz2386

OpenBSD-Commit-ID: 14bea3f069a93c8be66a7b97794255a91fece964
2018-06-11 09:50:06 +10:00
djm@openbsd.org 28013759f0 upstream: add a SetEnv directive for sshd_config to allow an
administrator to explicitly specify environment variables set in sessions
started by sshd. These override the default environment and any variables set
by user configuration (PermitUserEnvironment, etc), but not the SSH_*
variables set by sshd itself.

ok markus@

OpenBSD-Commit-ID: b6a96c0001ccd7dd211df6cae9e961c20fd718c0
2018-06-09 13:11:00 +10:00
djm@openbsd.org 7082bb58a2 upstream: add a SetEnv directive to ssh_config that allows setting
environment variables for the remote session (subject to the server accepting
them)

refactor SendEnv to remove the arbitrary limit of variable names.

ok markus@

OpenBSD-Commit-ID: cfbb00d9b0e10c1ffff1d83424351fd961d1f2be
2018-06-09 13:11:00 +10:00
djm@openbsd.org 3b9798bda1 upstream: reorder child environment preparation so that variables
read from ~/.ssh/environment (if enabled) do not override SSH_* variables set
by the server.

OpenBSD-Commit-ID: 59f9d4c213cdcef2ef21f4b4ae006594dcf2aa7a
2018-06-09 13:11:00 +10:00
djm@openbsd.org 0368889f82 upstream: fix incorrect expansion of %i in
load_public_identity_files(); reported by Roumen Petrov

OpenBSD-Commit-ID: a827289e77149b5e0850d72a350c8b0300e7ef25
2018-06-09 13:10:59 +10:00
djm@openbsd.org 027607fc2d upstream: fix some over-long lines and __func__ up some debug
messages

OpenBSD-Commit-ID: c70a60b4c8207d9f242fc2351941ba50916bb267
2018-06-09 13:10:59 +10:00
jmc@openbsd.org 6ff6fda705 upstream: tweak previous;
OpenBSD-Commit-ID: f98f16af10b28e24bcecb806cb71ea994b648fd6
2018-06-09 13:10:59 +10:00
Darren Tucker f2c06ab8dd Remove ability to override $LD.
Since autoconf always uses $CC to link C programs, allowing users to
override LD caused mismatches between what LD_LINK_IFELSE thought worked
and what ld thought worked.  If you do need to do this kind of thing you
need to set a compiler flag such as gcc's -fuse-ld in LDFLAGS.
2018-06-08 17:43:36 +10:00
Darren Tucker e1542a8079 Better detection of unsupported compiler options.
Should prevent "unsupported -Wl,-z,retpoline" warnings during linking.
ok djm@
2018-06-08 13:55:59 +10:00
djm@openbsd.org 57379dbd01 upstream: test the correct configuration option name
OpenBSD-Regress-ID: 492279ea9f65657f97a970e0e7c7fd0b339fee23
2018-06-08 00:31:38 +10:00
djm@openbsd.org 6d41815e20 upstream: some permitlisten fixes from markus@ that I missed in my
insomnia-fueled commits last night

OpenBSD-Commit-ID: 26f23622e928996086e85b1419cc1c0f136e359c
2018-06-07 19:28:44 +10:00
djm@openbsd.org 4319f7a868 upstream: permitlisten/PermitListen unit test from Markus
OpenBSD-Regress-ID: ab12eb42f0e14926980441cf7c058a6d1d832ea5
2018-06-07 14:48:39 +10:00
djm@openbsd.org fa09076410 upstream: fix regression caused by recent permitlisten option commit:
authorized_keys lines that contained permitopen/permitlisten were being
treated as invalid.

OpenBSD-Commit-ID: 7ef41d63a5a477b405d142dc925b67d9e7aaa31b
2018-06-07 14:33:23 +10:00
markus@openbsd.org 7f90635216 upstream: switch config file parsing to getline(3) as this avoids
static limits noted by gerhard@; ok dtucker@, djm@

OpenBSD-Commit-ID: 6d702eabef0fa12e5a1d75c334a8c8b325298b5c
2018-06-07 04:34:05 +10:00
djm@openbsd.org 392db2bc83 upstream: regress test for PermitOpen
OpenBSD-Regress-ID: ce8b5f28fc039f09bb297fc4a92319e65982ddaf
2018-06-07 04:28:25 +10:00
djm@openbsd.org 803d896ef3 upstream: man bits for permitlisten authorized_keys option
OpenBSD-Commit-ID: 86910af8f781a4ac5980fea125442eb25466dd78
2018-06-07 04:27:21 +10:00
djm@openbsd.org 04df43208b upstream: man bits for PermitListen
OpenBSD-Commit-ID: 35b200cba4e46a16a4db6a80ef11838ab0fad67c
2018-06-07 04:27:21 +10:00
djm@openbsd.org 93c06ab6b7 upstream: permitlisten option for authorized_keys; ok markus@
OpenBSD-Commit-ID: 8650883018d7aa893173d703379e4456a222c672
2018-06-07 04:27:20 +10:00
djm@openbsd.org 115063a664 upstream: Add a PermitListen directive to control which server-side
addresses may be listened on when the client requests remote forwarding (ssh
-R).

This is the converse of the existing PermitOpen directive and this
includes some refactoring to share much of its implementation.

feedback and ok markus@

OpenBSD-Commit-ID: 15a931238c61a3f2ac74ea18a98c933e358e277f
2018-06-07 04:27:20 +10:00
Darren Tucker 7703ae5f5d Use ssh-keygen -A to generate missing host keys.
Instead of testing for each specific key type, use ssh-keygen -A to
generate any missing host key types.
2018-06-06 16:05:44 +10:00
jmc@openbsd.org e8d59fef10 upstream: add missing punctuation after %i in ssh_config.5, and
make the grammatical format in sshd_config.5 match that in ssh_config.5;

OpenBSD-Commit-ID: e325663b9342f3d556e223e5306e0d5fa1a74fa0
2018-06-04 14:54:43 +10:00
jmc@openbsd.org a1f737d6a9 upstream: oops - further adjustment to text neccessary;
OpenBSD-Commit-ID: 23585576c807743112ab956be0fb3c786bdef025
2018-06-04 14:54:43 +10:00
jmc@openbsd.org 2940284934 upstream: %U needs to be escaped; tweak text;
OpenBSD-Commit-ID: 30887b73ece257273fb619ab6f4e86dc92ddc15e
2018-06-04 14:54:43 +10:00
dtucker@openbsd.org e5019da3c5 upstream: Apply umask to all incoming files and directories not
just files. This makes sure it gets applied to directories too, and prevents
a race where files get chmodded after creation.  bz#2839, ok djm@

OpenBSD-Commit-ID: 3168ee6c7c39093adac4fd71039600cfa296203b
2018-06-04 14:54:43 +10:00
djm@openbsd.org a1dcafc41c upstream: Adapt to extra default verboisity from ssh-keygen when
searching for and hashing known_hosts entries in a single operation
(ssh-keygen -HF ...) Patch from Anton Kremenetsky

OpenBSD-Regress-ID: 519585a4de35c4611285bd6a7272766c229b19dd
2018-06-01 14:24:08 +10:00
djm@openbsd.org 76f314c75d upstream: Add TEST_SSH_FAIL_FATAL variable, to force all failures
to instantly abort the test. Useful in capturing clean logs for individual
failure cases.

OpenBSD-Regress-ID: feba18cf338c2328b9601bd4093cabdd9baa3af1
2018-06-01 14:24:08 +10:00
dtucker@openbsd.org 065c8c055d upstream: Clean up comment.
OpenBSD-Regress-ID: 6adb35f384d447e7dcb9f170d4f0d546d3973e10
2018-06-01 14:23:22 +10:00
djm@openbsd.org 01b048c8eb upstream: whitespace
OpenBSD-Commit-ID: e5edb5e843ddc9b73a8e46518899be41d5709add
2018-06-01 14:22:29 +10:00
djm@openbsd.org 854ae209f9 upstream: make ssh_remote_ipaddr() capable of being called after
the ssh->state has been torn down; bz#2773

OpenBSD-Commit-ID: 167f12523613ca3d16d7716a690e7afa307dc7eb
2018-06-01 14:20:12 +10:00
djm@openbsd.org 3e088aaf23 upstream: return correct exit code when searching for and hashing
known_hosts entries in a single operation (ssh-keygen -HF hostname); bz2772
Report and fix from Anton Kremenetsky

OpenBSD-Commit-ID: ac10ca13eb9bb0bc50fcd42ad11c56c317437b58
2018-06-01 14:20:12 +10:00
djm@openbsd.org 9c935dd9bf upstream: make UID available as a %-expansion everywhere that the
username is available currently. In the client this is via %i, in the server
%U (since %i was already used in the client in some places for this, but used
for something different in the server); bz#2870, ok dtucker@

OpenBSD-Commit-ID: c7e912b0213713316cb55db194b3a6415b3d4b95
2018-06-01 13:35:59 +10:00
djm@openbsd.org d8748b91d1 upstream: prefer argv0 to "ssh" when re-executing ssh for ProxyJump
directive; bz2831, feedback and ok dtucker@

OpenBSD-Commit-ID: 3cec709a131499fbb0c1ea8a0a9e0b0915ce769e
2018-06-01 13:14:54 +10:00
djm@openbsd.org fbb4b5fd4f upstream: Do not ban PTY allocation when a sshd session is restricted
because the user password is expired as it breaks password change dialog.

regression in openssh-7.7 reported by Daniel Wagner

OpenBSD-Commit-ID: 9fc09c584c6f1964b00595e3abe7f83db4d90d73
2018-05-25 17:12:04 +10:00
djm@openbsd.org f6a59a22b0 upstream: Fix return value confusion in several functions (readdir,
download and fsync). These should return -1 on error, not a sftp status code.

patch from Petr Cerny in bz#2871

OpenBSD-Commit-ID: 651aa0220ad23c9167d9297a436162d741f97a09
2018-05-25 14:27:50 +10:00
dtucker@openbsd.org 1da5934b86 upstream: If select() fails in ssh_packet_read_seqnr go directly to
the error path instead of trying to read from the socket on the way out,
which resets errno and causes the true error to be misreported.  ok djm@

OpenBSD-Commit-ID: 2614edaadbd05a957aa977728aa7a030af7c6f0a
2018-05-25 14:27:50 +10:00
Damien Miller 4ef75926ef Permit getuid()/geteuid() syscalls.
Requested for Linux/s390; patch from Eduardo Barretto via bz#2752;
ok dtucker
2018-05-25 13:45:01 +10:00
djm@openbsd.org 4b22fd8ece upstream: support ProxyJump=none to disable ProxyJump
functionality; bz#2869 ok dtucker@

OpenBSD-Commit-ID: 1c06ee08eb78451b5837fcfd8cbebc5ff3a67a01
2018-05-22 10:15:18 +10:00
jmc@openbsd.org f41bcd70f5 upstream: correct keyowrd name (permitemptypasswords); from brendan
macdonell

OpenBSD-Commit-ID: ef1bdbc936b2ea693ee37a4c20a94d4d43f5fda3
2018-05-22 10:15:18 +10:00