summaryrefslogtreecommitdiff
path: root/sshpty.c
diff options
context:
space:
mode:
authormouring <mouring>2001-07-22 20:36:57 +0000
committermouring <mouring>2001-07-22 20:36:57 +0000
commitf278c910d7ef6eeaa2f5b6253bc60bda2729f305 (patch)
tree1353805a9295e4d66ac105ba6ee46bc98451c691 /sshpty.c
parent0354e2646e59b3ec5ccce8db8d250833727fb77b (diff)
downloadopenssh-f278c910d7ef6eeaa2f5b6253bc60bda2729f305.tar.gz
- OpenBSD CVS Sync
- markus@cvs.openbsd.org 2001/07/18 21:10:43 [sshpty.c] pr #1946, allow sshd if /dev is readonly
Diffstat (limited to 'sshpty.c')
-rw-r--r--sshpty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sshpty.c b/sshpty.c
index 4083e249..6f97f38e 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshpty.c,v 1.1 2001/03/04 01:46:30 djm Exp $");
+RCSID("$OpenBSD: sshpty.c,v 1.2 2001/07/18 21:10:43 markus Exp $");
#ifdef HAVE_UTIL_H
# include <util.h>
@@ -321,7 +321,8 @@ pty_setowner(struct passwd *pw, const char *ttyname)
if (st.st_uid != pw->pw_uid || st.st_gid != gid) {
if (chown(ttyname, pw->pw_uid, gid) < 0) {
- if (errno == EROFS && st.st_uid == pw->pw_uid)
+ if (errno == EROFS &&
+ (st.st_uid == pw->pw_uid || st.st_uid == 0))
error("chown(%.100s, %d, %d) failed: %.100s",
ttyname, pw->pw_uid, gid,
strerror(errno));