From d01ba9898661052f1b8c154b5d457e85aec75b5f Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Sun, 22 Jul 2001 20:36:57 +0000 Subject: - OpenBSD CVS Sync - markus@cvs.openbsd.org 2001/07/18 21:10:43 [sshpty.c] pr #1946, allow sshd if /dev is readonly --- ChangeLog | 6 +++++- sshpty.c | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3501fae9..62b3a0ed9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,10 @@ Added openbsd-compat/bsd-cray.c. Rest will be merged after approval. Selective patches from William L. Jones + - OpenBSD CVS Sync + - markus@cvs.openbsd.org 2001/07/18 21:10:43 + [sshpty.c] + pr #1946, allow sshd if /dev is readonly 20010719 - (tim) [configure.in] put inet_aton back in AC_CHECK_FUNCS. @@ -6077,4 +6081,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1416 2001/07/22 19:32:00 mouring Exp $ +$Id: ChangeLog,v 1.1417 2001/07/22 20:36:57 mouring Exp $ diff --git a/sshpty.c b/sshpty.c index 4083e249f..6f97f38ed 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 @@ -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)); -- cgit v1.2.3