dnl AC_PROG_CC
AC_PROG_CXX
AC_CONFIG_HEADERS([config.h])
-AC_CHECK_HEADERS(stdarg.h stdio.h stdint.h sys/param.h)
+AC_CHECK_HEADERS(stdarg.h stdio.h stdint.h sys/param.h stdlib.h)
AC_REPLACE_FUNCS(vasprintf)
+AC_CHECK_FUNCS([ secure_getenv])
dnl Check if we're on Solaris and set CFLAGS accordingly
dnl AC_CANONICAL_TARGET
AM_CFLAGS += -DIEEE8021X_EAPOL
AM_CFLAGS += -DCONFIG_IPV6
-
+AM_CFLAGS += -DCONFIG_DEBUG_FILE
AM_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
AM_CFLAGS += -DCONFIG_INTERNAL_SHA1
AM_CFLAGS += -DEAP_TLS_OPENSSL
void
gssEapFinalize(void);
+
+ /*If built as a library on Linux, don't respect environment when set*uid*/
+#ifdef HAVE_SECURE_GETENV
+#define getenv secure_getenv
+#endif
+
#ifdef __cplusplus
}
#endif
peerNotifyPending,
};
-#ifdef GSSEAP_DEBUG
extern int wpa_debug_level;
-#endif
#define CHBIND_SERVICE_NAME_FLAG 0x01
#define CHBIND_HOST_NAME_FLAG 0x02
gss_buffer_desc identity = GSS_C_EMPTY_BUFFER;
gss_buffer_desc realm = GSS_C_EMPTY_BUFFER;
gss_cred_id_t cred = ctx->cred;
+ char *debug_file = NULL;
eapPeerConfig->identity = NULL;
eapPeerConfig->identity_len = 0;
GSSEAP_KRB_INIT(&krbContext);
eapPeerConfig->fragment_size = 1024;
-#ifdef GSSEAP_DEBUG
- wpa_debug_level = 0;
-#endif
-
+ wpa_debug_level = MSG_ERROR;
+ if ((debug_file = getenv("GSSEAP_TRACE")) != NULL) {
+ wpa_debug_open_file(debug_file);
+ wpa_debug_level = 0;
+ }
+
GSSEAP_ASSERT(cred->name != GSS_C_NO_NAME);
if ((cred->name->flags & (NAME_FLAG_NAI | NAME_FLAG_SERVICE)) == 0) {