From: Michael Tremer Date: Sun, 28 Sep 2025 12:01:04 +0000 (+0000) Subject: Make secure_getenv available X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0c19fac4a12b0267a64ca868c549e3c106b2076;p=telemetry.git Make secure_getenv available Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 5eb9257..b6ba415 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,6 +46,7 @@ bin_PROGRAMS = AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ + -D_GNU_SOURCE \ $(OUR_CPPFLAGS) AM_CFLAGS = \ diff --git a/configure.ac b/configure.ac index e6d761c..90f87eb 100644 --- a/configure.ac +++ b/configure.ac @@ -124,6 +124,11 @@ AC_CHECK_HEADERS_ONCE([ time.h ]) +AC_CHECK_FUNCS([ \ + __secure_getenv \ + secure_getenv \ +]) + AC_PATH_PROG([XSLTPROC], [xsltproc]) PKG_CHECK_MODULES([OPING], [liboping]) diff --git a/src/daemon/util.h b/src/daemon/util.h index b97084b..8b8542c 100644 --- a/src/daemon/util.h +++ b/src/daemon/util.h @@ -22,6 +22,15 @@ #define COLLECTY_UTIL_H #include +#include + +#ifndef HAVE_SECURE_GETENV +# ifdef HAVE___SECURE_GETENV +# define secure_getenv __secure_getenv +# else +# error neither secure_getenv nor __secure_getenv is available +# endif +#endif #define collecty_format_number(buffer, number) \ __collecty_format_number(buffer, sizeof(buffer), number)