mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01: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:
parent
5a17ffb598
commit
0d06dfa24c
2 changed files with 14 additions and 1 deletions
|
@ -81,7 +81,7 @@ AM_CONDITIONAL(HAVE_RUBY, test x$with_ruby = xyes)
|
|||
AC_HEADER_STDC
|
||||
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
|
||||
AC_C_CONST
|
||||
|
|
|
@ -30,6 +30,19 @@
|
|||
|
||||
#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 {
|
||||
const char * text;
|
||||
int len;
|
||||
|
|
Loading…
Add table
Reference in a new issue