]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: fatal() if getgrnam() cannot find "tty"
authorderaadt@openbsd.org <deraadt@openbsd.org>
Thu, 4 Jul 2019 16:20:10 +0000 (16:20 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 5 Jul 2019 01:15:30 +0000 (11:15 +1000)
OpenBSD-Commit-ID: d148c1c052fa0ed7d105b5428b5c1bab91630048

sshpty.c

index a625e474ee04690ea92420eb43bf87f73941b9f1..9ad8e95c81604a61fca509a26a389007a3c62e4c 100644 (file)
--- a/sshpty.c
+++ b/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;