summaryrefslogtreecommitdiff
path: root/security/openssh/patches/patch-aj
blob: a76b5e4a3bcba3ac954a18d94cf468c1bfefccfe (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.6 2005/03/07 23:29:50 tv Exp $

--- auth-rhosts.c.orig	2003-11-17 05:13:41.000000000 -0500
+++ auth-rhosts.c
@@ -198,7 +198,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.",
@@ -224,7 +224,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);
@@ -251,7 +251,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);