diff options
Diffstat (limited to 'sshpty.c')
-rw-r--r-- | sshpty.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: sshpty.c,v 1.1 2001/03/04 01:46:30 djm Exp $"); | 15 | RCSID("$OpenBSD: sshpty.c,v 1.2 2001/07/18 21:10:43 markus Exp $"); |
16 | 16 | ||
17 | #ifdef HAVE_UTIL_H | 17 | #ifdef HAVE_UTIL_H |
18 | # include <util.h> | 18 | # include <util.h> |
@@ -321,7 +321,8 @@ pty_setowner(struct passwd *pw, const char *ttyname) | |||
321 | 321 | ||
322 | if (st.st_uid != pw->pw_uid || st.st_gid != gid) { | 322 | if (st.st_uid != pw->pw_uid || st.st_gid != gid) { |
323 | if (chown(ttyname, pw->pw_uid, gid) < 0) { | 323 | if (chown(ttyname, pw->pw_uid, gid) < 0) { |
324 | if (errno == EROFS && st.st_uid == pw->pw_uid) | 324 | if (errno == EROFS && |
325 | (st.st_uid == pw->pw_uid || st.st_uid == 0)) | ||
325 | error("chown(%.100s, %d, %d) failed: %.100s", | 326 | error("chown(%.100s, %d, %d) failed: %.100s", |
326 | ttyname, pw->pw_uid, gid, | 327 | ttyname, pw->pw_uid, gid, |
327 | strerror(errno)); | 328 | strerror(errno)); |