aboutsummaryrefslogtreecommitdiffstats
path: root/main/openssh/CVE-2015-6565.patch
blob: 40fe7779ac2e9f70b1d78b119abf7e5875a2bc8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From a5883d4eccb94b16c355987f58f86a7dee17a0c2 Mon Sep 17 00:00:00 2001
From: "djm@openbsd.org" <djm@openbsd.org>
Date: Wed, 3 Sep 2014 18:55:07 +0000
Subject: [PATCH] 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@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@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.
From 6f941396b6835ad18018845f515b0c4fe20be21a Mon Sep 17 00:00:00 2001
From: "djm@openbsd.org" <djm@openbsd.org>
Date: Thu, 30 Jul 2015 23:09:15 +0000
Subject: upstream commit

fix pty permissions; patch from Nikolay Edigaryev; ok
 deraadt

Upstream-ID: 40ff076d2878b916fbfd8e4f45dbe5bec019e550
---
 sshpty.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sshpty.c b/sshpty.c
index 7bb7641..15da8c6 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshpty.c,v 1.29 2014/09/03 18:55:07 djm Exp $ */
+/* $OpenBSD: sshpty.c,v 1.30 2015/07/30 23:09:15 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -197,7 +197,7 @@ pty_setowner(struct passwd *pw, const char *tty)
 	/* Determine the group to make the owner of the tty. */
 	grp = getgrnam("tty");
 	gid = (grp != NULL) ? grp->gr_gid : pw->pw_gid;
-	mode = (grp != NULL) ? 0622 : 0600;
+	mode = (grp != NULL) ? 0620 : 0600;
 
 	/*
 	 * Change owner and mode of the tty as required.
-- 
cgit v0.11.2