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 640993732..32c4b425b 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -37,6 +37,8 @@ | |||
37 | #include <stdio.h> | 37 | #include <stdio.h> |
38 | #include <string.h> | 38 | #include <string.h> |
39 | #include <unistd.h> | 39 | #include <unistd.h> |
40 | #include <pwd.h> | ||
41 | #include <grp.h> | ||
40 | #ifdef HAVE_UTIL_H | 42 | #ifdef HAVE_UTIL_H |
41 | #include <util.h> | 43 | #include <util.h> |
42 | #endif | 44 | #endif |
@@ -1477,8 +1479,7 @@ read_config_file(const char *filename, struct passwd *pw, const char *host, | |||
1477 | 1479 | ||
1478 | if (fstat(fileno(f), &sb) == -1) | 1480 | if (fstat(fileno(f), &sb) == -1) |
1479 | fatal("fstat %s: %s", filename, strerror(errno)); | 1481 | fatal("fstat %s: %s", filename, strerror(errno)); |
1480 | if (((sb.st_uid != 0 && sb.st_uid != getuid()) || | 1482 | if (!secure_permissions(&sb, getuid())) |
1481 | (sb.st_mode & 022) != 0)) | ||
1482 | fatal("Bad owner or permissions on %s", filename); | 1483 | fatal("Bad owner or permissions on %s", filename); |
1483 | } | 1484 | } |
1484 | 1485 | ||