summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-04-14 11:20:41 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-04-14 12:15:54 -0400
commit35f37fbc241bcc64f99a0d1d619b77ea8b0bce67 (patch)
tree208112f8160e98383f29147688c4010a75f22152
parent3d639daef0a0b3ff2adb6a2bcaf04fb12b906466 (diff)
downloadding-libs-35f37fbc241bcc64f99a0d1d619b77ea8b0bce67.tar.gz
ding-libs-35f37fbc241bcc64f99a0d1d619b77ea8b0bce67.tar.xz
ding-libs-35f37fbc241bcc64f99a0d1d619b77ea8b0bce67.zip
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.
-rw-r--r--ini/ini_config_ut.c5
1 files changed, 4 insertions, 1 deletions
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 <errno.h>
#include <unistd.h>
#include <fcntl.h>
+#include <sys/stat.h>
#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--