Module: check_mk
Branch: master
Commit: e0aade379841f643d66da59d8a71d68426f4b677
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e0aade379841f6…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Apr 27 09:24:21 2017 +0200
Fixed linking of our SUID executables, which was broken recently.
The detection of the right RRD library is a bit tricky: We can't simply put
-lrrd_th or -lrrd globally into LIBS. The problem is that our SUID programs
icmpsender and icmpreceiver would be linked with that option, too, but because
of security reasons the dynamic linker will ignore our LD_LIBRARY_PATH => no
RRD library found or even the wrong one... :-/
Change-Id: I136227050e7fd1c3ba4fa354e56b1d85314ac11c
---
configure.ac | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index b2d2965..2238308 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,7 +52,19 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(socket, connect)
AC_CHECK_LIB(socket, shutdown)
-AC_SEARCH_LIBS([rrd_xport], [rrd_th rrd], [], [AC_MSG_ERROR([unable to find the rrd_xport
function])])
+
+# The detection of the right RRD library is a bit tricky: We can't simply put
+# -lrrd_th or -lrrd globally into LIBS. The problem is that our SUID programs
+# icmpsender and icmpreceiver would be linked with that option, too, but because
+# of security reasons the dynamic linker will ignore our LD_LIBRARY_PATH => no
+# RRD library found or even the wrong one... :-/
+RRDLIB=
+old_LIBS=$LIBS
+AC_SEARCH_LIBS([rrd_xport], [rrd_th rrd],
+ [test "$ac_cv_search_rrd_xport" = "none required" ||
RRDLIB="$ac_cv_search_rrd_xport"],
+ [AC_MSG_ERROR([unable to find the rrd_xport function])])
+LIBS=$old_LIBS
+AC_SUBST(RRDLIB)
# Checks for header files.
AC_HEADER_DIRENT