summaryrefslogtreecommitdiff
path: root/security/openssh/patches/patch-aj
blob: d9d31a4e58930cd5cac52c5ee2c16b3cae658dfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$NetBSD: patch-aj,v 1.8 2009/05/21 03:22:29 taca Exp $

--- auth-rhosts.c.orig	2008-06-14 08:01:25.000000000 +0900
+++ auth-rhosts.c
@@ -230,7 +230,7 @@ auth_rhosts2_raw(struct passwd *pw, cons
 		return 0;
 
 	/* If not logging in as superuser, try /etc/hosts.equiv and shosts.equiv. */
-	if (pw->pw_uid != 0) {
+	if (pw->pw_uid != ROOTUID) {
 		if (check_rhosts_file(_PATH_RHOSTS_EQUIV, hostname, ipaddr,
 		    client_user, pw->pw_name)) {
 			auth_debug_add("Accepted for %.100s [%.100s] by /etc/hosts.equiv.",
@@ -256,7 +256,7 @@ auth_rhosts2_raw(struct passwd *pw, cons
 		return 0;
 	}
 	if (options.strict_modes &&
-	    ((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
+	    ((st.st_uid != ROOTUID && st.st_uid != pw->pw_uid) ||
 	    (st.st_mode & 022) != 0)) {
 		logit("Rhosts authentication refused for %.100s: "
 		    "bad ownership or modes for home directory.", pw->pw_name);
@@ -283,7 +283,7 @@ auth_rhosts2_raw(struct passwd *pw, cons
 		 * allowing access to their account by anyone.
 		 */
 		if (options.strict_modes &&
-		    ((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
+		    ((st.st_uid != ROOTUID && st.st_uid != pw->pw_uid) ||
 		    (st.st_mode & 022) != 0)) {
 			logit("Rhosts authentication refused for %.100s: bad modes for %.200s",
 			    pw->pw_name, buf);