summaryrefslogtreecommitdiff
path: root/sshpty.c
diff options
context:
space:
mode:
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 4083e249f..6f97f38ed 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: sshpty.c,v 1.1 2001/03/04 01:46:30 djm Exp $"); 15RCSID("$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));