summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index e79e355dc..273552d7c 100644
--- a/readconf.c
+++ b/readconf.c
@@ -36,6 +36,8 @@
36#include <stdio.h> 36#include <stdio.h>
37#include <string.h> 37#include <string.h>
38#include <unistd.h> 38#include <unistd.h>
39#include <pwd.h>
40#include <grp.h>
39#ifdef HAVE_UTIL_H 41#ifdef HAVE_UTIL_H
40#include <util.h> 42#include <util.h>
41#endif 43#endif
@@ -1475,8 +1477,7 @@ read_config_file(const char *filename, struct passwd *pw, const char *host,
1475 1477
1476 if (fstat(fileno(f), &sb) == -1) 1478 if (fstat(fileno(f), &sb) == -1)
1477 fatal("fstat %s: %s", filename, strerror(errno)); 1479 fatal("fstat %s: %s", filename, strerror(errno));
1478 if (((sb.st_uid != 0 && sb.st_uid != getuid()) || 1480 if (!secure_permissions(&sb, getuid()))
1479 (sb.st_mode & 022) != 0))
1480 fatal("Bad owner or permissions on %s", filename); 1481 fatal("Bad owner or permissions on %s", filename);
1481 } 1482 }
1482 1483