summaryrefslogtreecommitdiff
path: root/mux.c
Commit message (Collapse)AuthorAgeFilesLines
* - djm@cvs.openbsd.org 2014/07/17 07:22:19djm2014-07-181-7/+59
| | | | | | | [mux.c ssh.c] reflect stdio-forward ("ssh -W host:port ...") failures in exit status. previously we were always returning 0. bz#2255 reported by Brendan Germain; ok dtucker
* - djm@cvs.openbsd.org 2014/07/17 00:10:18djm2014-07-181-2/+4
| | | | | [mux.c] preserve errno across syscall
* - millert@cvs.openbsd.org 2014/07/15 15:54:14djm2014-07-181-86/+117
| | | | | | | | | | | | | | | | [PROTOCOL auth-options.c auth-passwd.c auth-rh-rsa.c auth-rhosts.c] [auth-rsa.c auth.c auth1.c auth2-hostbased.c auth2-kbdint.c auth2-none.c] [auth2-passwd.c auth2-pubkey.c auth2.c canohost.c channels.c channels.h] [clientloop.c misc.c misc.h monitor.c mux.c packet.c readconf.c] [readconf.h servconf.c servconf.h serverloop.c session.c ssh-agent.c] [ssh.c ssh_config.5 sshconnect.c sshconnect1.c sshconnect2.c sshd.c] [sshd_config.5 sshlogin.c] Add support for Unix domain socket forwarding. A remote TCP port 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@
* - djm@cvs.openbsd.org 2014/04/28 03:09:18djm2014-05-151-3/+3
| | | | | | | | [authfile.c bufaux.c buffer.h channels.c krl.c mux.c packet.c packet.h] [ssh-keygen.c] buffer_get_string_ptr's return should be const to remind callers that futzing with it will futz with the actual buffer contents
* - djm@cvs.openbsd.org 2013/07/12 00:19:59djm2013-07-181-6/+13
| | | | | | [auth-options.c auth-rsa.c bufaux.c buffer.h channels.c hostfile.c] [hostfile.h mux.c packet.c packet.h roaming_common.c serverloop.c] fix pointer-signedness warnings from clang/llvm-3.3; "seems nice" deraadt@
* - dtucker@cvs.openbsd.org 2013/06/05 02:07:29dtucker2013-06-051-2/+6
| | | | | | [mux.c] fix leaks in mux error paths, from Zhenbo Xu, found by Melton. bz#1967, ok djm
* - dtucker@cvs.openbsd.org 2013/06/02 23:36:29dtucker2013-06-051-2/+2
| | | | | | [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@
* - djm@cvs.openbsd.org 2013/05/17 00:13:13dtucker2013-06-011-70/+52
| | | | | | | | | | | | | | | | | | [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/04/22 01:17:18djm2013-04-231-2/+2
| | | | | [mux.c] typo in debug output: evitval->exitval
* - djm@cvs.openbsd.org 2013/04/05 00:58:51djm2013-04-231-2/+3
| | | | | | [mux.c] cleanup mux-created channels that are in SSH_CHANNEL_OPENING state too (in addition to ones already in OPEN); bz#2079, ok dtucker@
* - (djm) [configure.ac includes.h loginrec.c mux.c sftp.c] Preferdjm2013-02-221-4/+0
| | | | | bsd/libutil.h to libutil.h to avoid deprecation warnings on Ubuntu. ok tim
* - djm@cvs.openbsd.org 2013/01/02 00:32:07djm2013-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/08/17 00:45:45dtucker2012-09-061-2/+2
| | | | | | | [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/07/06 01:37:21djm2012-07-061-3/+9
| | | | | | | [mux.c] fix memory leak of passed-in environment variables and connection context when new session message is malformed; bz#2003 from Bert.Wesarg AT googlemail.com
* - djm@cvs.openbsd.org 2012/06/01 01:01:22djm2012-06-201-2/+2
| | | | | | [mux.c] fix memory leak when mux socket creation fails; bz#2002 from bert.wesarg AT googlemail.com
* - djm@cvs.openbsd.org 2012/01/07 21:11:36djm2012-06-201-1/+1
| | | | | | [mux.c] fix double-free in new session handler NB. Id sync only
* - djm@cvs.openbsd.org 2011/12/04 23:16:12djm2012-06-201-4/+1
| | | | | | | | | | | | [mux.c] revert: > revision 1.32 > date: 2011/12/02 00:41:56; author: djm; state: Exp; lines: +4 -1 > fix bz#1948: ssh -f doesn't fork for multiplexed connection. > ok dtucker@ it interacts badly with ControlPersist
* - djm@cvs.openbsd.org 2011/12/02 00:41:56djm2012-06-201-1/+4
| | | | | | [mux.c] fix bz#1948: ssh -f doesn't fork for multiplexed connection. ok dtucker@
* - djm@cvs.openbsd.org 2012/01/07 21:11:36djm2012-02-101-4/+2
| | | | | [mux.c] fix double-free in new session handler
* - djm@cvs.openbsd.org 2011/12/04 23:16:12djm2011-12-181-4/+1
| | | | | | | | | | [mux.c] revert: > revision 1.32 > date: 2011/12/02 00:41:56; author: djm; state: Exp; lines: +4 -1 > fix bz#1948: ssh -f doesn't fork for multiplexed connection. > ok dtucker@ it interacts badly with ControlPersist
* - djm@cvs.openbsd.org 2011/12/02 00:41:56djm2011-12-181-1/+4
| | | | | | [mux.c] fix bz#1948: ssh -f doesn't fork for multiplexed connection. ok dtucker@
* - markus@cvs.openbsd.org 2011/09/23 07:45:05dtucker2011-10-021-5/+14
| | | | | | | | | | | [mux.c readconf.h channels.h compat.h compat.c ssh.c readconf.c channels.c version.h] unbreak remote portforwarding with dynamic allocated listen ports: 1) send the actual listen port in the open message (instead of 0). this allows multiple forwardings with a dynamic listen port 2) update the matching permit-open entry, so we can identify where to connect to report: den at skbkontur.ru and P. Szczygielski feedback and ok djm@
* - djm@cvs.openbsd.org 2011/09/09 22:46:44djm2011-09-221-21/+83
| | | | | | | [channels.c channels.h clientloop.h mux.c ssh.c] support for cancelling local and remote port forwards via the multiplex socket. Use ssh -O cancel -L xx:xx:xx -R yy:yy:yy user@host" to request the cancellation of the specified forwardings; ok markus@
* - djm@cvs.openbsd.org 2011/06/22 22:08:42djm2011-06-221-3/+5
| | | | | | [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/05/08 12:52:01djm2011-05-141-12/+48
| | | | | | | | | | | | | | [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:32djm2011-05-141-4/+3
| | | | | | [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/05/05 05:12:08djm2011-05-141-6/+10
| | | | | | [mux.c] gracefully fall back when ControlPath is too large for a sockaddr_un. ok markus@ as part of a larger diff
* - djm@cvs.openbsd.org 2011/04/17 22:42:42djm2011-05-051-1/+85
| | | | | | | [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/13 21:54:53djm2011-01-141-5/+5
| | | | | [mux.c] correct error messages; patch from bert.wesarg AT googlemail.com
* - OpenBSD CVS Syncdjm2010-10-211-2/+2
| | | | | | - dtucker@cvs.openbsd.org 2010/10/12 02:22:24 [mux.c] Typo in confirmation message. bz#1827, patch from imorgan at nas nasa gov
* - djm@cvs.openbsd.org 2010/09/20 07:19:27djm2010-09-241-4/+46
| | | | | | | | | | [mux.c] "atomically" create the listening mux socket by binding it on a temorary name and then linking it into position after listen() has succeeded. this allows the mux clients to determine that the server socket is either ready or stale without races. stale server sockets are now automatically removed ok deraadt
* - djm@cvs.openbsd.org 2010/06/25 23:10:30djm2010-06-261-3/+6
| | | | | | | | | [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/06/25 07:14:46djm2010-06-251-8/+4
| | | | | | [channels.c mux.c readconf.c readconf.h ssh.h] bz#1327: remove hardcoded limit of 100 permitopen clauses and port forwards per direction; ok markus@ stevesk@
* - djm@cvs.openbsd.org 2010/06/17 07:07:30djm2010-06-251-2/+2
| | | | | | | | [mux.c] Correct sizing of object to be allocated by calloc(), replacing sizeof(state) with sizeof(*state). This worked by accident since the struct contained a single int at present, but could have broken in the future. patch from hyc AT symas.com
* - markus@cvs.openbsd.org 2010/05/16 12:55:51djm2010-05-211-8/+105
| | | | | | | | [PROTOCOL.mux clientloop.h mux.c readconf.c readconf.h ssh.1 ssh.c] mux support for remote forwarding with dynamic port allocation, use with LPORT=`ssh -S muxsocket -R0:localhost:25 -O forward somehost` feedback and ok djm@
* - djm@cvs.openbsd.org 2010/05/14 23:29:23djm2010-05-211-10/+37
| | | | | | | | | | | | | | [channels.c channels.h mux.c ssh.c] Pause the mux channel while waiting for reply from aynch callbacks. Prevents misordering of replies if new requests arrive while waiting. Extend channel open confirm callback to allow signalling failure conditions as well as success. Use this to 1) fix a memory leak, 2) start using the above pause mechanism and 3) delay sending a success/ failure message on mux slave session open until we receive a reply from the server. motivated by and with feedback from markus@
* - djm@cvs.openbsd.org 2010/04/23 22:27:38djm2010-05-101-3/+3
| | | | | | | [mux.c] set "detach_close" flag when registering channel cleanup callbacks. This causes the channel to close normally when its fds close and hangs when terminating a mux slave using ~. bz#1758; ok markus@
* - djm@cvs.openbsd.org 2010/04/10 05:48:16djm2010-04-161-2/+2
| | | | | [mux.c] fix NULL dereference; from matthew.haub AT alumni.adelaide.edu.au
* - djm@cvs.openbsd.org 2010/01/29 20:16:17djm2010-01-301-3/+5
| | | | | | [mux.c] kill correct channel (was killing already-dead mux channel, not its session channel)
* - djm@cvs.openbsd.org 2010/01/29 00:20:41djm2010-01-301-2/+2
| | | | | | [sshd.c] set FD_CLOEXEC on sock_in/sock_out; bz#1706 from jchadima AT redhat.com ok dtucker@
* - djm@cvs.openbsd.org 2010/01/27 13:26:17djm2010-01-271-2/+8
| | | | | | | | | | | | | | [mux.c] fix bug introduced in mux rewrite: In a mux master, when a socket to a mux slave closes before its server session (as may occur when the slave has been signalled), gracefully close the server session rather than deleting its channel immediately. A server may have more messages on that channel to send (e.g. an exit message) that will fatal() the client if they are sent to a channel that has been prematurely deleted. spotted by imorgan AT nas.nasa.gov
* - djm@cvs.openbsd.org 2010/01/26 02:15:20djm2010-01-271-1/+1
| | | | | | [mux.c] -Wuninitialized and remove a // comment; from portable (Id sync only)
* - djm@cvs.openbsd.org 2010/01/26 01:28:35djm2010-01-261-415/+1425
| | | | | | | | | | | | | | | | | | | | | | | | | [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:24dtucker2010-01-091-3/+4
| | | | | | [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@
* - dtucker@cvs.openbsd.org 2009/08/20 23:54:28dtucker2009-10-061-2/+2
| | | | | [mux.c] subsystem_flag is defined in ssh.c so it's extern; ok djm
* - dtucker@cvs.openbsd.org 2008/06/13 17:21:20dtucker2008-06-131-3/+3
| | | | | [mux.c] Friendlier error messages for mux fallback. ok djm@
* - dtucker@cvs.openbsd.org 2008/06/13 00:47:53dtucker2008-06-131-2/+2
| | | | | [mux.c] upcast size_t to u_long to match format arg; ok djm@
* - djm@cvs.openbsd.org 2008/06/13 00:16:49dtucker2008-06-131-18/+54
| | | | | | | [mux.c] fall back to creating a new TCP connection on most multiplexing errors (socket connect fail, invalid version, refused permittion, corrupted messages, etc.); bz #1329 ok dtucker@
* - djm@cvs.openbsd.org 2008/06/12 15:19:17dtucker2008-06-121-1/+2
| | | | | | [clientloop.h channels.h clientloop.c channels.c mux.c] The multiplexing escape char handler commit last night introduced a small memory leak per session; plug it.
* - djm@cvs.openbsd.org 2008/06/12 05:32:30dtucker2008-06-121-2/+5
| | | | | [mux.c] some more TODO for me