summaryrefslogtreecommitdiffstats
path: root/src/conf_macros.m4
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-04-11 10:00:14 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-05-02 20:12:30 +0200
commit9a0255c508ede92423a1f8a02c6c38328482c55f (patch)
treed3a831b2ff7a74507b309b79a2cd6b269a4054cc /src/conf_macros.m4
parent2962b3d1e072ff2ebbe343095812dad697d6bf1d (diff)
downloadsssd-9a0255c508ede92423a1f8a02c6c38328482c55f.tar.gz
sssd-9a0255c508ede92423a1f8a02c6c38328482c55f.tar.xz
sssd-9a0255c508ede92423a1f8a02c6c38328482c55f.zip
Default TEST_DIR to cwd, not empty string if not set explicitly
If configure isn't being run with argument --with-test-dir, then variable TEST_DIR will be defined, but its value will be empty (""). In this case opendir will fail with uncatched error "Directory does not exist, or name is an empty string". Finally function call dirfd will segfault because its argument is NULL. I changed default value of TEST_DIR (if --with-test-dir was not used). Function tests_set_cwd does not ignore return value of chdir, because TEST_DIR should not be the empty string.
Diffstat (limited to 'src/conf_macros.m4')
-rw-r--r--src/conf_macros.m47
1 files changed, 4 insertions, 3 deletions
diff --git a/src/conf_macros.m4 b/src/conf_macros.m4
index 4ea4e9367..26eb4accc 100644
--- a/src/conf_macros.m4
+++ b/src/conf_macros.m4
@@ -329,11 +329,12 @@ AC_DEFUN([WITH_TEST_DIR],
[AC_HELP_STRING([--with-test-dir=PATH],
[Directory used for make check temporary files [$builddir]]
)
- ]
+ ],
+ [TEST_DIR=$withval],
+ [TEST_DIR="."]
)
- TEST_DIR=$with_test_dir
AC_SUBST(TEST_DIR)
- AC_DEFINE_UNQUOTED(TEST_DIR, "$with_test_dir", [Directory used for 'make check' temporary files])
+ AC_DEFINE_UNQUOTED(TEST_DIR, "$TEST_DIR", [Directory used for 'make check' temporary files])
])
AC_DEFUN([WITH_NSCD],