summaryrefslogtreecommitdiff
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
commitb460494e9361f3dbc8da75d4d907a15c90382b49 (patch)
tree77a3ce7700e680179d2563460277199c7c190141
parente5cb301a8cc1272542772715ee9c603a44057b24 (diff)
downloadsssd-b460494e9361f3dbc8da75d4d907a15c90382b49.tar.gz
sssd-b460494e9361f3dbc8da75d4d907a15c90382b49.tar.bz2
sssd-b460494e9361f3dbc8da75d4d907a15c90382b49.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--common/ini/ini_config_ut.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/ini/ini_config_ut.c b/common/ini/ini_config_ut.c
index 44d633fc..55a8b334 100644
--- a/common/ini/ini_config_ut.c
+++ b/common/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--