[openssh-commits] [openssh] 07/13: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Oct 13 11:42:13 EST 2014


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit a5883d4eccb94b16c355987f58f86a7dee17a0c2
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Wed Sep 3 18:55:07 2014 +0000

    upstream commit
    
    tighten permissions on pty when the "tty" group does
     not exist; pointed out by Corinna Vinschen; ok markus
---
 sshpty.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/sshpty.c b/sshpty.c
index a2059b7..d2ff8c1 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshpty.c,v 1.28 2007/09/11 23:49:09 stevesk Exp $ */
+/* $OpenBSD: sshpty.c,v 1.29 2014/09/03 18:55:07 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -196,13 +196,8 @@ pty_setowner(struct passwd *pw, const char *tty)
 
 	/* Determine the group to make the owner of the tty. */
 	grp = getgrnam("tty");
-	if (grp) {
-		gid = grp->gr_gid;
-		mode = S_IRUSR | S_IWUSR | S_IWGRP;
-	} else {
-		gid = pw->pw_gid;
-		mode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH;
-	}
+	gid = (grp != NULL) ? grp->gr_gid : pw->pw_gid;
+	mode = (grp != NULL) ? 0622 : 0600;
 
 	/*
 	 * Change owner and mode of the tty as required.

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list