summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-09-02 23:42:24 +0200
committerArthur de Jong <arthur@arthurdejong.org>2013-09-02 23:42:24 +0200
commit8b169f1cd50f86b3c414522f5876696b1a9e95c6 (patch)
treee05c5c2407be48e1a30a6b7bf3357a145d419535 /tests
parent560e5de575720c13d9085fe1014cb0377c9ccd12 (diff)
Fix permissions of test configuration
This sets the permissions on the nslcd-test.conf file while running the tests to ensure that the permission checks for the bindpwn and rootpwmodpw options do not fail the test.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_common.c b/tests/test_common.c
index 29c899a..054a7a9 100644
--- a/tests/test_common.c
+++ b/tests/test_common.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <assert.h>
+#include <sys/stat.h>
#include "nslcd/common.h"
#include "nslcd/cfg.h"
@@ -54,6 +55,9 @@ int main(int UNUSED(argc), char UNUSED(*argv[]))
srcdir = ".";
snprintf(fname, sizeof(fname), "%s/nslcd-test.conf", srcdir);
fname[sizeof(fname) - 1] = '\0';
+ /* ensure that file is not world readable for configuration parsing to
+ succeed */
+ (void)chmod(fname, (mode_t)0660);
/* initialize configuration */
cfg_init(fname);
/* partially initialize logging */