forked from rpms/openssh
27 lines
714 B
Diff
27 lines
714 B
Diff
diff --git a/authfile.c b/authfile.c
|
|
index e93d867..4fc5b3d 100644
|
|
--- a/authfile.c
|
|
+++ b/authfile.c
|
|
@@ -32,6 +32,7 @@
|
|
|
|
#include <errno.h>
|
|
#include <fcntl.h>
|
|
+#include <grp.h>
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
#include <stdlib.h>
|
|
@@ -207,6 +208,13 @@ sshkey_perm_ok(int fd, const char *filename)
|
|
#ifdef HAVE_CYGWIN
|
|
if (check_ntsec(filename))
|
|
#endif
|
|
+ if (st.st_mode & 040) {
|
|
+ struct group *gr;
|
|
+
|
|
+ if ((gr = getgrnam("ssh_keys")) && (st.st_gid == gr->gr_gid))
|
|
+ st.st_mode &= ~040;
|
|
+ }
|
|
+
|
|
if ((st.st_uid == getuid()) && (st.st_mode & 077) != 0) {
|
|
error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
|
|
error("@ WARNING: UNPROTECTED PRIVATE KEY FILE! @");
|