summaryrefslogtreecommitdiff
path: root/security/openssh/patches/patch-aq
blob: 2501dc65c6ef112ad3b23e82984f85bd69c6719e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$NetBSD: patch-aq,v 1.6 2006/10/31 03:31:20 taca Exp $

--- sshpty.c.orig	2006-08-05 11:39:41.000000000 +0900
+++ sshpty.c
@@ -78,7 +78,7 @@ pty_allocate(int *ptyfd, int *ttyfd, cha
 void
 pty_release(const char *tty)
 {
-	if (chown(tty, (uid_t) 0, (gid_t) 0) < 0)
+	if (chown(tty, (uid_t) ROOTUID, (gid_t) ROOTGID) < 0)
 		error("chown %.100s 0 0 failed: %.100s", tty, strerror(errno));
 	if (chmod(tty, (mode_t) 0666) < 0)
 		error("chmod %.100s 0666 failed: %.100s", tty, strerror(errno));
@@ -224,7 +224,7 @@ pty_setowner(struct passwd *pw, const ch
 	if (st.st_uid != pw->pw_uid || st.st_gid != gid) {
 		if (chown(tty, pw->pw_uid, gid) < 0) {
 			if (errno == EROFS &&
-			    (st.st_uid == pw->pw_uid || st.st_uid == 0))
+			    (st.st_uid == pw->pw_uid || st.st_uid == ROOTUID))
 				debug("chown(%.100s, %u, %u) failed: %.100s",
 				    tty, (u_int)pw->pw_uid, (u_int)gid,
 				    strerror(errno));