summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/misc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Add URI support to ssh, sftp and scp. For example ssh://user@hostmillert2017-10-211-5/+292
| | | | | | | or sftp://user@host/path. The connection parameters described in draft-ietf-secsh-scp-sftp-ssh-uri-04 are not implemented since the ssh fingerprint format in the draft uses md5 with no way to specify the hash function type. OK djm@
* add a "quiet" flag to exited_cleanly() that supresses errors aboutdjm2017-08-181-3/+4
| | | | exit status (failure due to signal is still reported)
* Move several subprocess-related functions from various locations todjm2017-08-181-1/+455
| | | | | | | misc.c. Extend subprocess() to offer a little more control over stdio disposition. feedback & ok dtucker@
* Allow IPQoS=none in ssh/sshd to not set an explicit ToS/DSCP valuedjm2017-07-231-1/+2
| | | | and just use the operating system default; ok dtucker@
* Switch to recallocarray() for a few operations. Both growth and shrinkagederaadt2017-05-311-2/+2
| | | | | | are handled safely, and there also is no need for preallocation dances. Future changes in this area will be less error prone. Review and one bug found by markus
* Fix convtime() overflow test on boundary condition, spotted by & ok djm.dtucker2017-03-141-3/+3
|
* Check for integer overflow when parsing times in convtime(). Reported bydtucker2017-03-141-6/+11
| | | | nicolas.iooss at m4x.org, ok djm@
* On startup, check to see if sshd is already daemonized and if so,dtucker2016-11-301-1/+19
| | | | | | skip the call to daemon() and do not rewrite the PidFile. This means that when sshd re-execs itself on SIGHUP the process ID will no longer change. Should address bz#2641. ok djm@ markus@.
* Factor out "can bind to low ports" check into its own function. This will makedtucker2016-10-231-1/+9
| | | | | it easier for Portable to support platforms with permissions models other than uid==0 (eg bz#2625). ok djm@, "doesn't offend me too much" deraadt@.
* Add a ProxyJump ssh_config(5) option and corresponding -J ssh(1)djm2016-07-151-1/+62
| | | | | | | | | | | | | | command-line flag to allow simplified indirection through a SSH bastion or "jump host". These options construct a proxy command that connects to the specified jump host(s) (more than one may be specified) and uses port-forwarding to establish a connection to the next destination. This codifies the safest way of indirecting connections through SSH servers and makes it easy to use. ok markus@
* don't record duplicate LocalForward and RemoteForward entries;djm2016-04-061-1/+39
| | | | | | fixes failure with ExitOnForwardFailure+hostname canonicalisation where the same forwards are added on the second pass through the configuration file. bz#2562; ok dtucker@
* Another use for fcntl() and thus of the superfluous 3rd parameterkrw2016-04-021-13/+13
| | | | | | | | | is when sanitising standard fd's before calling daemon(). Use a tweaked version of the ssh(1) function in all three places found using fcntl() this way. ok jca@ beck@
* Improve precision of progressmeter for sftp and scp by storing sub-seconddtucker2016-03-021-1/+12
| | | | timestamps. Pointed out by mmcc@, ok deraadt@ markus@
* Include sys/time.h for gettimeofday. From sortie at maxsi.org.dtucker2016-01-201-1/+2
|
* Properly handle invalid %-format by calling fatal.tobias2015-12-041-1/+3
| | | | ok deraadt, djm
* Handle the split of tun(4) "link0" into tap(4) in ssh tun-forwarding.sthen2015-10-241-21/+11
| | | | | Adapted from portable (using separate devices for this is the normal case in most OS). ok djm@
* don't try to change tun device flags if they are already whatdjm2015-10-071-22/+33
| | | | | | we need; makes it possible to use tun/tap networking as non- root user if device permissions and interface flags are pre-established; based on patch by Ossi Herrala
* rename xrealloc() to xreallocarray() since it follows that form.deraadt2015-04-241-2/+2
| | | | ok djm
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-3/+3
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* Remove unnecessary include: netinet/in_systm.h is not needed by theselteo2014-10-241-2/+1
| | | | | | programs. ok deraadt@ millert@
* Add support for Unix domain socket forwarding. A remote TCP portmillert2014-07-151-1/+48
| | | | | | | | may be forwarded to a local Unix domain socket and vice versa or both ends may be a Unix domain socket. This is a reimplementation of the streamlocal patches by William Ahern from: http://www.25thandclement.com/~william/projects/streamlocal.html OK djm@ markus@
* use get/put_u32 to load values rather than *((UINT32 *)p) that breaks ondjm2014-04-201-1/+25
| | | | strict-alignment architectures; reported by and ok stsp@
* refactor client config code a little:djm2013-10-141-1/+9
| | | | | | | | | | | | add multistate option partsing to readconf.c, similar to servconf.c's existing code. move checking of options that accept "none" as an argument to readconf.c add a lowercase() function and use it instead of explicit tolower() in loops part of a larger diff that was ok markus@
* in ssh_gai_strerror() don't fallback to strerror for EAI_SYSTEM whendjm2013-07-121-2/+2
| | | | | errno == 0. Avoids confusing error message in some broken resolver cases. bz#2122 patch from plautrba AT redhat.com; ok dtucker
* Use clock_gettime(CLOCK_MONOTONIC ...) for ssh timers so that things likedtucker2013-06-011-1/+12
| | | | | keepalives and rekeying will work properly over clock steps. Suggested by markus@, "looks good" djm@.
* bye, bye xfree(); ok markus@djm2013-05-171-6/+6
|
* remove extra parens noticed by nicmtedu2013-04-241-2/+2
|
* use xasprintf instead of a series of strlcats and strdup. ok djmtedu2013-04-231-11/+10
|
* fix typo in IPQoS parsing: there is no "AF14" class, but there isdjm2011-09-051-2/+2
| | | | an "AF21" class. Spotted by giesen AT snickers.org; ok markus stevesk
* print ipqos friendly string for sshd -T; ok markusstevesk2011-03-291-1/+14
| | | | | # sshd -Tf sshd_config|grep ipqos ipqos lowdelay throughput
* honour $TMPDIR for client xauth and ssh-agent temporary directories;djm2010-11-211-1/+18
| | | | feedback and ok markus@
* allow ssh and sshd to set arbitrary TOS/DSCP/QoS values instead ofdjm2010-11-131-1/+55
| | | | | | hardcoding lowdelay/throughput. bz#1733 patch from philipp AT redfish-solutions.com; ok markus@ deraadt@
* Add timingsafe_bcmp(3) to libc, mention that it's already in thematthew2010-09-241-12/+1
| | | | | | kernel in kern(9), and remove it from OpenSSH. ok deraadt@, djm@
* add an option per-read/write callback to atomiciodjm2010-09-221-1/+65
| | | | | | | | | factor out bandwidth limiting code from scp(1) into a generic bandwidth limiter that can be attached using the atomicio callback mechanism add a bandwidth limit option to sftp(1) using the above "very nice" markus@
* sync timingsafe_bcmp() with the one dempsky@ committed to sys/lib/libkerndjm2010-07-211-8/+6
|
* s/timing_safe_cmp/timingsafe_bcmp/gdjm2010-07-131-2/+2
|
* implement a timing_safe_cmp() function to compare memory without leakingdjm2010-07-131-1/+13
| | | | | | timing information by short-circuiting like memcmp() and use it for some of the more sensitive comparisons (though nothing high-value was readily attackable anyway); "looks ok" markus@
* unbreak strdelim() skipping past quoted strings, e.g.djm2010-07-021-1/+2
| | | | | | | AllowUsers "blah blah" blah was broken; report and fix in bz#1757 from bitman.zhou AT centrify.com ok dtucker;
* colon() returns char*, so s/return (0)/return NULL/djm2010-05-211-4/+4
|
* Remove RoutingDomain from ssh since it's now not needed. It can be replaceddtucker2010-01-091-50/+1
| | | | | | | | | | | | | with "route exec" or "nc -V" as a proxycommand. "route exec" also ensures that trafic such as DNS lookups stays withing the specified routingdomain. For example (from reyk): # route -T 2 exec /usr/sbin/sshd or inherited from the parent process $ route -T 2 exec sh $ ssh 10.1.2.3 ok deraadt@ markus@ stevesk@ reyk@
* validate routing domain is in range 0-RT_TABLEID_MAX.stevesk2009-12-251-1/+13
| | | | 'Looks right' deraadt@
* correct off-by-one in percent_expand(): we would fatal() when tryingdjm2009-11-201-9/+9
| | | | | | to expand EXPAND_MAX_KEYS, allowing only EXPAND_MAX_KEYS-1 to actually work. Note that nothing in OpenSSH actually uses close to this limit at present. bz#1607 from Jan.Pechanec AT Sun.COM
* Allow to set the rdomain in ssh/sftp/scp/sshd and ssh-keyscan.reyk2009-10-281-1/+38
| | | | ok markus@
* Added missing newlines in error messages.tobias2009-02-211-3/+4
| | | | ok dtucker
* make a2port() return -1 when it encounters an invalid port numberdjm2009-01-221-13/+9
| | | | | | | | | | | rather than 0, which it will now treat as valid (needed for future work) adjust current consumers of a2port() to check its return value is <= 0, which in turn required some things to be converted from u_short => int make use of int vs. u_short consistent in some other places too feedback & ok markus@
* upcast uid to long with matching %ld, prevents warnings in portabledtucker2008-06-131-2/+2
|
* Make keepalive timeouts apply while waiting for a packet, particularly duringdtucker2008-06-121-1/+21
| | | | key renegotiation (bz #1363). With djm and Matt Day, ok djm@
* spaces -> tabs from my previous commitdtucker2008-01-011-4/+4
|
* Add a small helper function to consistently handle the EAI_SYSTEM errordtucker2007-12-271-1/+10
| | | | | code of getaddrinfo. Prompted by vgiffin at apple com via bz #1417. ok markus@ stevesk@
* Don't access buf[strlen(buf) - 1] for zero-length strings.ray2006-11-231-1/+3
| | | | ``ok by me'' djm@.