]>
Commit | Line | Data |
---|---|---|
17d728c8 SS |
1 | diff --git a/authfile.c b/authfile.c |
2 | index e93d867..4fc5b3d 100644 | |
3 | --- a/authfile.c | |
4 | +++ b/authfile.c | |
5 | @@ -32,6 +32,7 @@ | |
9d8fd3ad | 6 | |
17d728c8 SS |
7 | #include <errno.h> |
8 | #include <fcntl.h> | |
9 | +#include <grp.h> | |
10 | #include <stdio.h> | |
11 | #include <stdarg.h> | |
12 | #include <stdlib.h> | |
13 | @@ -207,6 +208,13 @@ sshkey_perm_ok(int fd, const char *filename) | |
9d8fd3ad SS |
14 | #ifdef HAVE_CYGWIN |
15 | if (check_ntsec(filename)) | |
16 | #endif | |
17 | + if (st.st_mode & 040) { | |
18 | + struct group *gr; | |
19 | + | |
20 | + if ((gr = getgrnam("ssh_keys")) && (st.st_gid == gr->gr_gid)) | |
21 | + st.st_mode &= ~040; | |
22 | + } | |
23 | + | |
24 | if ((st.st_uid == getuid()) && (st.st_mode & 077) != 0) { | |
25 | error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); | |
26 | error("@ WARNING: UNPROTECTED PRIVATE KEY FILE! @"); |