diff options
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c index dab7963d6..c74193424 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <stdio.h> | 30 | #include <stdio.h> |
31 | #include <string.h> | 31 | #include <string.h> |
32 | #include <unistd.h> | 32 | #include <unistd.h> |
33 | #include <pwd.h> | ||
34 | #include <grp.h> | ||
33 | #ifdef HAVE_UTIL_H | 35 | #ifdef HAVE_UTIL_H |
34 | #include <util.h> | 36 | #include <util.h> |
35 | #endif | 37 | #endif |
@@ -1155,8 +1157,7 @@ read_config_file(const char *filename, const char *host, Options *options, | |||
1155 | 1157 | ||
1156 | if (fstat(fileno(f), &sb) == -1) | 1158 | if (fstat(fileno(f), &sb) == -1) |
1157 | fatal("fstat %s: %s", filename, strerror(errno)); | 1159 | fatal("fstat %s: %s", filename, strerror(errno)); |
1158 | if (((sb.st_uid != 0 && sb.st_uid != getuid()) || | 1160 | if (!secure_permissions(&sb, getuid())) |
1159 | (sb.st_mode & 022) != 0)) | ||
1160 | fatal("Bad owner or permissions on %s", filename); | 1161 | fatal("Bad owner or permissions on %s", filename); |
1161 | } | 1162 | } |
1162 | 1163 | ||