diff options
author | deraadt@openbsd.org <deraadt@openbsd.org> | 2019-07-04 16:20:10 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-07-05 11:15:30 +1000 |
commit | 8b4cc4bdc8a70bf209a274fa2b2a49c1e3c8d8a2 (patch) | |
tree | ba86333545d9ed88caf287335fd8fc00843c01ef /sshpty.c | |
parent | 48cccc275c6a1e91d3f80fdb0dc0d5baf529aeca (diff) | |
download | openssh-git-8b4cc4bdc8a70bf209a274fa2b2a49c1e3c8d8a2.tar.gz |
upstream: fatal() if getgrnam() cannot find "tty"
OpenBSD-Commit-ID: d148c1c052fa0ed7d105b5428b5c1bab91630048
Diffstat (limited to 'sshpty.c')
-rw-r--r-- | sshpty.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |