From eb48ee8347ee07be15f5ed08089a9ddfd6a906fb Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 11 Jun 2021 10:14:07 +0100 Subject: utils: Remove security_context_t casts for libselinux >= 2.3 security_context_t has always been a typedef for char * and used more or less interchangeably with char *, but the use of a typedef turned out to be bad for const-correctness. The function signatures were changed to take const char * in libselinux 2.3, in 2014[1] and the typedef was formally deprecated in 2020[2]. On very old OSs like Ubuntu 14.04, reinstate the casts to suppress warnings from -Wdiscarded-qualifiers. [1] https://github.com/SELinuxProject/selinux/commit/9eb9c9327563 [2] https://github.com/SELinuxProject/selinux/commit/7a124ca27581 Signed-off-by: Simon McVittie --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index dd6f9e3..6167ea4 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,9 @@ if test "x$enable_selinux" != "xno"; then if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then AC_MSG_ERROR([*** SELinux support requested but libraries not found]) fi + PKG_CHECK_MODULES([SELINUX_2_3], [libselinux >= 2.3], + [AC_DEFINE(HAVE_SELINUX_2_3, 1, [Define if SELinux is version >= 2.3])], + [:]) fi AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"]) -- cgit v1.2.1