Skip to content

Commit 26c202d

Browse files
committed
Fix runstatedir if nothing is passed
The current code in configure expects you to pass: --localstatedir=/var --runstatedir=/run Prior to making the determination in configure, you didn't need to pass anything and it worked out to /var/run. Adjust the code in configure.ac so it makes a FHS compliant default if nothing is passed.
1 parent 3cfb821 commit 26c202d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ AC_CHECK_SIZEOF([long])
6161
AC_CHECK_SIZEOF([time_t])
6262
dnl; next is needed for old compilers and plugins/ids/Makefile.am
6363
AM_PROG_CC_C_O
64+
dnl Ensure runstatedir exists even with older autoconf
65+
AS_VAR_SET_IF([runstatedir], [], [runstatedir='${localstatedir}/run'])
66+
AC_SUBST([runstatedir])
67+
dnl If user didn't override it, prefer FHS /run over ${localstatedir}/run
68+
AS_IF([test "x$runstatedir" = x'${localstatedir}/run'], [
69+
runstatedir=/run
70+
])
6471
AC_DEFINE_UNQUOTED([AUDIT_RUN_DIR], ["$runstatedir/audit"],
6572
[Directory for audit runtime state files])
6673
AC_CHECK_DECLS([AUDIT_FEATURE_VERSION], [], [], [[#include <linux/audit.h>]])

0 commit comments

Comments
 (0)