summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--misc.c14
-rw-r--r--misc.h3
-rw-r--r--readconf.c4
-rw-r--r--servconf.c13
-rw-r--r--ssh-keyscan.c10
6 files changed, 38 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index ce5cd8b89..feaa27aee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -123,6 +123,10 @@
123 [PROTOCOL] 123 [PROTOCOL]
124 fix an incorrect magic number and typo in PROTOCOL; bz#1688 124 fix an incorrect magic number and typo in PROTOCOL; bz#1688
125 report and fix from ueno AT unixuser.org 125 report and fix from ueno AT unixuser.org
126 - stevesk@cvs.openbsd.org 2009/12/25 19:40:21
127 [readconf.c servconf.c misc.h ssh-keyscan.c misc.c]
128 validate routing domain is in range 0-RT_TABLEID_MAX.
129 'Looks right' deraadt@
126 130
12720091226 13120091226
128 - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1 132 - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1
diff --git a/misc.c b/misc.c
index 21db00a13..d4bdfc0ea 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.73 2009/11/20 03:24:07 djm Exp $ */ 1/* $OpenBSD: misc.c,v 1.74 2009/12/25 19:40:21 stevesk Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved. 4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -274,6 +274,18 @@ a2port(const char *s)
274} 274}
275 275
276int 276int
277a2rdomain(const char *s)
278{
279 long long rdomain;
280 const char *errstr;
281
282 rdomain = strtonum(s, 0, RT_TABLEID_MAX, &errstr);
283 if (errstr != NULL)
284 return -1;
285 return (int)rdomain;
286}
287
288int
277a2tun(const char *s, int *remote) 289a2tun(const char *s, int *remote)
278{ 290{
279 const char *errstr = NULL; 291 const char *errstr = NULL;
diff --git a/misc.h b/misc.h
index 87b7f0edf..1e859e255 100644
--- a/misc.h
+++ b/misc.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.h,v 1.39 2009/10/28 16:38:18 reyk Exp $ */ 1/* $OpenBSD: misc.h,v 1.40 2009/12/25 19:40:21 stevesk Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -23,6 +23,7 @@ int set_nonblock(int);
23int unset_nonblock(int); 23int unset_nonblock(int);
24void set_nodelay(int); 24void set_nodelay(int);
25int a2port(const char *); 25int a2port(const char *);
26int a2rdomain(const char *);
26int a2tun(const char *, int *); 27int a2tun(const char *, int *);
27char *put_host_port(const char *, u_short); 28char *put_host_port(const char *, u_short);
28char *hpdelim(char **); 29char *hpdelim(char **);
diff --git a/readconf.c b/readconf.c
index 6b2e3b21d..2f1b0cd3b 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.179 2009/10/28 16:38:18 reyk Exp $ */ 1/* $OpenBSD: readconf.c,v 1.180 2009/12/25 19:40:21 stevesk 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
@@ -925,7 +925,7 @@ parse_int:
925 if (!arg || *arg == '\0') 925 if (!arg || *arg == '\0')
926 fatal("%.200s line %d: Missing argument.", 926 fatal("%.200s line %d: Missing argument.",
927 filename, linenum); 927 filename, linenum);
928 value = a2port(arg); 928 value = a2rdomain(arg);
929 if (value == -1) 929 if (value == -1)
930 fatal("%.200s line %d: Bad rdomain.", 930 fatal("%.200s line %d: Bad rdomain.",
931 filename, linenum); 931 filename, linenum);
diff --git a/servconf.c b/servconf.c
index 729f23bad..8b8518aa8 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.c,v 1.197 2009/10/28 16:38:18 reyk Exp $ */ 1/* $OpenBSD: servconf.c,v 1.198 2009/12/25 19:40:21 stevesk Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -1298,7 +1298,16 @@ process_server_config_line(ServerOptions *options, char *line,
1298 1298
1299 case sRDomain: 1299 case sRDomain:
1300 intptr = &options->rdomain; 1300 intptr = &options->rdomain;
1301 goto parse_int; 1301 arg = strdelim(&cp);
1302 if (!arg || *arg == '\0')
1303 fatal("%s line %d: missing rdomain value.",
1304 filename, linenum);
1305 if ((value = a2rdomain(arg)) == -1)
1306 fatal("%s line %d: invalid rdomain value.",
1307 filename, linenum);
1308 if (*intptr == -1)
1309 *intptr = value;
1310 break;
1302 1311
1303 case sDeprecated: 1312 case sDeprecated:
1304 logit("%s line %d: Deprecated option %s", 1313 logit("%s line %d: Deprecated option %s",
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index f30e85045..faeb9e13e 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keyscan.c,v 1.79 2009/10/28 16:38:18 reyk Exp $ */ 1/* $OpenBSD: ssh-keyscan.c,v 1.80 2009/12/25 19:40:21 stevesk Exp $ */
2/* 2/*
3 * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. 3 * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
4 * 4 *
@@ -807,9 +807,11 @@ main(int argc, char **argv)
807 IPv4or6 = AF_INET6; 807 IPv4or6 = AF_INET6;
808 break; 808 break;
809 case 'V': 809 case 'V':
810 scan_rdomain = a2port(optarg); 810 scan_rdomain = a2rdomain(optarg);
811 if (scan_rdomain < 0) 811 if (scan_rdomain == -1) {
812 scan_rdomain = -1; 812 fprintf(stderr, "Bad rdomain '%s'\n", optarg);
813 exit(1);
814 }
813 break; 815 break;
814 case '?': 816 case '?':
815 default: 817 default: