#####################################################################
AC_CHECK_FUNCS_ONCE(__xstat)
+AC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv])
# dietlibc doesn't have st.st_mtim struct member
AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
#define KCMD_LINE_SIZE 4096
+#ifndef HAVE_SECURE_GETENV
+# ifdef HAVE___SECURE_GETENV
+# define secure_getenv __secure_getenv
+# else
+# warning neither secure_getenv nor __secure_getenv is available
+# define secure_getenv getenv
+# endif
+#endif
+
void kmod_log(const struct kmod_ctx *ctx,
int priority, const char *file, int line, const char *fn,
const char *format, ...) __attribute__((format(printf, 6, 7))) __attribute__((nonnull(1, 3, 5)));
ctx->dirname = get_kernel_release(dirname);
/* environment overwrites config */
- env = getenv("KMOD_LOG");
+ env = secure_getenv("KMOD_LOG");
if (env != NULL)
kmod_set_log_priority(ctx, log_priority(env));