summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--readconf.c50
-rw-r--r--readconf.h8
-rw-r--r--ssh.110
-rw-r--r--ssh.c32
-rw-r--r--ssh_config.524
6 files changed, 66 insertions, 62 deletions
diff --git a/ChangeLog b/ChangeLog
index 38082e9c4..6935b5cad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,10 @@
16 - jmc@cvs.openbsd.org 2013/10/16 06:42:25 16 - jmc@cvs.openbsd.org 2013/10/16 06:42:25
17 [ssh_config.5] 17 [ssh_config.5]
18 tweak previous; 18 tweak previous;
19 - djm@cvs.openbsd.org 2013/10/16 22:49:39
20 [readconf.c readconf.h ssh.1 ssh.c ssh_config.5]
21 s/canonicalise/canonicalize/ for consistency with existing spelling,
22 e.g. authorized_keys; pointed out by naddy@
19 23
2020131015 2420131015
21 - (djm) OpenBSD CVS Sync 25 - (djm) OpenBSD CVS Sync
diff --git a/readconf.c b/readconf.c
index de8eb7cd3..fb77fa9dc 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.208 2013/10/16 02:31:45 djm Exp $ */ 1/* $OpenBSD: readconf.c,v 1.209 2013/10/16 22:49:38 djm 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
@@ -144,8 +144,8 @@ typedef enum {
144 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, 144 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
145 oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, 145 oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication,
146 oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, oProxyUseFdpass, 146 oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, oProxyUseFdpass,
147 oCanonicalDomains, oCanonicaliseHostname, oCanonicaliseMaxDots, 147 oCanonicalDomains, oCanonicalizeHostname, oCanonicalizeMaxDots,
148 oCanonicaliseFallbackLocal, oCanonicalisePermittedCNAMEs, 148 oCanonicalizeFallbackLocal, oCanonicalizePermittedCNAMEs,
149 oIgnoredUnknownOption, oDeprecated, oUnsupported 149 oIgnoredUnknownOption, oDeprecated, oUnsupported
150} OpCodes; 150} OpCodes;
151 151
@@ -260,10 +260,10 @@ static struct {
260 { "requesttty", oRequestTTY }, 260 { "requesttty", oRequestTTY },
261 { "proxyusefdpass", oProxyUseFdpass }, 261 { "proxyusefdpass", oProxyUseFdpass },
262 { "canonicaldomains", oCanonicalDomains }, 262 { "canonicaldomains", oCanonicalDomains },
263 { "canonicalisefallbacklocal", oCanonicaliseFallbackLocal }, 263 { "canonicalizefallbacklocal", oCanonicalizeFallbackLocal },
264 { "canonicalisehostname", oCanonicaliseHostname }, 264 { "canonicalizehostname", oCanonicalizeHostname },
265 { "canonicalisemaxdots", oCanonicaliseMaxDots }, 265 { "canonicalizemaxdots", oCanonicalizeMaxDots },
266 { "canonicalisepermittedcnames", oCanonicalisePermittedCNAMEs }, 266 { "canonicalizepermittedcnames", oCanonicalizePermittedCNAMEs },
267 { "ignoreunknown", oIgnoreUnknown }, 267 { "ignoreunknown", oIgnoreUnknown },
268 268
269 { NULL, oBadOption } 269 { NULL, oBadOption }
@@ -644,7 +644,7 @@ static const struct multistate multistate_requesttty[] = {
644 { "auto", REQUEST_TTY_AUTO }, 644 { "auto", REQUEST_TTY_AUTO },
645 { NULL, -1 } 645 { NULL, -1 }
646}; 646};
647static const struct multistate multistate_canonicalisehostname[] = { 647static const struct multistate multistate_canonicalizehostname[] = {
648 { "true", SSH_CANONICALISE_YES }, 648 { "true", SSH_CANONICALISE_YES },
649 { "false", SSH_CANONICALISE_NO }, 649 { "false", SSH_CANONICALISE_NO },
650 { "yes", SSH_CANONICALISE_YES }, 650 { "yes", SSH_CANONICALISE_YES },
@@ -1321,7 +1321,7 @@ parse_int:
1321 } 1321 }
1322 break; 1322 break;
1323 1323
1324 case oCanonicalisePermittedCNAMEs: 1324 case oCanonicalizePermittedCNAMEs:
1325 value = options->num_permitted_cnames != 0; 1325 value = options->num_permitted_cnames != 0;
1326 while ((arg = strdelim(&s)) != NULL && *arg != '\0') { 1326 while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
1327 /* Either '*' for everything or 'list:list' */ 1327 /* Either '*' for everything or 'list:list' */
@@ -1350,17 +1350,17 @@ parse_int:
1350 } 1350 }
1351 break; 1351 break;
1352 1352
1353 case oCanonicaliseHostname: 1353 case oCanonicalizeHostname:
1354 intptr = &options->canonicalise_hostname; 1354 intptr = &options->canonicalize_hostname;
1355 multistate_ptr = multistate_canonicalisehostname; 1355 multistate_ptr = multistate_canonicalizehostname;
1356 goto parse_multistate; 1356 goto parse_multistate;
1357 1357
1358 case oCanonicaliseMaxDots: 1358 case oCanonicalizeMaxDots:
1359 intptr = &options->canonicalise_max_dots; 1359 intptr = &options->canonicalize_max_dots;
1360 goto parse_int; 1360 goto parse_int;
1361 1361
1362 case oCanonicaliseFallbackLocal: 1362 case oCanonicalizeFallbackLocal:
1363 intptr = &options->canonicalise_fallback_local; 1363 intptr = &options->canonicalize_fallback_local;
1364 goto parse_flag; 1364 goto parse_flag;
1365 1365
1366 case oDeprecated: 1366 case oDeprecated:
@@ -1528,9 +1528,9 @@ initialize_options(Options * options)
1528 options->ignored_unknown = NULL; 1528 options->ignored_unknown = NULL;
1529 options->num_canonical_domains = 0; 1529 options->num_canonical_domains = 0;
1530 options->num_permitted_cnames = 0; 1530 options->num_permitted_cnames = 0;
1531 options->canonicalise_max_dots = -1; 1531 options->canonicalize_max_dots = -1;
1532 options->canonicalise_fallback_local = -1; 1532 options->canonicalize_fallback_local = -1;
1533 options->canonicalise_hostname = -1; 1533 options->canonicalize_hostname = -1;
1534} 1534}
1535 1535
1536/* 1536/*
@@ -1684,12 +1684,12 @@ fill_default_options(Options * options)
1684 options->request_tty = REQUEST_TTY_AUTO; 1684 options->request_tty = REQUEST_TTY_AUTO;
1685 if (options->proxy_use_fdpass == -1) 1685 if (options->proxy_use_fdpass == -1)
1686 options->proxy_use_fdpass = 0; 1686 options->proxy_use_fdpass = 0;
1687 if (options->canonicalise_max_dots == -1) 1687 if (options->canonicalize_max_dots == -1)
1688 options->canonicalise_max_dots = 1; 1688 options->canonicalize_max_dots = 1;
1689 if (options->canonicalise_fallback_local == -1) 1689 if (options->canonicalize_fallback_local == -1)
1690 options->canonicalise_fallback_local = 1; 1690 options->canonicalize_fallback_local = 1;
1691 if (options->canonicalise_hostname == -1) 1691 if (options->canonicalize_hostname == -1)
1692 options->canonicalise_hostname = SSH_CANONICALISE_NO; 1692 options->canonicalize_hostname = SSH_CANONICALISE_NO;
1693#define CLEAR_ON_NONE(v) \ 1693#define CLEAR_ON_NONE(v) \
1694 do { \ 1694 do { \
1695 if (v != NULL && strcasecmp(v, "none") == 0) { \ 1695 if (v != NULL && strcasecmp(v, "none") == 0) { \
diff --git a/readconf.h b/readconf.h
index 4a210897e..2d7ea9fc4 100644
--- a/readconf.h
+++ b/readconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.h,v 1.98 2013/10/16 02:31:46 djm Exp $ */ 1/* $OpenBSD: readconf.h,v 1.99 2013/10/16 22:49:38 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -148,9 +148,9 @@ typedef struct {
148 148
149 int num_canonical_domains; 149 int num_canonical_domains;
150 char *canonical_domains[MAX_CANON_DOMAINS]; 150 char *canonical_domains[MAX_CANON_DOMAINS];
151 int canonicalise_hostname; 151 int canonicalize_hostname;
152 int canonicalise_max_dots; 152 int canonicalize_max_dots;
153 int canonicalise_fallback_local; 153 int canonicalize_fallback_local;
154 int num_permitted_cnames; 154 int num_permitted_cnames;
155 struct allowed_cname permitted_cnames[MAX_CANON_DOMAINS]; 155 struct allowed_cname permitted_cnames[MAX_CANON_DOMAINS];
156 156
diff --git a/ssh.1 b/ssh.1
index d9e2cb658..6369fc28b 100644
--- a/ssh.1
+++ b/ssh.1
@@ -33,7 +33,7 @@
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: ssh.1,v 1.338 2013/10/16 02:31:46 djm Exp $ 36.\" $OpenBSD: ssh.1,v 1.339 2013/10/16 22:49:38 djm Exp $
37.Dd $Mdocdate: October 16 2013 $ 37.Dd $Mdocdate: October 16 2013 $
38.Dt SSH 1 38.Dt SSH 1
39.Os 39.Os
@@ -418,10 +418,10 @@ For full details of the options listed below, and their possible values, see
418.It BatchMode 418.It BatchMode
419.It BindAddress 419.It BindAddress
420.It CanonicalDomains 420.It CanonicalDomains
421.It CanonicaliseFallbackLocal 421.It CanonicalizeFallbackLocal
422.It CanonicaliseHostname 422.It CanonicalizeHostname
423.It CanonicaliseMaxDots 423.It CanonicalizeMaxDots
424.It CanonicalisePermittedCNAMEs 424.It CanonicalizePermittedCNAMEs
425.It ChallengeResponseAuthentication 425.It ChallengeResponseAuthentication
426.It CheckHostIP 426.It CheckHostIP
427.It Cipher 427.It Cipher
diff --git a/ssh.c b/ssh.c
index 230591b3a..6581e57bf 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.385 2013/10/16 02:31:46 djm Exp $ */ 1/* $OpenBSD: ssh.c,v 1.386 2013/10/16 22:49:39 djm 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
@@ -275,14 +275,14 @@ check_follow_cname(char **namep, const char *cname)
275 if (*cname == '\0' || options.num_permitted_cnames == 0 || 275 if (*cname == '\0' || options.num_permitted_cnames == 0 ||
276 strcmp(*namep, cname) == 0) 276 strcmp(*namep, cname) == 0)
277 return 0; 277 return 0;
278 if (options.canonicalise_hostname == SSH_CANONICALISE_NO) 278 if (options.canonicalize_hostname == SSH_CANONICALISE_NO)
279 return 0; 279 return 0;
280 /* 280 /*
281 * Don't attempt to canonicalise names that will be interpreted by 281 * Don't attempt to canonicalize names that will be interpreted by
282 * a proxy unless the user specifically requests so. 282 * a proxy unless the user specifically requests so.
283 */ 283 */
284 if (options.proxy_command != NULL && 284 if (options.proxy_command != NULL &&
285 options.canonicalise_hostname != SSH_CANONICALISE_ALWAYS) 285 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS)
286 return 0; 286 return 0;
287 debug3("%s: check \"%s\" CNAME \"%s\"", __func__, *namep, cname); 287 debug3("%s: check \"%s\" CNAME \"%s\"", __func__, *namep, cname);
288 for (i = 0; i < options.num_permitted_cnames; i++) { 288 for (i = 0; i < options.num_permitted_cnames; i++) {
@@ -292,7 +292,7 @@ check_follow_cname(char **namep, const char *cname)
292 match_pattern_list(cname, rule->target_list, 292 match_pattern_list(cname, rule->target_list,
293 strlen(rule->target_list), 1) != 1) 293 strlen(rule->target_list), 1) != 1)
294 continue; 294 continue;
295 verbose("Canonicalised DNS aliased hostname " 295 verbose("Canonicalized DNS aliased hostname "
296 "\"%s\" => \"%s\"", *namep, cname); 296 "\"%s\" => \"%s\"", *namep, cname);
297 free(*namep); 297 free(*namep);
298 *namep = xstrdup(cname); 298 *namep = xstrdup(cname);
@@ -307,20 +307,20 @@ check_follow_cname(char **namep, const char *cname)
307 * if no name was found after canonicalisation. 307 * if no name was found after canonicalisation.
308 */ 308 */
309static struct addrinfo * 309static struct addrinfo *
310resolve_canonicalise(char **hostp, u_int port) 310resolve_canonicalize(char **hostp, u_int port)
311{ 311{
312 int i, ndots; 312 int i, ndots;
313 char *cp, *fullhost, cname_target[NI_MAXHOST]; 313 char *cp, *fullhost, cname_target[NI_MAXHOST];
314 struct addrinfo *addrs; 314 struct addrinfo *addrs;
315 315
316 if (options.canonicalise_hostname == SSH_CANONICALISE_NO) 316 if (options.canonicalize_hostname == SSH_CANONICALISE_NO)
317 return NULL; 317 return NULL;
318 /* 318 /*
319 * Don't attempt to canonicalise names that will be interpreted by 319 * Don't attempt to canonicalize names that will be interpreted by
320 * a proxy unless the user specifically requests so. 320 * a proxy unless the user specifically requests so.
321 */ 321 */
322 if (options.proxy_command != NULL && 322 if (options.proxy_command != NULL &&
323 options.canonicalise_hostname != SSH_CANONICALISE_ALWAYS) 323 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS)
324 return NULL; 324 return NULL;
325 /* Don't apply canonicalisation to sufficiently-qualified hostnames */ 325 /* Don't apply canonicalisation to sufficiently-qualified hostnames */
326 ndots = 0; 326 ndots = 0;
@@ -328,9 +328,9 @@ resolve_canonicalise(char **hostp, u_int port)
328 if (*cp == '.') 328 if (*cp == '.')
329 ndots++; 329 ndots++;
330 } 330 }
331 if (ndots > options.canonicalise_max_dots) { 331 if (ndots > options.canonicalize_max_dots) {
332 debug3("%s: not canonicalising hostname \"%s\" (max dots %d)", 332 debug3("%s: not canonicalizing hostname \"%s\" (max dots %d)",
333 __func__, *hostp, options.canonicalise_max_dots); 333 __func__, *hostp, options.canonicalize_max_dots);
334 return NULL; 334 return NULL;
335 } 335 }
336 /* Attempt each supplied suffix */ 336 /* Attempt each supplied suffix */
@@ -347,14 +347,14 @@ resolve_canonicalise(char **hostp, u_int port)
347 fullhost[strlen(fullhost) - 1] = '\0'; 347 fullhost[strlen(fullhost) - 1] = '\0';
348 /* Follow CNAME if requested */ 348 /* Follow CNAME if requested */
349 if (!check_follow_cname(&fullhost, cname_target)) { 349 if (!check_follow_cname(&fullhost, cname_target)) {
350 debug("Canonicalised hostname \"%s\" => \"%s\"", 350 debug("Canonicalized hostname \"%s\" => \"%s\"",
351 *hostp, fullhost); 351 *hostp, fullhost);
352 } 352 }
353 free(*hostp); 353 free(*hostp);
354 *hostp = fullhost; 354 *hostp = fullhost;
355 return addrs; 355 return addrs;
356 } 356 }
357 if (!options.canonicalise_fallback_local) 357 if (!options.canonicalize_fallback_local)
358 fatal("%s: Could not resolve host \"%s\"", __progname, host); 358 fatal("%s: Could not resolve host \"%s\"", __progname, host);
359 return NULL; 359 return NULL;
360} 360}
@@ -907,8 +907,8 @@ main(int ac, char **av)
907 } 907 }
908 908
909 /* If canonicalisation requested then try to apply it */ 909 /* If canonicalisation requested then try to apply it */
910 if (options.canonicalise_hostname != SSH_CANONICALISE_NO) 910 if (options.canonicalize_hostname != SSH_CANONICALISE_NO)
911 addrs = resolve_canonicalise(&host, options.port); 911 addrs = resolve_canonicalize(&host, options.port);
912 /* 912 /*
913 * If canonicalisation not requested, or if it failed then try to 913 * If canonicalisation not requested, or if it failed then try to
914 * resolve the bare hostname name using the system resolver's usual 914 * resolve the bare hostname name using the system resolver's usual
diff --git a/ssh_config.5 b/ssh_config.5
index 2c0e66556..586db6b9f 100644
--- a/ssh_config.5
+++ b/ssh_config.5
@@ -33,7 +33,7 @@
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: ssh_config.5,v 1.172 2013/10/16 06:42:25 jmc Exp $ 36.\" $OpenBSD: ssh_config.5,v 1.173 2013/10/16 22:49:39 djm Exp $
37.Dd $Mdocdate: October 16 2013 $ 37.Dd $Mdocdate: October 16 2013 $
38.Dt SSH_CONFIG 5 38.Dt SSH_CONFIG 5
39.Os 39.Os
@@ -202,10 +202,10 @@ is set to
202.Dq yes . 202.Dq yes .
203.It Cm CanonicalDomains 203.It Cm CanonicalDomains
204When 204When
205.Cm CanonicaliseHostname 205.Cm CanonicalizeHostname
206is enabled, this option specifies the list of domain suffixes in which to 206is enabled, this option specifies the list of domain suffixes in which to
207search for the specified destination host. 207search for the specified destination host.
208.It Cm CanonicaliseFallbackLocal 208.It Cm CanonicalizeFallbackLocal
209Specifies whether to fail with an error when hostname canonicalisation fails. 209Specifies whether to fail with an error when hostname canonicalisation fails.
210The default, 210The default,
211.Dq no , 211.Dq no ,
@@ -216,11 +216,11 @@ A value of
216will cause 216will cause
217.Xr ssh 1 217.Xr ssh 1
218to fail instantly if 218to fail instantly if
219.Cm CanonicaliseHostname 219.Cm CanonicalizeHostname
220is enabled and the target hostname cannot be found in any of the domains 220is enabled and the target hostname cannot be found in any of the domains
221specified by 221specified by
222.Cm CanonicalDomains . 222.Cm CanonicalDomains .
223.It Cm CanonicaliseHostname 223.It Cm CanonicalizeHostname
224Controls whether explicit hostname canonicalisation is performed. 224Controls whether explicit hostname canonicalisation is performed.
225The default, 225The default,
226.Dq no , 226.Dq no ,
@@ -231,26 +231,26 @@ If set to
231then, for connections that do not use a 231then, for connections that do not use a
232.Cm ProxyCommand , 232.Cm ProxyCommand ,
233.Xr ssh 1 233.Xr ssh 1
234will attempt to canonicalise the hostname specified on the command line 234will attempt to canonicalize the hostname specified on the command line
235using the 235using the
236.Cm CanonicalDomains 236.Cm CanonicalDomains
237suffixes and 237suffixes and
238.Cm CanonicalisePermittedCNAMEs 238.Cm CanonicalizePermittedCNAMEs
239rules. 239rules.
240If 240If
241.Cm CanonicaliseHostname 241.Cm CanonicalizeHostname
242is set to 242is set to
243.Dq always , 243.Dq always ,
244then canonicalisation is applied to proxied connections too. 244then canonicalisation is applied to proxied connections too.
245.It Cm CanonicaliseMaxDots 245.It Cm CanonicalizeMaxDots
246Specifies the maximum number of dot characters in a hostname before 246Specifies the maximum number of dot characters in a hostname before
247canonicalisation is disabled. 247canonicalisation is disabled.
248The default, 248The default,
249.Dq 1 , 249.Dq 1 ,
250allows a single dot (i.e. hostname.subdomain). 250allows a single dot (i.e. hostname.subdomain).
251.It Cm CanonicalisePermittedCNAMEs 251.It Cm CanonicalizePermittedCNAMEs
252Specifies rules to determine whether CNAMEs should be followed when 252Specifies rules to determine whether CNAMEs should be followed when
253canonicalising hostnames. 253canonicalizing hostnames.
254The rules consist of one or more arguments of 254The rules consist of one or more arguments of
255.Ar source_domain_list : Ns Ar target_domain_list , 255.Ar source_domain_list : Ns Ar target_domain_list ,
256where 256where
@@ -264,7 +264,7 @@ For example,
264.Dq *.a.example.com:*.b.example.com,*.c.example.com 264.Dq *.a.example.com:*.b.example.com,*.c.example.com
265will allow hostnames matching 265will allow hostnames matching
266.Dq *.a.example.com 266.Dq *.a.example.com
267to be canonicalised to names in the 267to be canonicalized to names in the
268.Dq *.b.example.com 268.Dq *.b.example.com
269or 269or
270.Dq *.c.example.com 270.Dq *.c.example.com