summaryrefslogtreecommitdiffstats
path: root/clientloop.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* - djm@cvs.openbsd.org 2013/09/12 01:41:12Damien Miller2013-09-141-2/+2
| | | | | | [clientloop.c] fix connection crash when sending break (~B) on ControlPersist'd session; ok dtucker@
* - dtucker@cvs.openbsd.org 2013/06/07 15:37:52Damien Miller2013-06-101-1/+4
| | | | | | | | | | | [channels.c channels.h clientloop.c] Add an "ABANDONED" channel state and use for mux sessions that are disconnected via the ~. escape sequence. Channels in this state will be able to close if the server responds, but do not count as active channels. This means that if you ~. all of the mux clients when using ControlPersist on a broken network, the backgrounded mux master will exit when the Control Persist time expires rather than hanging around indefinitely. bz#1917, also reported and tested by tedu@. ok djm@ markus@.
* - dtucker@cvs.openbsd.org 2013/06/02 23:36:29Darren Tucker2013-06-061-3/+3
| | | | | | [clientloop.h clientloop.c mux.c] No need for the mux cleanup callback to be visible so restore it to static and call it through the detach_user function pointer. ok djm@
* - dtucker@cvs.openbsd.org 2013/06/01 13:15:52Darren Tucker2013-06-011-7/+7
| | | | | | | | [ssh-agent.c clientloop.c misc.h packet.c progressmeter.c misc.c channels.c sandbox-systrace.c] Use clock_gettime(CLOCK_MONOTONIC ...) for ssh timers so that things like keepalives and rekeying will work properly over clock steps. Suggested by markus@, "looks good" djm@.
* - djm@cvs.openbsd.org 2013/05/17 00:13:13Darren Tucker2013-06-011-31/+24
| | | | | | | | | | | | | | | | | | [xmalloc.h cipher.c sftp-glob.c ssh-keyscan.c ssh.c sftp-common.c ssh-ecdsa.c auth2-chall.c compat.c readconf.c kexgexs.c monitor.c gss-genr.c cipher-3des1.c kex.c monitor_wrap.c ssh-pkcs11-client.c auth-options.c rsa.c auth2-pubkey.c sftp.c hostfile.c auth2.c servconf.c auth.c authfile.c xmalloc.c uuencode.c sftp-client.c auth2-gss.c sftp-server.c bufaux.c mac.c session.c jpake.c kexgexc.c sshconnect.c auth-chall.c auth2-passwd.c sshconnect1.c buffer.c kexecdhs.c kexdhs.c ssh-rsa.c auth1.c ssh-pkcs11.c auth2-kbdint.c kexdhc.c sshd.c umac.c ssh-dss.c auth2-jpake.c bufbn.c clientloop.c monitor_mm.c scp.c roaming_client.c serverloop.c key.c auth-rsa.c ssh-pkcs11-helper.c ssh-keysign.c ssh-keygen.c match.c channels.c sshconnect2.c addrmatch.c mux.c canohost.c kexecdhc.c schnorr.c ssh-add.c misc.c auth2-hostbased.c ssh-agent.c bufec.c groupaccess.c dns.c packet.c readpass.c authfd.c moduli.c] bye, bye xfree(); ok markus@
* - dtucker@cvs.openbsd.org 2013/05/16 02:00:34Darren Tucker2013-05-161-6/+17
| | | | | | | | [ssh_config sshconnect2.c packet.c readconf.h readconf.c clientloop.c ssh_config.5 packet.h] Add an optional second argument to RekeyLimit in the client to allow rekeying based on elapsed time in addition to amount of traffic. with djm@ jmc@, ok djm
* - djm@cvs.openbsd.org 2013/01/02 00:32:07Damien Miller2013-01-091-3/+3
| | | | | | [clientloop.c mux.c] channel_setup_local_fwd_listener() returns 0 on failure, not -ve bz#2055 reported by mathieu.lacage AT gmail.com
* - dtucker@cvs.openbsd.org 2012/09/07 06:34:21Darren Tucker2012-09-071-4/+4
| | | | | | [clientloop.c] when muxmaster is run with -N, make it shut down gracefully when a client sends it "-O stop" rather than hanging around (bz#1985). ok djm@
* - dtucker@cvs.openbsd.org 2012/09/07 01:10:21Darren Tucker2012-09-071-5/+4
| | | | | [clientloop.c] Merge escape help text for ~v and ~V; ok djm@
* - dtucker@cvs.openbsd.org 2012/09/07 00:30:19Darren Tucker2012-09-071-3/+8
| | | | | [clientloop.c] Print '^Z' instead of a raw ^Z when the sequence is not supported. ok djm@
* - dtucker@cvs.openbsd.org 2012/09/06 09:50:13Darren Tucker2012-09-071-41/+62
| | | | | | | | | [clientloop.c] Make the escape command help (~?) context sensitive so that only commands that will work in the current session are shown. ok markus@ (note: previous commit with this description was a mistake on my part while pulling changes from OpenBSD)
* - dtucker@cvs.openbsd.org 2012/09/06 09:50:13Darren Tucker2012-09-061-3/+3
| | | | | | [clientloop.c] Make the escape command help (~?) context sensitive so that only commands that will work in the current session are shown. ok markus@
* - dtucker@cvs.openbsd.org 2012/09/06 04:37:39Darren Tucker2012-09-061-1/+29
| | | | | | [clientloop.c log.c ssh.1 log.h] Add ~v and ~V escape sequences to raise and lower the logging level respectively. Man page help from jmc, ok deraadt jmc
* - dtucker@cvs.openbsd.org 2012/08/17 00:45:45Darren Tucker2012-09-061-1/+3
| | | | | | | [clientloop.c clientloop.h mux.c] Force a clean shutdown of ControlMaster client sessions when the ~. escape sequence is used. This means that ~. should now work in mux clients even if the server is no longer responding. Found by tedu, ok djm.
* - djm@cvs.openbsd.org 2012/06/20 04:42:58Damien Miller2012-06-201-2/+2
| | | | | | [clientloop.c serverloop.c] initialise accept() backoff timer to avoid EINVAL from select(2) in rekeying
* - djm@cvs.openbsd.org 2012/04/11 13:16:19Damien Miller2012-04-221-2/+6
| | | | | | [channels.c channels.h clientloop.c serverloop.c] don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a while; ok deraadt@ markus@
* - dtucker@cvs.openbsd.org 2012/01/18 21:46:43Damien Miller2012-02-101-1/+21
| | | | | | | [clientloop.c] Ensure that $DISPLAY contains only valid characters before using it to extract xauth data so that it can't be used to play local shell metacharacter games. Report from r00t_ati at ihteam.net, ok markus.
* - markus@cvs.openbsd.org 2011/09/10 22:26:34Damien Miller2011-09-221-11/+23
| | | | | | [channels.c channels.h clientloop.c ssh.1] support cancellation of local/dynamic forwardings from ~C commandline; ok & feedback djm@
* - djm@cvs.openbsd.org 2011/06/22 22:08:42Damien Miller2011-06-231-3/+2
| | | | | | [channels.c channels.h clientloop.c clientloop.h mux.c ssh.c] hook up a channel confirm callback to warn the user then requested X11 forwarding was refused by the server; ok markus@
* - djm@cvs.openbsd.org 2011/06/17 21:57:25Damien Miller2011-06-201-2/+4
| | | | | | [clientloop.c] setproctitle for a mux master that has been gracefully stopped; bz#1911 from Bert.Wesarg AT googlemail.com
* - djm@cvs.openbsd.org 2011/05/08 12:52:01Damien Miller2011-05-151-14/+39
| | | | | | | | | | | | | | [PROTOCOL.mux clientloop.c clientloop.h mux.c] improve our behaviour when TTY allocation fails: if we are in RequestTTY=auto mode (the default), then do not treat at TTY allocation error as fatal but rather just restore the local TTY to cooked mode and continue. This is more graceful on devices that never allocate TTYs. If RequestTTY is set to "yes" or "force", then failure to allocate a TTY is fatal. ok markus@
* - djm@cvs.openbsd.org 2011/05/06 21:34:32Damien Miller2011-05-151-13/+11
| | | | | | [clientloop.c mux.c readconf.c readconf.h ssh.c ssh_config.5] Add a RequestTTY ssh_config option to allow configuration-based control over tty allocation (like -t/-T); ok markus@
* - djm@cvs.openbsd.org 2011/04/17 22:42:42Damien Miller2011-05-051-9/+25
| | | | | | | [PROTOCOL.mux clientloop.c clientloop.h mux.c ssh.1 ssh.c] allow graceful shutdown of multiplexing: request that a mux server removes its listener socket and refuse future multiplexing requests; ok markus@
* - djm@cvs.openbsd.org 2011/01/16 12:05:59Damien Miller2011-01-161-11/+9
| | | | | | | [clientloop.c] a couple more tweaks to the post-close protocol 1 stderr/stdout flush: now that we use atomicio(), convert them from while loops to if statements add test and cast to compile cleanly with -Wsigned
* - djm@cvs.openbsd.org 2011/01/16 11:50:05Damien Miller2011-01-161-7/+7
| | | | | | | [clientloop.c] Use atomicio when flushing protocol 1 std{out,err} buffers at session close. This was a latent bug exposed by setting a SIGCHLD handler and spotted by kevin.brott AT gmail.com; ok dtucker@
* - djm@cvs.openbsd.org 2011/01/11 06:13:10Damien Miller2011-01-111-2/+2
| | | | | | [clientloop.c ssh-keygen.c sshd.c] some unsigned long long casts that make things a bit easier for portable without resorting to dropping PRIu64 formats everywhere
* - djm@cvs.openbsd.org 2011/01/08 10:51:51Damien Miller2011-01-111-2/+2
| | | | | | [clientloop.c] use host and not options.hostname, as the latter may have unescaped substitution characters
* - djm@cvs.openbsd.org 2011/01/06 22:23:02Damien Miller2011-01-061-2/+2
| | | | | | [clientloop.c] when exiting due to ServerAliveTimeout, mention the hostname that caused it (useful with backgrounded controlmaster)
* - djm@cvs.openbsd.org 2010/11/23 23:57:24Damien Miller2010-12-011-2/+2
| | | | | | [clientloop.c] avoid NULL deref on receiving a channel request on an unknown or invalid channel; report bz#1842 from jchadima AT redhat.com; ok dtucker@
* - djm@cvs.openbsd.org 2010/11/21 01:01:13Damien Miller2010-12-011-2/+2
| | | | | | [clientloop.c misc.c misc.h ssh-agent.1 ssh-agent.c] honour $TMPDIR for client xauth and ssh-agent temporary directories; feedback and ok markus@
* - djm@cvs.openbsd.org 2010/11/13 23:27:51Damien Miller2010-11-201-1/+4
| | | | | | | | | [clientloop.c misc.c misc.h packet.c packet.h readconf.c readconf.h] [servconf.c servconf.h session.c ssh.c ssh_config.5 sshd_config.5] allow ssh and sshd to set arbitrary TOS/DSCP/QoS values instead of hardcoding lowdelay/throughput. bz#1733 patch from philipp AT redfish-solutions.com; ok markus@ deraadt@
* - djm@cvs.openbsd.org 2010/10/06 06:39:28Damien Miller2010-10-071-1/+2
| | | | | | [clientloop.c ssh.c sshconnect.c sshconnect.h] kill proxy command on fatal() (we already kill it on clean exit); ok markus@
* - djm@cvs.openbsd.org 2010/07/19 09:15:12Damien Miller2010-08-031-4/+59
| | | | | | | | | | [clientloop.c readconf.c readconf.h ssh.c ssh_config.5] add a "ControlPersist" option that automatically starts a background ssh(1) multiplex master when connecting. This connection can stay alive indefinitely, or can be set to automatically close after a user-specified duration of inactivity. bz#1330 - patch by dwmw2 AT infradead.org, but further hacked on by wmertens AT cisco.com, apb AT cequrux.com, martin-mindrot-bugzilla AT earth.li and myself; "looks ok" markus@
* - djm@cvs.openbsd.org 2010/06/25 23:10:30Damien Miller2010-06-261-6/+20
| | | | | | | | | [ssh.c] log the hostname and address that we connected to at LogLevel=verbose after authentication is successful to mitigate "phishing" attacks by servers with trusted keys that accept authentication silently and automatically before presenting fake password/passphrase prompts; "nice!" markus@
* - djm@cvs.openbsd.org 2010/04/10 02:08:44Damien Miller2010-04-161-2/+2
| | | | | | | [clientloop.c] bz#1698: kill channel when pty allocation requests fail. Fixed stuck client if the server refuses pty allocation. ok dtucker@ "think so" markus@
* - djm@cvs.openbsd.org 2010/03/13 21:10:38Damien Miller2010-03-211-1/+2
| | | | | | [clientloop.c] protocol conformance fix: send language tag when disconnecting normally; spotted by 1.41421 AT gmail.com, ok markus@ deraadt@
* - djm@cvs.openbsd.org 2010/01/28 00:21:18Damien Miller2010-01-301-3/+4
| | | | | | | [clientloop.c] downgrade an error() to a debug() - this particular case can be hit in normal operation for certain sequences of mux slave vs session closure and is harmless
* - djm@cvs.openbsd.org 2010/01/26 01:28:35Damien Miller2010-01-261-23/+12
| | | | | | | | | | | | | | | | | | | | | | | | | [channels.c channels.h clientloop.c clientloop.h mux.c nchan.c ssh.c] rewrite ssh(1) multiplexing code to a more sensible protocol. The new multiplexing code uses channels for the listener and accepted control sockets to make the mux master non-blocking, so no stalls when processing messages from a slave. avoid use of fatal() in mux master protocol parsing so an errant slave process cannot take down a running master. implement requesting of port-forwards over multiplexed sessions. Any port forwards requested by the slave are added to those the master has established. add support for stdio forwarding ("ssh -W host:port ...") in mux slaves. document master/slave mux protocol so that other tools can use it to control a running ssh(1). Note: there are no guarantees that this protocol won't be incompatibly changed (though it is versioned). feedback Salvador Fandino, dtucker@ channel changes ok markus@
* - djm@cvs.openbsd.org 2010/01/09 05:04:24Darren Tucker2010-01-091-10/+13
| | | | | | [mux.c sshpty.h clientloop.c sshtty.c] quell tc[gs]etattr warnings when forcing a tty (ssh -tt), since we usually don't actually have a tty to read/set; bz#1686 ok dtucker@
* - djm@cvs.openbsd.org 2009/11/17 05:31:44Darren Tucker2010-01-081-6/+8
| | | | | | [clientloop.c] fix incorrect exit status when multiplexing and channel ID 0 is recycled bz#1570 reported by peter.oliver AT eon-is.co.uk; ok dtucker
* - andreas@cvs.openbsd.org 2009/10/24 11:15:29Darren Tucker2010-01-081-1/+11
| | | | | | | | [clientloop.c] client_loop() must detect if the session has been suspended and resumed, and take appropriate action in that case. From Martin Forssen, maf at appgate dot com ok markus@
* - (dtucker) [clientloop.c configure.ac defines.h] Make the client's IO bufferDarren Tucker2009-08-281-2/+2
| | | | | size a compile-time option and set it to 64k on Cygwin, since Corinna reports that it makes a significant difference to performance. ok djm@
* - stevesk@cvs.openbsd.org 2009/07/05 19:28:33Darren Tucker2009-07-051-6/+8
| | | | | | [clientloop.c] only send SSH2_MSG_DISCONNECT if we're in compat20; from dtucker@ ok deraadt@ markus@
* - andreas@cvs.openbsd.org 2009/05/28 16:50:16Darren Tucker2009-06-211-4/+5
| | | | | | | | | [sshd.c packet.c serverloop.c monitor_wrap.c clientloop.c sshconnect.c monitor.c Added roaming.h roaming_common.c roaming_dummy.c] Keep track of number of bytes read and written. Needed for upcoming changes. Most code from Martin Forssen, maf at appgate dot com. ok markus@ Also, applied appropriate changes to Makefile.in
* - andreas@cvs.openbsd.org 2009/05/27 06:34:36Darren Tucker2009-06-211-1/+7
| | | | | | [kex.c kex.h] Move the KEX_COOKIE_LEN define to kex.h ok markus@
* - andreas@cvs.openbsd.org 2009/05/27 06:31:25Darren Tucker2009-06-211-3/+3
| | | | | | | [canohost.h canohost.c] Add clear_cached_addr(), needed for upcoming changes allowing the peer address to change. ok markus@
* - djm@cvs.openbsd.org 2009/02/12 03:00:56Damien Miller2009-02-141-2/+2
| | | | | | | | [canohost.c canohost.h channels.c channels.h clientloop.c readconf.c] [readconf.h serverloop.c ssh.c] support remote port forwarding with a zero listen port (-R0:...) to dyamically allocate a listen port at runtime (this is actually specified in rfc4254); bz#1003 ok markus@
* - djm@cvs.openbsd.org 2009/01/22 10:02:34Damien Miller2009-01-281-5/+5
| | | | | | | | | | | [clientloop.c misc.c readconf.c readconf.h servconf.c servconf.h] [serverloop.c ssh-keyscan.c ssh.c sshd.c] make a2port() return -1 when it encounters an invalid port number 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@
* - stevesk@cvs.openbsd.org 2008/12/09 22:37:33Damien Miller2009-01-281-2/+2
| | | | | [clientloop.c] fix typo in error message
* - djm@cvs.openbsd.org 2008/12/09 02:38:18Damien Miller2008-12-091-4/+4
| | | | | | | | | [clientloop.c] The ~C escape handler does not work correctly for multiplexed sessions - it opens a commandline on the master session, instead of on the slave that requested it. Disable it on slave sessions until such time as it is fixed; bz#1543 report from Adrian Bridgett via Colin Watson ok markus@