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 337818c63..0648867e8 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -38,6 +38,8 @@ | |||
38 | #include <stdio.h> | 38 | #include <stdio.h> |
39 | #include <string.h> | 39 | #include <string.h> |
40 | #include <unistd.h> | 40 | #include <unistd.h> |
41 | #include <pwd.h> | ||
42 | #include <grp.h> | ||
41 | #ifdef HAVE_UTIL_H | 43 | #ifdef HAVE_UTIL_H |
42 | #include <util.h> | 44 | #include <util.h> |
43 | #endif | 45 | #endif |
@@ -1516,8 +1518,7 @@ read_config_file(const char *filename, struct passwd *pw, const char *host, | |||
1516 | 1518 | ||
1517 | if (fstat(fileno(f), &sb) == -1) | 1519 | if (fstat(fileno(f), &sb) == -1) |
1518 | fatal("fstat %s: %s", filename, strerror(errno)); | 1520 | fatal("fstat %s: %s", filename, strerror(errno)); |
1519 | if (((sb.st_uid != 0 && sb.st_uid != getuid()) || | 1521 | if (!secure_permissions(&sb, getuid())) |
1520 | (sb.st_mode & 022) != 0)) | ||
1521 | fatal("Bad owner or permissions on %s", filename); | 1522 | fatal("Bad owner or permissions on %s", filename); |
1522 | } | 1523 | } |
1523 | 1524 | ||