From 35f37fbc241bcc64f99a0d1d619b77ea8b0bce67 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Wed, 14 Apr 2010 11:20:41 -0400 Subject: Fix ini_config unit test When running 'make distcheck', the entire source directory is set to read-only, to ensure that the build process only has write access to $builddir. As a result, this was causing the unit test for file mode to fail, since the file it was testing resides in the $srcdir. This patch guarantees that the test file has the correct permissions prior to running the access test. --- ini/ini_config_ut.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ini/ini_config_ut.c b/ini/ini_config_ut.c index 44d633f..55a8b33 100644 --- a/ini/ini_config_ut.c +++ b/ini/ini_config_ut.c @@ -25,6 +25,7 @@ #include #include #include +#include #define TRACE_HOME #include "trace.h" #include "ini_config.h" @@ -1091,6 +1092,8 @@ int startup_test(void) COLOUT(printf("STARTUP TEST\n")); + /* Set file permissions to 0664 */ + chmod("./ini.conf", 0664); flags = INI_META_SEC_ACCESS_FLAG | INI_META_SEC_ERROR_FLAG; @@ -1140,7 +1143,7 @@ int startup_test(void) */ 0, /* <- will be real uid in real case */ 0, /* <- will be real gid in real case */ - 0440, /* Checkling for r--r----- */ + 0440, /* Checking for r--r----- */ 0); /* This check is expected to fail since * the actual permissions on the test file are: rw-rw-r-- -- cgit