diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-09-28 07:56:48 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-09-28 07:56:48 +0000 |
commit | 725ac8b6344073209be33cdbe6901588ae4e69a8 (patch) | |
tree | a1c66c814f21d2978eb6dc4e0f0d21ce9fbde764 | |
parent | d7d8915fdbae8c66bb4a3d3904275f020760c01d (diff) |
X11DisplayOffset; aaron
-rw-r--r-- | usr.bin/ssh/channels.c | 6 | ||||
-rw-r--r-- | usr.bin/ssh/servconf.c | 12 | ||||
-rw-r--r-- | usr.bin/ssh/servconf.h | 3 |
3 files changed, 16 insertions, 5 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index 75ad8d19a4f..18bb8a8e686 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -16,7 +16,7 @@ arbitrary tcp/ip connections, and the authentication agent connection. */ #include "includes.h" -RCSID("$Id: channels.c,v 1.2 1999/09/28 04:45:36 provos Exp $"); +RCSID("$Id: channels.c,v 1.3 1999/09/28 07:56:47 deraadt Exp $"); #ifndef HAVE_GETHOSTNAME #include <sys/utsname.h> @@ -27,6 +27,7 @@ RCSID("$Id: channels.c,v 1.2 1999/09/28 04:45:36 provos Exp $"); #include "buffer.h" #include "authfd.h" #include "uidswap.h" +#include "servconf.h" /* Maximum number of fake X11 displays to try. */ #define MAX_DISPLAYS 1000 @@ -1052,6 +1053,7 @@ void channel_input_port_open(int payload_len) char *x11_create_display_inet(int screen_number) { + extern ServerOptions options; int display_number, port, sock; struct sockaddr_in sin; char buf[512]; @@ -1061,7 +1063,7 @@ char *x11_create_display_inet(int screen_number) struct utsname uts; #endif - for (display_number = 1; display_number < MAX_DISPLAYS; display_number++) + for (display_number = options.x11_display_offset; display_number < MAX_DISPLAYS; display_number++) { port = 6000 + display_number; memset(&sin, 0, sizeof(sin)); diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c index 4a70624d18a..e8d4d55dcf7 100644 --- a/usr.bin/ssh/servconf.c +++ b/usr.bin/ssh/servconf.c @@ -12,7 +12,7 @@ Created: Mon Aug 21 15:48:58 1995 ylo */ #include "includes.h" -RCSID("$Id: servconf.c,v 1.1 1999/09/26 20:53:37 deraadt Exp $"); +RCSID("$Id: servconf.c,v 1.2 1999/09/28 07:56:47 deraadt Exp $"); #include "ssh.h" #include "servconf.h" @@ -36,6 +36,7 @@ void initialize_server_options(ServerOptions *options) options->fascist_logging = -1; options->print_motd = -1; options->x11_forwarding = -1; + options->x11_display_offset = -1; options->strict_modes = -1; options->keepalives = -1; options->log_facility = (SyslogFacility)-1; @@ -96,6 +97,8 @@ void fill_default_server_options(ServerOptions *options) options->print_motd = 1; if (options->x11_forwarding == -1) options->x11_forwarding = 1; + if (options->x11_display_offset == -1) + options->x11_display_offset = 1; if (options->strict_modes == -1) options->strict_modes = 1; if (options->keepalives == -1) @@ -153,7 +156,7 @@ typedef enum sAFSTokenPassing, #endif sPasswordAuthentication, sAllowHosts, sDenyHosts, sListenAddress, - sPrintMotd, sIgnoreRhosts, sX11Forwarding, + sPrintMotd, sIgnoreRhosts, sX11Forwarding, sX11DisplayOffset, sStrictModes, sEmptyPasswd, sRandomSeedFile, sKeepAlives } ServerOpCodes; @@ -196,6 +199,7 @@ static struct { "printmotd", sPrintMotd }, { "ignorerhosts", sIgnoreRhosts }, { "x11forwarding", sX11Forwarding }, + { "x11displayoffset", sX11DisplayOffset }, { "strictmodes", sStrictModes }, { "permitemptypasswords", sEmptyPasswd }, { "randomseed", sRandomSeedFile }, @@ -424,6 +428,10 @@ void read_server_config(ServerOptions *options, const char *filename) intptr = &options->x11_forwarding; goto parse_flag; + case sX11DisplayOffset: + intptr = &options->x11_display_offset; + goto parse_int; + case sStrictModes: intptr = &options->strict_modes; goto parse_flag; diff --git a/usr.bin/ssh/servconf.h b/usr.bin/ssh/servconf.h index 2807218c1ad..f5413d6bbe1 100644 --- a/usr.bin/ssh/servconf.h +++ b/usr.bin/ssh/servconf.h @@ -13,7 +13,7 @@ Definitions for server configuration data and for the functions reading it. */ -/* RCSID("$Id: servconf.h,v 1.1 1999/09/26 20:53:37 deraadt Exp $"); */ +/* RCSID("$Id: servconf.h,v 1.2 1999/09/28 07:56:47 deraadt Exp $"); */ #ifndef SERVCONF_H #define SERVCONF_H @@ -36,6 +36,7 @@ typedef struct int fascist_logging; /* Perform very verbose logging. */ int print_motd; /* If true, print /etc/motd. */ int x11_forwarding; /* If true, permit inet (spoofing) X11 fwd. */ + int x11_display_offset; /* What DISPLAY number to start searching at */ int strict_modes; /* If true, require string home dir modes. */ int keepalives; /* If true, set SO_KEEPALIVE. */ SyslogFacility log_facility; /* Facility for system logging. */ |