forked from openssh/openssh-portable
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [email protected] 2014/07/15 15:54:14
[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@
- Loading branch information
Showing
44 changed files
with
1,312 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
20140718 | ||
- OpenBSD CVS Sync | ||
- [email protected] 2014/07/15 15:54:14 | ||
[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@ | ||
|
||
20140717 | ||
- (djm) [digest-openssl.c] Preserve array order when disabling digests. | ||
Reported by Petr Lautrbach. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,6 +232,56 @@ The contents of the "data" field for layer 2 packets is: | |
The "frame" field contains an IEEE 802.3 Ethernet frame, including | ||
header. | ||
|
||
2.4. connection: Unix domain socket forwarding | ||
|
||
OpenSSH supports local and remote Unix domain socket forwarding | ||
using the "streamlocal" extension. Forwarding is initiated as per | ||
TCP sockets but with a single path instead of a host and port. | ||
|
||
Similar to direct-tcpip, direct-streamlocal is sent by the client | ||
to request that the server make a connection to a Unix domain socket. | ||
|
||
byte SSH_MSG_CHANNEL_OPEN | ||
string "[email protected]" | ||
uint32 sender channel | ||
uint32 initial window size | ||
uint32 maximum packet size | ||
string socket path | ||
string reserved for future use | ||
|
||
Similar to forwarded-tcpip, forwarded-streamlocal is sent by the | ||
server when the client has previously send the server a streamlocal-forward | ||
GLOBAL_REQUEST. | ||
|
||
byte SSH_MSG_CHANNEL_OPEN | ||
string "[email protected]" | ||
uint32 sender channel | ||
uint32 initial window size | ||
uint32 maximum packet size | ||
string socket path | ||
string reserved for future use | ||
|
||
The reserved field is not currently defined and is ignored on the | ||
remote end. It is intended to be used in the future to pass | ||
information about the socket file, such as ownership and mode. | ||
The client currently sends the empty string for this field. | ||
|
||
Similar to tcpip-forward, streamlocal-forward is sent by the client | ||
to request remote forwarding of a Unix domain socket. | ||
|
||
byte SSH2_MSG_GLOBAL_REQUEST | ||
string "[email protected]" | ||
boolean TRUE | ||
string socket path | ||
|
||
Similar to cancel-tcpip-forward, cancel-streamlocal-forward is sent | ||
by the client cancel the forwarding of a Unix domain socket. | ||
|
||
byte SSH2_MSG_GLOBAL_REQUEST | ||
string "[email protected]" | ||
boolean FALSE | ||
string socket path | ||
|
||
3. SFTP protocol changes | ||
|
||
3.1. sftp: Reversal of arguments to SSH_FXP_SYMLINK | ||
|
@@ -356,4 +406,4 @@ respond with a SSH_FXP_STATUS message. | |
This extension is advertised in the SSH_FXP_VERSION hello with version | ||
"1". | ||
|
||
$OpenBSD: PROTOCOL,v 1.23 2013/12/01 23:19:05 djm Exp $ | ||
$OpenBSD: PROTOCOL,v 1.24 2014/07/15 15:54:14 millert Exp $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: auth-options.c,v 1.63 2014/06/24 01:13:21 djm Exp $ */ | ||
/* $OpenBSD: auth-options.c,v 1.64 2014/07/15 15:54:14 millert Exp $ */ | ||
/* | ||
* Author: Tatu Ylonen <[email protected]> | ||
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland | ||
|
@@ -26,9 +26,9 @@ | |
#include "log.h" | ||
#include "canohost.h" | ||
#include "buffer.h" | ||
#include "misc.h" | ||
#include "channels.h" | ||
#include "servconf.h" | ||
#include "misc.h" | ||
#include "key.h" | ||
#include "auth-options.h" | ||
#include "hostfile.h" | ||
|
@@ -325,6 +325,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) | |
patterns[i] = '\0'; | ||
opts++; | ||
p = patterns; | ||
/* XXX - add streamlocal support */ | ||
host = hpdelim(&p); | ||
if (host == NULL || strlen(host) >= NI_MAXHOST) { | ||
debug("%.100s, line %lu: Bad permitopen " | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: auth-passwd.c,v 1.43 2007/09/21 08:15:29 djm Exp $ */ | ||
/* $OpenBSD: auth-passwd.c,v 1.44 2014/07/15 15:54:14 millert Exp $ */ | ||
/* | ||
* Author: Tatu Ylonen <[email protected]> | ||
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland | ||
|
@@ -48,6 +48,7 @@ | |
#include "packet.h" | ||
#include "buffer.h" | ||
#include "log.h" | ||
#include "misc.h" | ||
#include "servconf.h" | ||
#include "key.h" | ||
#include "hostfile.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: auth-rh-rsa.c,v 1.43 2010/03/04 10:36:03 djm Exp $ */ | ||
/* $OpenBSD: auth-rh-rsa.c,v 1.44 2014/07/15 15:54:14 millert Exp $ */ | ||
/* | ||
* Author: Tatu Ylonen <[email protected]> | ||
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland | ||
|
@@ -24,6 +24,7 @@ | |
#include "uidswap.h" | ||
#include "log.h" | ||
#include "buffer.h" | ||
#include "misc.h" | ||
#include "servconf.h" | ||
#include "key.h" | ||
#include "hostfile.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: auth-rhosts.c,v 1.44 2010/03/07 11:57:13 dtucker Exp $ */ | ||
/* $OpenBSD: auth-rhosts.c,v 1.45 2014/07/15 15:54:14 millert Exp $ */ | ||
/* | ||
* Author: Tatu Ylonen <[email protected]> | ||
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland | ||
|
@@ -34,12 +34,12 @@ | |
#include "uidswap.h" | ||
#include "pathnames.h" | ||
#include "log.h" | ||
#include "misc.h" | ||
#include "servconf.h" | ||
#include "canohost.h" | ||
#include "key.h" | ||
#include "hostfile.h" | ||
#include "auth.h" | ||
#include "misc.h" | ||
|
||
/* import */ | ||
extern ServerOptions options; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: auth-rsa.c,v 1.87 2014/06/24 01:13:21 djm Exp $ */ | ||
/* $OpenBSD: auth-rsa.c,v 1.88 2014/07/15 15:54:14 millert Exp $ */ | ||
/* | ||
* Author: Tatu Ylonen <[email protected]> | ||
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland | ||
|
@@ -35,6 +35,7 @@ | |
#include "buffer.h" | ||
#include "pathnames.h" | ||
#include "log.h" | ||
#include "misc.h" | ||
#include "servconf.h" | ||
#include "key.h" | ||
#include "auth-options.h" | ||
|
@@ -45,7 +46,6 @@ | |
#endif | ||
#include "monitor_wrap.h" | ||
#include "ssh.h" | ||
#include "misc.h" | ||
|
||
#include "digest.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: auth1.c,v 1.81 2014/07/03 11:16:55 djm Exp $ */ | ||
/* $OpenBSD: auth1.c,v 1.82 2014/07/15 15:54:14 millert Exp $ */ | ||
/* | ||
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland | ||
* All rights reserved | ||
|
@@ -27,6 +27,7 @@ | |
#include "packet.h" | ||
#include "buffer.h" | ||
#include "log.h" | ||
#include "misc.h" | ||
#include "servconf.h" | ||
#include "compat.h" | ||
#include "key.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: canohost.c,v 1.70 2014/01/19 04:17:29 dtucker Exp $ */ | ||
/* $OpenBSD: canohost.c,v 1.71 2014/07/15 15:54:14 millert Exp $ */ | ||
/* | ||
* Author: Tatu Ylonen <[email protected]> | ||
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland | ||
|
@@ -16,6 +16,7 @@ | |
|
||
#include <sys/types.h> | ||
#include <sys/socket.h> | ||
#include <sys/un.h> | ||
|
||
#include <netinet/in.h> | ||
#include <arpa/inet.h> | ||
|
@@ -262,6 +263,11 @@ get_socket_address(int sock, int remote, int flags) | |
if (addr.ss_family == AF_INET6) | ||
addrlen = sizeof(struct sockaddr_in6); | ||
|
||
if (addr.ss_family == AF_UNIX) { | ||
/* Get the Unix domain socket path. */ | ||
return xstrdup(((struct sockaddr_un *)&addr)->sun_path); | ||
} | ||
|
||
ipv64_normalise_mapped(&addr, &addrlen); | ||
|
||
/* Get the address in ascii. */ | ||
|
@@ -384,6 +390,10 @@ get_sock_port(int sock, int local) | |
if (from.ss_family == AF_INET6) | ||
fromlen = sizeof(struct sockaddr_in6); | ||
|
||
/* Unix domain sockets don't have a port number. */ | ||
if (from.ss_family == AF_UNIX) | ||
return 0; | ||
|
||
/* Return port number. */ | ||
if ((r = getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0, | ||
strport, sizeof(strport), NI_NUMERICSERV)) != 0) | ||
|
Oops, something went wrong.