diff options
-rw-r--r-- | sshpty.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshpty.c,v 1.28 2007/09/11 23:49:09 stevesk Exp $ */ | 1 | /* $OpenBSD: sshpty.c,v 1.29 2014/09/03 18:55:07 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -196,13 +196,8 @@ pty_setowner(struct passwd *pw, const char *tty) | |||
196 | 196 | ||
197 | /* Determine the group to make the owner of the tty. */ | 197 | /* Determine the group to make the owner of the tty. */ |
198 | grp = getgrnam("tty"); | 198 | grp = getgrnam("tty"); |
199 | if (grp) { | 199 | gid = (grp != NULL) ? grp->gr_gid : pw->pw_gid; |
200 | gid = grp->gr_gid; | 200 | mode = (grp != NULL) ? 0622 : 0600; |
201 | mode = S_IRUSR | S_IWUSR | S_IWGRP; | ||
202 | } else { | ||
203 | gid = pw->pw_gid; | ||
204 | mode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH; | ||
205 | } | ||
206 | 201 | ||
207 | /* | 202 | /* |
208 | * Change owner and mode of the tty as required. | 203 | * Change owner and mode of the tty as required. |