Blame openssh-6.6p1-keyperm.patch
|
Jakub Jelen |
2b86ac |
diff -up openssh-8.2p1/authfile.c.keyperm openssh-8.2p1/authfile.c
|
|
Jakub Jelen |
2b86ac |
--- openssh-8.2p1/authfile.c.keyperm 2020-02-14 01:40:54.000000000 +0100
|
|
Jakub Jelen |
2b86ac |
+++ openssh-8.2p1/authfile.c 2020-02-17 11:55:12.841729758 +0100
|
|
Jakub Jelen |
2b86ac |
@@ -31,6 +31,7 @@
|
|
Jan F |
1ddd0e |
|
|
Petr Lautrbach |
94c6f8 |
#include <errno.h>
|
|
Petr Lautrbach |
94c6f8 |
#include <fcntl.h>
|
|
Petr Lautrbach |
94c6f8 |
+#include <grp.h>
|
|
Petr Lautrbach |
94c6f8 |
#include <stdio.h>
|
|
Petr Lautrbach |
190035 |
#include <stdarg.h>
|
|
Petr Lautrbach |
94c6f8 |
#include <stdlib.h>
|
|
Jakub Jelen |
2b86ac |
@@ -101,7 +102,19 @@ sshkey_perm_ok(int fd, const char *filen
|
|
Jan F |
1ddd0e |
#ifdef HAVE_CYGWIN
|
|
Jan F |
1ddd0e |
if (check_ntsec(filename))
|
|
Jan F |
1ddd0e |
#endif
|
|
Jan F |
1ddd0e |
+
|
|
Jan F |
1ddd0e |
if ((st.st_uid == getuid()) && (st.st_mode & 077) != 0) {
|
|
Jakub Jelen |
2b86ac |
+ if (st.st_mode & 040) {
|
|
Jakub Jelen |
2b86ac |
+ struct group *gr;
|
|
Jakub Jelen |
2b86ac |
+
|
|
Jakub Jelen |
2b86ac |
+ if ((gr = getgrnam("ssh_keys")) && (st.st_gid == gr->gr_gid)) {
|
|
Jakub Jelen |
2b86ac |
+ /* The only additional bit is read
|
|
Jakub Jelen |
2b86ac |
+ * for ssh_keys group, which is fine */
|
|
Jakub Jelen |
2b86ac |
+ if ((st.st_mode & 077) == 040 ) {
|
|
Jakub Jelen |
2b86ac |
+ return 0;
|
|
Jakub Jelen |
2b86ac |
+ }
|
|
Jakub Jelen |
2b86ac |
+ }
|
|
Jakub Jelen |
2b86ac |
+ }
|
|
Jan F |
1ddd0e |
error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
|
|
Jan F |
1ddd0e |
error("@ WARNING: UNPROTECTED PRIVATE KEY FILE! @");
|
|
Jakub Jelen |
2b86ac |
error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
|