summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-06-03 10:25:48 +1000
committerDamien Miller <djm@mindrot.org>2003-06-03 10:25:48 +1000
commit3a961dc0d36c1f87788b707130f6d07709822d38 (patch)
tree57f3a729408e4cbe08fa7f9699de2e583e0b2ca0
parent35276253a60a3e57ec21b82b2e3c81e03c0206de (diff)
- (djm) OpenBSD CVS Sync
- markus@cvs.openbsd.org 2003/06/02 09:17:34 [auth2-hostbased.c auth.c auth-options.c auth-rhosts.c auth-rh-rsa.c] [canohost.c monitor.c servconf.c servconf.h session.c sshd_config] [sshd_config.5] deprecate VerifyReverseMapping since it's dangerous if combined with IP based access control as noted by Mike Harding; replace with a UseDNS option, UseDNS is on by default and includes the VerifyReverseMapping check; with itojun@, provos@, jakob@ and deraadt@ ok deraadt@, djm@ - (djm) Fix portable-specific uses of verify_reverse_mapping too
-rw-r--r--ChangeLog13
-rw-r--r--auth-options.c4
-rw-r--r--auth-pam.c5
-rw-r--r--auth-passwd.c16
-rw-r--r--auth-rh-rsa.c4
-rw-r--r--auth-rhosts.c4
-rw-r--r--auth-sia.c4
-rw-r--r--auth.c4
-rw-r--r--auth2-hostbased.c4
-rw-r--r--canohost.c44
-rw-r--r--monitor.c4
-rw-r--r--servconf.c19
-rw-r--r--servconf.h4
-rw-r--r--session.c8
-rw-r--r--sshd_config4
-rw-r--r--sshd_config.518
16 files changed, 91 insertions, 68 deletions
diff --git a/ChangeLog b/ChangeLog
index ada1bd2d9..6627ec3fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,17 @@
120030603 120030603
2 - (djm) Replace setproctitle replacement with code derived from 2 - (djm) Replace setproctitle replacement with code derived from
3 UCB sendmail 3 UCB sendmail
4 - (djm) OpenBSD CVS Sync
5 - markus@cvs.openbsd.org 2003/06/02 09:17:34
6 [auth2-hostbased.c auth.c auth-options.c auth-rhosts.c auth-rh-rsa.c]
7 [canohost.c monitor.c servconf.c servconf.h session.c sshd_config]
8 [sshd_config.5]
9 deprecate VerifyReverseMapping since it's dangerous if combined
10 with IP based access control as noted by Mike Harding; replace with
11 a UseDNS option, UseDNS is on by default and includes the
12 VerifyReverseMapping check; with itojun@, provos@, jakob@ and deraadt@
13 ok deraadt@, djm@
14 - (djm) Fix portable-specific uses of verify_reverse_mapping too
4 15
520030602 1620030602
6 - (djm) Fix segv from bad reordering in auth-pam.c 17 - (djm) Fix segv from bad reordering in auth-pam.c
@@ -1648,4 +1659,4 @@
1648 save auth method before monitor_reset_key_state(); bugzilla bug #284; 1659 save auth method before monitor_reset_key_state(); bugzilla bug #284;
1649 ok provos@ 1660 ok provos@
1650 1661
1651$Id: ChangeLog,v 1.2764 2003/06/03 00:14:28 djm Exp $ 1662$Id: ChangeLog,v 1.2765 2003/06/03 00:25:48 djm Exp $
diff --git a/auth-options.c b/auth-options.c
index d8976b172..0e146ab15 100644
--- a/auth-options.c
+++ b/auth-options.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: auth-options.c,v 1.27 2003/04/08 20:21:28 itojun Exp $"); 13RCSID("$OpenBSD: auth-options.c,v 1.28 2003/06/02 09:17:34 markus Exp $");
14 14
15#include "xmalloc.h" 15#include "xmalloc.h"
16#include "match.h" 16#include "match.h"
@@ -173,7 +173,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
173 if (strncasecmp(opts, cp, strlen(cp)) == 0) { 173 if (strncasecmp(opts, cp, strlen(cp)) == 0) {
174 const char *remote_ip = get_remote_ipaddr(); 174 const char *remote_ip = get_remote_ipaddr();
175 const char *remote_host = get_canonical_hostname( 175 const char *remote_host = get_canonical_hostname(
176 options.verify_reverse_mapping); 176 options.use_dns);
177 char *patterns = xmalloc(strlen(opts) + 1); 177 char *patterns = xmalloc(strlen(opts) + 1);
178 178
179 opts += strlen(cp); 179 opts += strlen(cp);
diff --git a/auth-pam.c b/auth-pam.c
index b8381646b..057164ad3 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -31,7 +31,7 @@
31 31
32/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ 32/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */
33#include "includes.h" 33#include "includes.h"
34RCSID("$Id: auth-pam.c,v 1.63 2003/06/02 01:04:39 djm Exp $"); 34RCSID("$Id: auth-pam.c,v 1.64 2003/06/03 00:25:48 djm Exp $");
35 35
36#ifdef USE_PAM 36#ifdef USE_PAM
37#include <security/pam_appl.h> 37#include <security/pam_appl.h>
@@ -299,8 +299,7 @@ sshpam_init(const char *user)
299 sshpam_handle = NULL; 299 sshpam_handle = NULL;
300 return (-1); 300 return (-1);
301 } 301 }
302 pam_rhost = get_remote_name_or_ip(utmp_len, 302 pam_rhost = get_remote_name_or_ip(utmp_len, options.use_dns);
303 options.verify_reverse_mapping);
304 debug("PAM: setting PAM_RHOST to \"%s\"", pam_rhost); 303 debug("PAM: setting PAM_RHOST to \"%s\"", pam_rhost);
305 sshpam_err = pam_set_item(sshpam_handle, PAM_RHOST, pam_rhost); 304 sshpam_err = pam_set_item(sshpam_handle, PAM_RHOST, pam_rhost);
306 if (sshpam_err != PAM_SUCCESS) { 305 if (sshpam_err != PAM_SUCCESS) {
diff --git a/auth-passwd.c b/auth-passwd.c
index b893165bf..9a94c373f 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -144,22 +144,24 @@ auth_password(Authctxt *authctxt, const char *password)
144 HANDLE hToken = cygwin_logon_user(pw, password); 144 HANDLE hToken = cygwin_logon_user(pw, password);
145 145
146 if (hToken == INVALID_HANDLE_VALUE) 146 if (hToken == INVALID_HANDLE_VALUE)
147 return 0; 147 return (0);
148 cygwin_set_impersonation_token(hToken); 148 cygwin_set_impersonation_token(hToken);
149 return 1; 149 return (1);
150 } 150 }
151# endif 151# endif
152# ifdef WITH_AIXAUTHENTICATE 152# ifdef WITH_AIXAUTHENTICATE
153 authsuccess = (authenticate(pw->pw_name,password,&reenter,&authmsg) == 0); 153 authsuccess = (authenticate(pw->pw_name,password,&reenter,&authmsg) == 0);
154 154
155 if (authsuccess) 155 if (authsuccess) {
156 /* We don't have a pty yet, so just label the line as "ssh" */ 156 /* We don't have a pty yet, so just label the line as "ssh" */
157 if (loginsuccess(authctxt->user, 157 if (loginsuccess(authctxt->user,
158 get_canonical_hostname(options.verify_reverse_mapping), 158 get_canonical_hostname(options.use_dns),
159 "ssh", &aixloginmsg) < 0) 159 "ssh", &aixloginmsg) < 0) {
160 aixloginmsg = NULL; 160 aixloginmsg = NULL;
161 }
162 }
161 163
162 return(authsuccess); 164 return (authsuccess);
163# endif 165# endif
164# ifdef KRB4 166# ifdef KRB4
165 if (options.kerberos_authentication == 1) { 167 if (options.kerberos_authentication == 1) {
diff --git a/auth-rh-rsa.c b/auth-rh-rsa.c
index 4d6f0d234..2eb7e6e2d 100644
--- a/auth-rh-rsa.c
+++ b/auth-rh-rsa.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: auth-rh-rsa.c,v 1.35 2003/04/08 20:21:28 itojun Exp $"); 16RCSID("$OpenBSD: auth-rh-rsa.c,v 1.36 2003/06/02 09:17:34 markus Exp $");
17 17
18#include "packet.h" 18#include "packet.h"
19#include "uidswap.h" 19#include "uidswap.h"
@@ -63,7 +63,7 @@ auth_rhosts_rsa(struct passwd *pw, char *cuser, Key *client_host_key)
63 client_host_key->rsa == NULL) 63 client_host_key->rsa == NULL)
64 return 0; 64 return 0;
65 65
66 chost = (char *)get_canonical_hostname(options.verify_reverse_mapping); 66 chost = (char *)get_canonical_hostname(options.use_dns);
67 debug("Rhosts RSA authentication: canonical host %.900s", chost); 67 debug("Rhosts RSA authentication: canonical host %.900s", chost);
68 68
69 if (!PRIVSEP(auth_rhosts_rsa_key_allowed(pw, cuser, chost, client_host_key))) { 69 if (!PRIVSEP(auth_rhosts_rsa_key_allowed(pw, cuser, chost, client_host_key))) {
diff --git a/auth-rhosts.c b/auth-rhosts.c
index a38478108..b42a64c90 100644
--- a/auth-rhosts.c
+++ b/auth-rhosts.c
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: auth-rhosts.c,v 1.30 2003/05/17 03:25:58 itojun Exp $"); 17RCSID("$OpenBSD: auth-rhosts.c,v 1.31 2003/06/02 09:17:34 markus Exp $");
18 18
19#include "packet.h" 19#include "packet.h"
20#include "uidswap.h" 20#include "uidswap.h"
@@ -156,7 +156,7 @@ auth_rhosts(struct passwd *pw, const char *client_user)
156{ 156{
157 const char *hostname, *ipaddr; 157 const char *hostname, *ipaddr;
158 158
159 hostname = get_canonical_hostname(options.verify_reverse_mapping); 159 hostname = get_canonical_hostname(options.use_dns);
160 ipaddr = get_remote_ipaddr(); 160 ipaddr = get_remote_ipaddr();
161 return auth_rhosts2(pw, client_user, hostname, ipaddr); 161 return auth_rhosts2(pw, client_user, hostname, ipaddr);
162} 162}
diff --git a/auth-sia.c b/auth-sia.c
index 05cf47c40..cae5f0912 100644
--- a/auth-sia.c
+++ b/auth-sia.c
@@ -52,7 +52,7 @@ auth_sia_password(Authctxt *authctxt, char *pass)
52 SIAENTITY *ent = NULL; 52 SIAENTITY *ent = NULL;
53 const char *host; 53 const char *host;
54 54
55 host = get_canonical_hostname(options.verify_reverse_mapping); 55 host = get_canonical_hostname(options.use_dns);
56 56
57 if (!authctxt->user || pass == NULL || pass[0] == '\0') 57 if (!authctxt->user || pass == NULL || pass[0] == '\0')
58 return (0); 58 return (0);
@@ -81,7 +81,7 @@ session_setup_sia(struct passwd *pw, char *tty)
81 SIAENTITY *ent = NULL; 81 SIAENTITY *ent = NULL;
82 const char *host; 82 const char *host;
83 83
84 host = get_canonical_hostname(options.verify_reverse_mapping); 84 host = get_canonical_hostname(options.use_dns);
85 85
86 if (sia_ses_init(&ent, saved_argc, saved_argv, host, pw->pw_name, 86 if (sia_ses_init(&ent, saved_argc, saved_argv, host, pw->pw_name,
87 tty, 0, NULL) != SIASUCCESS) 87 tty, 0, NULL) != SIASUCCESS)
diff --git a/auth.c b/auth.c
index 8b58cc671..6b48addf7 100644
--- a/auth.c
+++ b/auth.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth.c,v 1.47 2003/04/08 20:21:28 itojun Exp $"); 26RCSID("$OpenBSD: auth.c,v 1.48 2003/06/02 09:17:34 markus Exp $");
27 27
28#ifdef HAVE_LOGIN_H 28#ifdef HAVE_LOGIN_H
29#include <login.h> 29#include <login.h>
@@ -141,7 +141,7 @@ allowed_user(struct passwd * pw)
141 } 141 }
142 142
143 if (options.num_deny_users > 0 || options.num_allow_users > 0) { 143 if (options.num_deny_users > 0 || options.num_allow_users > 0) {
144 hostname = get_canonical_hostname(options.verify_reverse_mapping); 144 hostname = get_canonical_hostname(options.use_dns);
145 ipaddr = get_remote_ipaddr(); 145 ipaddr = get_remote_ipaddr();
146 } 146 }
147 147
diff --git a/auth2-hostbased.c b/auth2-hostbased.c
index f8b4ae852..bbc7d8a4d 100644
--- a/auth2-hostbased.c
+++ b/auth2-hostbased.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2-hostbased.c,v 1.3 2003/04/08 20:21:28 itojun Exp $"); 26RCSID("$OpenBSD: auth2-hostbased.c,v 1.4 2003/06/02 09:17:34 markus Exp $");
27 27
28#include "ssh2.h" 28#include "ssh2.h"
29#include "xmalloc.h" 29#include "xmalloc.h"
@@ -136,7 +136,7 @@ hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost,
136 HostStatus host_status; 136 HostStatus host_status;
137 int len; 137 int len;
138 138
139 resolvedname = get_canonical_hostname(options.verify_reverse_mapping); 139 resolvedname = get_canonical_hostname(options.use_dns);
140 ipaddr = get_remote_ipaddr(); 140 ipaddr = get_remote_ipaddr();
141 141
142 debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s", 142 debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s",
diff --git a/canohost.c b/canohost.c
index 417d95c18..533f2c24a 100644
--- a/canohost.c
+++ b/canohost.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: canohost.c,v 1.36 2003/04/08 20:21:28 itojun Exp $"); 15RCSID("$OpenBSD: canohost.c,v 1.37 2003/06/02 09:17:34 markus Exp $");
16 16
17#include "packet.h" 17#include "packet.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -27,7 +27,7 @@ static void check_ip_options(int, char *);
27 */ 27 */
28 28
29static char * 29static char *
30get_remote_hostname(int socket, int verify_reverse_mapping) 30get_remote_hostname(int socket, int use_dns)
31{ 31{
32 struct sockaddr_storage from; 32 struct sockaddr_storage from;
33 int i; 33 int i;
@@ -72,6 +72,9 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
72 NULL, 0, NI_NUMERICHOST) != 0) 72 NULL, 0, NI_NUMERICHOST) != 0)
73 fatal("get_remote_hostname: getnameinfo NI_NUMERICHOST failed"); 73 fatal("get_remote_hostname: getnameinfo NI_NUMERICHOST failed");
74 74
75 if (!use_dns)
76 return xstrdup(ntop);
77
75 if (from.ss_family == AF_INET) 78 if (from.ss_family == AF_INET)
76 check_ip_options(socket, ntop); 79 check_ip_options(socket, ntop);
77 80
@@ -80,14 +83,24 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
80 if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), 83 if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
81 NULL, 0, NI_NAMEREQD) != 0) { 84 NULL, 0, NI_NAMEREQD) != 0) {
82 /* Host name not found. Use ip address. */ 85 /* Host name not found. Use ip address. */
83#if 0
84 logit("Could not reverse map address %.100s.", ntop);
85#endif
86 return xstrdup(ntop); 86 return xstrdup(ntop);
87 } 87 }
88 88
89 /* Got host name. */ 89 /*
90 name[sizeof(name) - 1] = '\0'; 90 * if reverse lookup result looks like a numeric hostname,
91 * someone is trying to trick us by PTR record like following:
92 * 1.1.1.10.in-addr.arpa. IN PTR 2.3.4.5
93 */
94 memset(&hints, 0, sizeof(hints));
95 hints.ai_socktype = SOCK_DGRAM; /*dummy*/
96 hints.ai_flags = AI_NUMERICHOST;
97 if (getaddrinfo(name, "0", &hints, &ai) == 0) {
98 logit("Nasty PTR record \"%s\" is set up for %s, ignoring",
99 name, ntop);
100 freeaddrinfo(ai);
101 return xstrdup(ntop);
102 }
103
91 /* 104 /*
92 * Convert it to all lowercase (which is expected by the rest 105 * Convert it to all lowercase (which is expected by the rest
93 * of this software). 106 * of this software).
@@ -95,9 +108,6 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
95 for (i = 0; name[i]; i++) 108 for (i = 0; name[i]; i++)
96 if (isupper(name[i])) 109 if (isupper(name[i]))
97 name[i] = tolower(name[i]); 110 name[i] = tolower(name[i]);
98
99 if (!verify_reverse_mapping)
100 return xstrdup(name);
101 /* 111 /*
102 * Map it back to an IP address and check that the given 112 * Map it back to an IP address and check that the given
103 * address actually is an address of this host. This is 113 * address actually is an address of this host. This is
@@ -180,14 +190,14 @@ check_ip_options(int socket, char *ipaddr)
180 */ 190 */
181 191
182const char * 192const char *
183get_canonical_hostname(int verify_reverse_mapping) 193get_canonical_hostname(int use_dns)
184{ 194{
185 static char *canonical_host_name = NULL; 195 static char *canonical_host_name = NULL;
186 static int verify_reverse_mapping_done = 0; 196 static int use_dns_done = 0;
187 197
188 /* Check if we have previously retrieved name with same option. */ 198 /* Check if we have previously retrieved name with same option. */
189 if (canonical_host_name != NULL) { 199 if (canonical_host_name != NULL) {
190 if (verify_reverse_mapping_done != verify_reverse_mapping) 200 if (use_dns_done != use_dns)
191 xfree(canonical_host_name); 201 xfree(canonical_host_name);
192 else 202 else
193 return canonical_host_name; 203 return canonical_host_name;
@@ -196,11 +206,11 @@ get_canonical_hostname(int verify_reverse_mapping)
196 /* Get the real hostname if socket; otherwise return UNKNOWN. */ 206 /* Get the real hostname if socket; otherwise return UNKNOWN. */
197 if (packet_connection_is_on_socket()) 207 if (packet_connection_is_on_socket())
198 canonical_host_name = get_remote_hostname( 208 canonical_host_name = get_remote_hostname(
199 packet_get_connection_in(), verify_reverse_mapping); 209 packet_get_connection_in(), use_dns);
200 else 210 else
201 canonical_host_name = xstrdup("UNKNOWN"); 211 canonical_host_name = xstrdup("UNKNOWN");
202 212
203 verify_reverse_mapping_done = verify_reverse_mapping; 213 use_dns_done = use_dns;
204 return canonical_host_name; 214 return canonical_host_name;
205} 215}
206 216
@@ -294,11 +304,11 @@ get_remote_ipaddr(void)
294} 304}
295 305
296const char * 306const char *
297get_remote_name_or_ip(u_int utmp_len, int verify_reverse_mapping) 307get_remote_name_or_ip(u_int utmp_len, int use_dns)
298{ 308{
299 static const char *remote = ""; 309 static const char *remote = "";
300 if (utmp_len > 0) 310 if (utmp_len > 0)
301 remote = get_canonical_hostname(verify_reverse_mapping); 311 remote = get_canonical_hostname(use_dns);
302 if (utmp_len == 0 || strlen(remote) > utmp_len) 312 if (utmp_len == 0 || strlen(remote) > utmp_len)
303 remote = get_remote_ipaddr(); 313 remote = get_remote_ipaddr();
304 return remote; 314 return remote;
diff --git a/monitor.c b/monitor.c
index 3b7a6f8e3..707d314b3 100644
--- a/monitor.c
+++ b/monitor.c
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: monitor.c,v 1.41 2003/05/24 09:30:40 djm Exp $"); 28RCSID("$OpenBSD: monitor.c,v 1.42 2003/06/02 09:17:34 markus Exp $");
29 29
30#include <openssl/dh.h> 30#include <openssl/dh.h>
31 31
@@ -1157,7 +1157,7 @@ mm_record_login(Session *s, struct passwd *pw)
1157 } 1157 }
1158 /* Record that there was a login on that tty from the remote host. */ 1158 /* Record that there was a login on that tty from the remote host. */
1159 record_login(s->pid, s->tty, pw->pw_name, pw->pw_uid, 1159 record_login(s->pid, s->tty, pw->pw_name, pw->pw_uid,
1160 get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping), 1160 get_remote_name_or_ip(utmp_len, options.use_dns),
1161 (struct sockaddr *)&from, fromlen); 1161 (struct sockaddr *)&from, fromlen);
1162} 1162}
1163 1163
diff --git a/servconf.c b/servconf.c
index a737f4b46..c501d7b64 100644
--- a/servconf.c
+++ b/servconf.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: servconf.c,v 1.121 2003/05/15 14:02:47 jakob Exp $"); 13RCSID("$OpenBSD: servconf.c,v 1.122 2003/06/02 09:17:34 markus Exp $");
14 14
15#if defined(KRB4) 15#if defined(KRB4)
16#include <krb.h> 16#include <krb.h>
@@ -116,7 +116,7 @@ initialize_server_options(ServerOptions *options)
116 options->max_startups_rate = -1; 116 options->max_startups_rate = -1;
117 options->max_startups = -1; 117 options->max_startups = -1;
118 options->banner = NULL; 118 options->banner = NULL;
119 options->verify_reverse_mapping = -1; 119 options->use_dns = -1;
120 options->client_alive_interval = -1; 120 options->client_alive_interval = -1;
121 options->client_alive_count_max = -1; 121 options->client_alive_count_max = -1;
122 options->authorized_keys_file = NULL; 122 options->authorized_keys_file = NULL;
@@ -232,8 +232,8 @@ fill_default_server_options(ServerOptions *options)
232 options->max_startups_rate = 100; /* 100% */ 232 options->max_startups_rate = 100; /* 100% */
233 if (options->max_startups_begin == -1) 233 if (options->max_startups_begin == -1)
234 options->max_startups_begin = options->max_startups; 234 options->max_startups_begin = options->max_startups;
235 if (options->verify_reverse_mapping == -1) 235 if (options->use_dns == -1)
236 options->verify_reverse_mapping = 0; 236 options->use_dns = 1;
237 if (options->client_alive_interval == -1) 237 if (options->client_alive_interval == -1)
238 options->client_alive_interval = 0; 238 options->client_alive_interval = 0;
239 if (options->client_alive_count_max == -1) 239 if (options->client_alive_count_max == -1)
@@ -282,7 +282,7 @@ typedef enum {
282 sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, 282 sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups,
283 sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, 283 sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
284 sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, sMaxStartups, 284 sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, sMaxStartups,
285 sBanner, sVerifyReverseMapping, sHostbasedAuthentication, 285 sBanner, sUseDNS, sHostbasedAuthentication,
286 sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, 286 sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
287 sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2, 287 sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
288 sUsePrivilegeSeparation, 288 sUsePrivilegeSeparation,
@@ -366,8 +366,9 @@ static struct {
366 { "subsystem", sSubsystem }, 366 { "subsystem", sSubsystem },
367 { "maxstartups", sMaxStartups }, 367 { "maxstartups", sMaxStartups },
368 { "banner", sBanner }, 368 { "banner", sBanner },
369 { "verifyreversemapping", sVerifyReverseMapping }, 369 { "usedns", sUseDNS },
370 { "reversemappingcheck", sVerifyReverseMapping }, 370 { "verifyreversemapping", sDeprecated },
371 { "reversemappingcheck", sDeprecated },
371 { "clientaliveinterval", sClientAliveInterval }, 372 { "clientaliveinterval", sClientAliveInterval },
372 { "clientalivecountmax", sClientAliveCountMax }, 373 { "clientalivecountmax", sClientAliveCountMax },
373 { "authorizedkeysfile", sAuthorizedKeysFile }, 374 { "authorizedkeysfile", sAuthorizedKeysFile },
@@ -723,8 +724,8 @@ parse_flag:
723 intptr = &options->gateway_ports; 724 intptr = &options->gateway_ports;
724 goto parse_flag; 725 goto parse_flag;
725 726
726 case sVerifyReverseMapping: 727 case sUseDNS:
727 intptr = &options->verify_reverse_mapping; 728 intptr = &options->use_dns;
728 goto parse_flag; 729 goto parse_flag;
729 730
730 case sLogFacility: 731 case sLogFacility:
diff --git a/servconf.h b/servconf.h
index 4ad1ee7be..b676f2b67 100644
--- a/servconf.h
+++ b/servconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.h,v 1.60 2003/05/15 01:48:10 jakob Exp $ */ 1/* $OpenBSD: servconf.h,v 1.61 2003/06/02 09:17:34 markus Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -112,7 +112,7 @@ typedef struct {
112 int max_startups_rate; 112 int max_startups_rate;
113 int max_startups; 113 int max_startups;
114 char *banner; /* SSH-2 banner message */ 114 char *banner; /* SSH-2 banner message */
115 int verify_reverse_mapping; /* cross-check ip and dns */ 115 int use_dns;
116 int client_alive_interval; /* 116 int client_alive_interval; /*
117 * poke the client this often to 117 * poke the client this often to
118 * see if it's still there 118 * see if it's still there
diff --git a/session.c b/session.c
index 796c5177c..dc9777de9 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.157 2003/05/14 22:24:42 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.158 2003/06/02 09:17:34 markus Exp $");
37 37
38#include "ssh.h" 38#include "ssh.h"
39#include "ssh1.h" 39#include "ssh1.h"
@@ -694,7 +694,7 @@ do_pre_login(Session *s)
694 } 694 }
695 695
696 record_utmp_only(pid, s->tty, s->pw->pw_name, 696 record_utmp_only(pid, s->tty, s->pw->pw_name,
697 get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping), 697 get_remote_name_or_ip(utmp_len, options.use_dns),
698 (struct sockaddr *)&from, fromlen); 698 (struct sockaddr *)&from, fromlen);
699} 699}
700#endif 700#endif
@@ -749,7 +749,7 @@ do_login(Session *s, const char *command)
749 if (!use_privsep) 749 if (!use_privsep)
750 record_login(pid, s->tty, pw->pw_name, pw->pw_uid, 750 record_login(pid, s->tty, pw->pw_name, pw->pw_uid,
751 get_remote_name_or_ip(utmp_len, 751 get_remote_name_or_ip(utmp_len,
752 options.verify_reverse_mapping), 752 options.use_dns),
753 (struct sockaddr *)&from, fromlen); 753 (struct sockaddr *)&from, fromlen);
754 754
755#ifdef USE_PAM 755#ifdef USE_PAM
@@ -1353,7 +1353,7 @@ do_child(Session *s, const char *command)
1353 /* we have to stash the hostname before we close our socket. */ 1353 /* we have to stash the hostname before we close our socket. */
1354 if (options.use_login) 1354 if (options.use_login)
1355 hostname = get_remote_name_or_ip(utmp_len, 1355 hostname = get_remote_name_or_ip(utmp_len,
1356 options.verify_reverse_mapping); 1356 options.use_dns);
1357 /* 1357 /*
1358 * Close the connection descriptors; note that this is the child, and 1358 * Close the connection descriptors; note that this is the child, and
1359 * the server will still have the socket open, and it is important 1359 * the server will still have the socket open, and it is important
diff --git a/sshd_config b/sshd_config
index 78fc67c23..c93396b51 100644
--- a/sshd_config
+++ b/sshd_config
@@ -1,4 +1,4 @@
1# $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $ 1# $OpenBSD: sshd_config,v 1.60 2003/06/02 09:17:34 markus Exp $
2 2
3# This is the sshd server system-wide configuration file. See 3# This is the sshd server system-wide configuration file. See
4# sshd_config(5) for more information. 4# sshd_config(5) for more information.
@@ -88,7 +88,7 @@
88#MaxStartups 10 88#MaxStartups 10
89# no default banner path 89# no default banner path
90#Banner /some/path 90#Banner /some/path
91#VerifyReverseMapping no 91#UseDNS yes
92 92
93# override default of no subsystems 93# override default of no subsystems
94Subsystem sftp /usr/libexec/sftp-server 94Subsystem sftp /usr/libexec/sftp-server
diff --git a/sshd_config.5 b/sshd_config.5
index 86b3289a1..0c6108e0f 100644
--- a/sshd_config.5
+++ b/sshd_config.5
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: sshd_config.5,v 1.17 2003/05/20 12:09:32 jmc Exp $ 37.\" $OpenBSD: sshd_config.5,v 1.18 2003/06/02 09:17:34 markus Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSHD_CONFIG 5 39.Dt SSHD_CONFIG 5
40.Os 40.Os
@@ -585,6 +585,14 @@ Gives the facility code that is used when logging messages from
585The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, 585The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
586LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. 586LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
587The default is AUTH. 587The default is AUTH.
588.It Cm UseDNS
589Specifies whether
590.Nm sshd
591should lookup the remote host name and check that
592the resolved host name for the remote IP address maps back to the
593very same IP address.
594The default is
595.Dq yes .
588.It Cm UseLogin 596.It Cm UseLogin
589Specifies whether 597Specifies whether
590.Xr login 1 598.Xr login 1
@@ -622,14 +630,6 @@ The goal of privilege separation is to prevent privilege
622escalation by containing any corruption within the unprivileged processes. 630escalation by containing any corruption within the unprivileged processes.
623The default is 631The default is
624.Dq yes . 632.Dq yes .
625.It Cm VerifyReverseMapping
626Specifies whether
627.Nm sshd
628should try to verify the remote host name and check that
629the resolved host name for the remote IP address maps back to the
630very same IP address.
631The default is
632.Dq no .
633.It Cm X11DisplayOffset 633.It Cm X11DisplayOffset
634Specifies the first display number available for 634Specifies the first display number available for
635.Nm sshd Ns 's 635.Nm sshd Ns 's