diff options
author | 2001-07-18 21:10:43 +0000 | |
---|---|---|
committer | 2001-07-18 21:10:43 +0000 | |
commit | f20bb8a90d974ad417cfd7833a00609c2250e8fc (patch) | |
tree | 5c4fa673bd5cc09f437cb82524ef888ec91a1d26 /usr.bin/ssh/sshpty.c | |
parent | protect #define MAX(); ok ho@ (diff) | |
download | wireguard-openbsd-f20bb8a90d974ad417cfd7833a00609c2250e8fc.tar.xz wireguard-openbsd-f20bb8a90d974ad417cfd7833a00609c2250e8fc.zip |
pr #1946, allow sshd if /dev is readonly
Diffstat (limited to 'usr.bin/ssh/sshpty.c')
-rw-r--r-- | usr.bin/ssh/sshpty.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshpty.c b/usr.bin/ssh/sshpty.c index d0f255436ed..bfd6653d334 100644 --- a/usr.bin/ssh/sshpty.c +++ b/usr.bin/ssh/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 $"); #include <util.h> #include "sshpty.h" @@ -272,7 +272,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)); |