mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-02 15:25:27 +00:00
libapparmor: Fix FTBFS when secure_getenv() is not available
Allow libapparmor to build on older systems where secure_getenv() is still named __secure_getenv(). This snippet was taken from the glibc wiki: https://sourceware.org/glibc/wiki/Tips_and_Tricks/secure_getenv Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
@@ -81,7 +81,7 @@ AM_CONDITIONAL(HAVE_RUBY, test x$with_ruby = xyes)
|
|||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS(unistd.h stdint.h syslog.h)
|
AC_CHECK_HEADERS(unistd.h stdint.h syslog.h)
|
||||||
|
|
||||||
AC_CHECK_FUNCS(asprintf)
|
AC_CHECK_FUNCS([asprintf __secure_getenv secure_getenv])
|
||||||
|
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
|
@@ -30,6 +30,19 @@
|
|||||||
|
|
||||||
#include "private.h"
|
#include "private.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow libapparmor to build on older systems where secure_getenv() is still
|
||||||
|
* named __secure_getenv(). This snippet was taken from the glibc wiki
|
||||||
|
* (https://sourceware.org/glibc/wiki/Tips_and_Tricks/secure_getenv).
|
||||||
|
*/
|
||||||
|
#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
|
||||||
|
|
||||||
struct ignored_suffix_t {
|
struct ignored_suffix_t {
|
||||||
const char * text;
|
const char * text;
|
||||||
int len;
|
int len;
|
||||||
|
Reference in New Issue
Block a user