mirror of
git://anongit.mindrot.org/openssh.git
synced 2025-02-04 08:01:52 +00:00
upstream: fatal() if getgrnam() cannot find "tty"
OpenBSD-Commit-ID: d148c1c052fa0ed7d105b5428b5c1bab91630048
This commit is contained in:
parent
48cccc275c
commit
8b4cc4bdc8
4
sshpty.c
4
sshpty.c
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: sshpty.c,v 1.33 2019/07/04 16:16:51 deraadt Exp $ */
|
||||
/* $OpenBSD: sshpty.c,v 1.34 2019/07/04 16:20:10 deraadt Exp $ */
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||
@ -171,6 +171,8 @@ pty_setowner(struct passwd *pw, const char *tty)
|
||||
|
||||
/* Determine the group to make the owner of the tty. */
|
||||
grp = getgrnam("tty");
|
||||
if (grp == NULL)
|
||||
fatal("no tty group");
|
||||
gid = (grp != NULL) ? grp->gr_gid : pw->pw_gid;
|
||||
mode = (grp != NULL) ? 0620 : 0600;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user