summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2008-07-22 19:45:18 +0000
committerColin Watson <cjwatson@debian.org>2008-07-22 19:45:18 +0000
commit137d76ba65883aa8143af1fcad83b57e7badef0c (patch)
treef426e804bb5248ceafedfab7bb78ae6e6752942c /readconf.c
parentdac7d049dad31f5f84d421d4eb628a7e13f977d7 (diff)
parentef94e5613d37bcbf880f21ee6094e4b1c7683a4c (diff)
* New upstream release (closes: #474301). Important changes not previously
backported to 4.7p1: - 4.9/4.9p1 (http://www.openssh.com/txt/release-4.9): + Added chroot(2) support for sshd(8), controlled by a new option "ChrootDirectory" (closes: #139047, LP: #24777). + Linked sftp-server(8) into sshd(8). The internal sftp server is used when the command "internal-sftp" is specified in a Subsystem or ForceCommand declaration. When used with ChrootDirectory, the internal sftp server requires no special configuration of files inside the chroot environment. + Added a protocol extension method "posix-rename@openssh.com" for sftp-server(8) to perform POSIX atomic rename() operations; sftp(1) prefers this if available (closes: #308561). + Removed the fixed limit of 100 file handles in sftp-server(8). + ssh(8) will now skip generation of SSH protocol 1 ephemeral server keys when in inetd mode and protocol 2 connections are negotiated. This speeds up protocol 2 connections to inetd-mode servers that also allow Protocol 1. + Accept the PermitRootLogin directive in a sshd_config(5) Match block. Allows for, e.g. permitting root only from the local network. + Reworked sftp(1) argument splitting and escaping to be more internally consistent (i.e. between sftp commands) and more consistent with sh(1). Please note that this will change the interpretation of some quoted strings, especially those with embedded backslash escape sequences. + Support "Banner=none" in sshd_config(5) to disable sending of a pre-login banner (e.g. in a Match block). + ssh(1) ProxyCommands are now executed with $SHELL rather than /bin/sh. + ssh(1)'s ConnectTimeout option is now applied to both the TCP connection and the SSH banner exchange (previously it just covered the TCP connection). This allows callers of ssh(1) to better detect and deal with stuck servers that accept a TCP connection but don't progress the protocol, and also makes ConnectTimeout useful for connections via a ProxyCommand. + scp(1) incorrectly reported "stalled" on slow copies (closes: #140828). + scp(1) date underflow for timestamps before epoch. + ssh(1) used the obsolete SIG DNS RRtype for host keys in DNS, instead of the current standard RRSIG. + Correctly drain ACKs when a sftp(1) upload write fails midway, avoids a fatal() exit from what should be a recoverable condition. + Fixed ssh-keygen(1) selective host key hashing (i.e. "ssh-keygen -HF hostname") to not include any IP address in the data to be hashed. + Make ssh(1) skip listening on the IPv6 wildcard address when a binding address of 0.0.0.0 is used against an old SSH server that does not support the RFC4254 syntax for wildcard bind addresses. + Enable IPV6_V6ONLY socket option on sshd(8) listen socket, as is already done for X11/TCP forwarding sockets (closes: #439661). + Fix FD leak that could hang a ssh(1) connection multiplexing master. + Make ssh(1) -q option documentation consistent with reality. + Fixed sshd(8) PAM support not calling pam_session_close(), or failing to call it with root privileges (closes: #372680). + Fix activation of OpenSSL engine support when requested in configure (LP: #119295). - 5.1/5.1p1 (http://www.openssh.com/txt/release-5.1): + Introduce experimental SSH Fingerprint ASCII Visualisation to ssh(1) and ssh-keygen(1). Visual fingerprint display is controlled by a new ssh_config(5) option "VisualHostKey". The intent is to render SSH host keys in a visual form that is amenable to easy recall and rejection of changed host keys. + sshd_config(5) now supports CIDR address/masklen matching in "Match address" blocks, with a fallback to classic wildcard matching. + sshd(8) now supports CIDR matching in ~/.ssh/authorized_keys from="..." restrictions, also with a fallback to classic wildcard matching. + Added an extended test mode (-T) to sshd(8) to request that it write its effective configuration to stdout and exit. Extended test mode also supports the specification of connection parameters (username, source address and hostname) to test the application of sshd_config(5) Match rules. + ssh(1) now prints the number of bytes transferred and the overall connection throughput for SSH protocol 2 sessions when in verbose mode (previously these statistics were displayed for protocol 1 connections only). + sftp-server(8) now supports extension methods statvfs@openssh.com and fstatvfs@openssh.com that implement statvfs(2)-like operations. + sftp(1) now has a "df" command to the sftp client that uses the statvfs@openssh.com to produce a df(1)-like display of filesystem space and inode utilisation (requires statvfs@openssh.com support on the server). + Added a MaxSessions option to sshd_config(5) to allow control of the number of multiplexed sessions supported over a single TCP connection. This allows increasing the number of allowed sessions above the previous default of 10, disabling connection multiplexing (MaxSessions=1) or disallowing login/shell/subsystem sessions entirely (MaxSessions=0). + Added a no-more-sessions@openssh.com global request extension that is sent from ssh(1) to sshd(8) when the client knows that it will never request another session (i.e. when session multiplexing is disabled). This allows a server to disallow further session requests and terminate the session in cases where the client has been hijacked. + ssh-keygen(1) now supports the use of the -l option in combination with -F to search for a host in ~/.ssh/known_hosts and display its fingerprint. + ssh-keyscan(1) now defaults to "rsa" (protocol 2) keys, instead of "rsa1". + Added an AllowAgentForwarding option to sshd_config(8) to control whether authentication agent forwarding is permitted. Note that this is a loose control, as a client may install their own unofficial forwarder. + ssh(1) and sshd(8): avoid unnecessary malloc/copy/free when receiving network data, resulting in a ~10% speedup. + ssh(1) and sshd(8) will now try additional addresses when connecting to a port forward destination whose DNS name resolves to more than one address. The previous behaviour was to try the only first address and give up if that failed. + ssh(1) and sshd(8) now support signalling that channels are half-closed for writing, through a channel protocol extension notification "eow@openssh.com". This allows propagation of closed file descriptors, so that commands such as "ssh -2 localhost od /bin/ls | true" do not send unnecessary data over the wire. + sshd(8): increased the default size of ssh protocol 1 ephemeral keys from 768 to 1024 bits. + When ssh(1) has been requested to fork after authentication ("ssh -f") with ExitOnForwardFailure enabled, delay the fork until after replies for any -R forwards have been seen. Allows for robust detection of -R forward failure when using -f. + "Match group" blocks in sshd_config(5) now support negation of groups. E.g. "Match group staff,!guests". + sftp(1) and sftp-server(8) now allow chmod-like operations to set set[ug]id/sticky bits. + The MaxAuthTries option is now permitted in sshd_config(5) match blocks. + Multiplexed ssh(1) sessions now support a subset of the ~ escapes that are available to a primary connection. + ssh(1) connection multiplexing will now fall back to creating a new connection in most error cases (closes: #352830). + Make ssh(1) deal more gracefully with channel requests that fail. Previously it would optimistically assume that requests would always succeed, which could cause hangs if they did not (e.g. when the server runs out of file descriptors). + ssh(1) now reports multiplexing errors via the multiplex slave's stderr where possible (subject to LogLevel in the mux master). + Prevent sshd(8) from erroneously applying public key restrictions leaned from ~/.ssh/authorized_keys to other authentication methods when public key authentication subsequently fails (LP: #161047). + Fixed an UMAC alignment problem that manifested on Itanium platforms.
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/readconf.c b/readconf.c
index 07f5775d5..7ad5a8e18 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.162 2007/03/20 03:56:12 tedu Exp $ */ 1/* $OpenBSD: readconf.c,v 1.167 2008/06/26 11:46:31 grunk Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -135,6 +135,7 @@ typedef enum {
135 oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, 135 oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
136 oSendEnv, oControlPath, oControlMaster, oHashKnownHosts, 136 oSendEnv, oControlPath, oControlMaster, oHashKnownHosts,
137 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, 137 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
138 oVisualHostKey,
138 oProtocolKeepAlives, oSetupTimeOut, 139 oProtocolKeepAlives, oSetupTimeOut,
139 oDeprecated, oUnsupported 140 oDeprecated, oUnsupported
140} OpCodes; 141} OpCodes;
@@ -237,6 +238,7 @@ static struct {
237 { "tunneldevice", oTunnelDevice }, 238 { "tunneldevice", oTunnelDevice },
238 { "localcommand", oLocalCommand }, 239 { "localcommand", oLocalCommand },
239 { "permitlocalcommand", oPermitLocalCommand }, 240 { "permitlocalcommand", oPermitLocalCommand },
241 { "visualhostkey", oVisualHostKey },
240 { "protocolkeepalives", oProtocolKeepAlives }, 242 { "protocolkeepalives", oProtocolKeepAlives },
241 { "setuptimeout", oSetupTimeOut }, 243 { "setuptimeout", oSetupTimeOut },
242 { NULL, oBadOption } 244 { NULL, oBadOption }
@@ -339,6 +341,7 @@ process_config_line(Options *options, const char *host,
339{ 341{
340 char *s, **charptr, *endofnumber, *keyword, *arg, *arg2, fwdarg[256]; 342 char *s, **charptr, *endofnumber, *keyword, *arg, *arg2, fwdarg[256];
341 int opcode, *intptr, value, value2, scale; 343 int opcode, *intptr, value, value2, scale;
344 LogLevel *log_level_ptr;
342 long long orig, val64; 345 long long orig, val64;
343 size_t len; 346 size_t len;
344 Forward fwd; 347 Forward fwd;
@@ -523,7 +526,6 @@ parse_yesnoask:
523 goto parse_int; 526 goto parse_int;
524 527
525 case oRekeyLimit: 528 case oRekeyLimit:
526 intptr = &options->rekey_limit;
527 arg = strdelim(&s); 529 arg = strdelim(&s);
528 if (!arg || *arg == '\0') 530 if (!arg || *arg == '\0')
529 fatal("%.200s line %d: Missing argument.", filename, linenum); 531 fatal("%.200s line %d: Missing argument.", filename, linenum);
@@ -551,14 +553,14 @@ parse_yesnoask:
551 } 553 }
552 val64 *= scale; 554 val64 *= scale;
553 /* detect integer wrap and too-large limits */ 555 /* detect integer wrap and too-large limits */
554 if ((val64 / scale) != orig || val64 > INT_MAX) 556 if ((val64 / scale) != orig || val64 > UINT_MAX)
555 fatal("%.200s line %d: RekeyLimit too large", 557 fatal("%.200s line %d: RekeyLimit too large",
556 filename, linenum); 558 filename, linenum);
557 if (val64 < 16) 559 if (val64 < 16)
558 fatal("%.200s line %d: RekeyLimit too small", 560 fatal("%.200s line %d: RekeyLimit too small",
559 filename, linenum); 561 filename, linenum);
560 if (*activep && *intptr == -1) 562 if (*activep && options->rekey_limit == -1)
561 *intptr = (int)val64; 563 options->rekey_limit = (u_int32_t)val64;
562 break; 564 break;
563 565
564 case oIdentityFile: 566 case oIdentityFile:
@@ -717,14 +719,14 @@ parse_int:
717 break; 719 break;
718 720
719 case oLogLevel: 721 case oLogLevel:
720 intptr = (int *) &options->log_level; 722 log_level_ptr = &options->log_level;
721 arg = strdelim(&s); 723 arg = strdelim(&s);
722 value = log_level_number(arg); 724 value = log_level_number(arg);
723 if (value == SYSLOG_LEVEL_NOT_SET) 725 if (value == SYSLOG_LEVEL_NOT_SET)
724 fatal("%.200s line %d: unsupported log level '%s'", 726 fatal("%.200s line %d: unsupported log level '%s'",
725 filename, linenum, arg ? arg : "<NONE>"); 727 filename, linenum, arg ? arg : "<NONE>");
726 if (*activep && (LogLevel) *intptr == SYSLOG_LEVEL_NOT_SET) 728 if (*activep && *log_level_ptr == SYSLOG_LEVEL_NOT_SET)
727 *intptr = (LogLevel) value; 729 *log_level_ptr = (LogLevel) value;
728 break; 730 break;
729 731
730 case oLocalForward: 732 case oLocalForward:
@@ -844,6 +846,7 @@ parse_int:
844 846
845 case oServerAliveInterval: 847 case oServerAliveInterval:
846 case oProtocolKeepAlives: /* Debian-specific compatibility alias */ 848 case oProtocolKeepAlives: /* Debian-specific compatibility alias */
849 case oSetupTimeOut: /* Debian-specific compatibility alias */
847 intptr = &options->server_alive_interval; 850 intptr = &options->server_alive_interval;
848 goto parse_time; 851 goto parse_time;
849 852
@@ -941,9 +944,9 @@ parse_int:
941 intptr = &options->permit_local_command; 944 intptr = &options->permit_local_command;
942 goto parse_flag; 945 goto parse_flag;
943 946
944 case oSetupTimeOut: 947 case oVisualHostKey:
945 intptr = &options->setuptimeout; 948 intptr = &options->visual_host_key;
946 goto parse_int; 949 goto parse_flag;
947 950
948 case oDeprecated: 951 case oDeprecated:
949 debug("%s line %d: Deprecated option \"%s\"", 952 debug("%s line %d: Deprecated option \"%s\"",
@@ -1073,7 +1076,6 @@ initialize_options(Options * options)
1073 options->strict_host_key_checking = -1; 1076 options->strict_host_key_checking = -1;
1074 options->compression = -1; 1077 options->compression = -1;
1075 options->tcp_keep_alive = -1; 1078 options->tcp_keep_alive = -1;
1076 options->setuptimeout = -1;
1077 options->compression_level = -1; 1079 options->compression_level = -1;
1078 options->port = -1; 1080 options->port = -1;
1079 options->address_family = -1; 1081 options->address_family = -1;
@@ -1118,6 +1120,7 @@ initialize_options(Options * options)
1118 options->tun_remote = -1; 1120 options->tun_remote = -1;
1119 options->local_command = NULL; 1121 options->local_command = NULL;
1120 options->permit_local_command = -1; 1122 options->permit_local_command = -1;
1123 options->visual_host_key = -1;
1121} 1124}
1122 1125
1123/* 1126/*
@@ -1263,13 +1266,8 @@ fill_default_options(Options * options)
1263 options->tun_remote = SSH_TUNID_ANY; 1266 options->tun_remote = SSH_TUNID_ANY;
1264 if (options->permit_local_command == -1) 1267 if (options->permit_local_command == -1)
1265 options->permit_local_command = 0; 1268 options->permit_local_command = 0;
1266 if (options->setuptimeout == -1) { 1269 if (options->visual_host_key == -1)
1267 /* in batch mode, default is 5mins */ 1270 options->visual_host_key = 0;
1268 if (options->batch_mode == 1)
1269 options->setuptimeout = 300;
1270 else
1271 options->setuptimeout = 0;
1272 }
1273 /* options->local_command should not be set by default */ 1271 /* options->local_command should not be set by default */
1274 /* options->proxy_command should not be set by default */ 1272 /* options->proxy_command should not be set by default */
1275 /* options->user will be set in the main program if appropriate */ 1273 /* options->user will be set in the main program if appropriate */
@@ -1326,7 +1324,7 @@ parse_forward(Forward *fwd, const char *fwdspec)
1326 1324
1327 xfree(p); 1325 xfree(p);
1328 1326
1329 if (fwd->listen_port == 0 && fwd->connect_port == 0) 1327 if (fwd->listen_port == 0 || fwd->connect_port == 0)
1330 goto fail_free; 1328 goto fail_free;
1331 1329
1332 if (fwd->connect_host != NULL && 1330 if (fwd->connect_host != NULL &&