27RCSID(
"$Id: b8af05290cd0c48b4a424ac6df6d21077267f668 $")
29#include <freeradius-devel/util/regex.h>
30#include <freeradius-devel/util/syserror.h>
32#include <freeradius-devel/server/cf_util.h>
33#include <freeradius-devel/server/dependency.h>
34#include <freeradius-devel/server/log.h>
44#include <freeradius-devel/tls/openssl_user_macros.h>
47# include <freeradius-devel/tls/version.h>
48# include <openssl/crypto.h>
49# include <openssl/opensslv.h>
52#ifdef HAVE_GPERFTOOLS_PROFILER_H
53# include <gperftools/profiler.h>
56#ifdef HAVE_VALGRIND_VALGRIND_H
57# include <valgrind/valgrind.h>
72 ERROR(
"Application and libfreeradius-server magic number (prefix) mismatch."
73 " application: %x library: %x",
79 ERROR(
"Application and libfreeradius-server magic number (version) mismatch."
80 " application: %lx library: %lx",
86 ERROR(
"Application and libfreeradius-server magic number (commit) mismatch."
87 " application: %lx library: %lx",
115 if (!
fr_cond_assert_msg(cs,
"dependency_features_init() must be called before calling %s", __FUNCTION__)) {
156 if (!
fr_cond_assert_msg(cs,
"dependency_version_numbers_init() must be called before calling %s", __FUNCTION__)) {
187#ifdef HAVE_CAPABILITY_H
195#ifdef HAVE_REGEX_PCRE2
202#ifdef HAVE_REGEX_POSIX
205# ifdef HAVE_REG_EXTENDED
217#
if defined(HAVE_REGNEXEC) || defined(HAVE_REGEX_PCRE2)
265#ifdef __SANITIZE_ADDRESS__
272#ifdef HAVE_SANITIZER_COMMON_INTERFACE_DEFS_H
279#ifdef HAVE_GPERFTOOLS_PROFILER_H
281 struct ProfilerState
state;
283 ProfilerGetCurrentState(&
state);
292#ifdef HAVE_VALGRIND_H
305#ifdef EVFILT_LIBKQUEUE
306static void dependency_libqueue_version(
CONF_SECTION *cs)
309 struct kevent kev, receipt;
318 EV_SET(&kev, 0, EVFILT_LIBKQUEUE, EV_ADD, NOTE_VERSION_STR, 0, NULL);
319 ret = kevent(kqfd, &kev, 1, &receipt, 1, &(
struct timespec){});
321 if (ret != 1)
goto kqueue_error;
348# ifdef HAVE_REGEX_PCRE2
354#ifdef EVFILT_LIBKQUEUE
355 dependency_libqueue_version(cs);
379 DEBUG2(
"Server was built with:");
385 if (max < len) max = len;
392 if (max < len) max = len;
407 DEBUG2(
"Server core libs:");
425#ifdef WORDS_BIGENDIAN
431 DEBUG2(
"Compilation flags:");
432#ifdef BUILT_WITH_CPPFLAGS
433 DEBUG2(
" cppflags : %s", BUILT_WITH_CPPFLAGS);
435#ifdef BUILT_WITH_CFLAGS
436 DEBUG2(
" cflags : %s", BUILT_WITH_CFLAGS);
438#ifdef BUILT_WITH_LDFLAGS
439 DEBUG2(
" ldflags : %s", BUILT_WITH_LDFLAGS);
441#ifdef BUILT_WITH_LIBS
442 DEBUG2(
" libs : %s", BUILT_WITH_LIBS);
446#ifdef WITH_VERIFY_PTR
448 WARN(
"#######################################################################");
450 WARN(
"# The server was built with the 'WITH_VERIFY_PTR' flag set. This is a");
451 WARN(
"# developer-only build option that DRASTICALLY slows down the server.");
452 WARN(
"# If you are using the server in a production environment, you will see");
453 WARN(
"# significantly improved performance (3x-4x) by re-running 'configure'");
454 WARN(
"# with the flag '--disable-developer', and then re-building and");
455 WARN(
"# re-installing the server.");
457 WARN(
"#######################################################################");
461 INFO(
"Copyright 1999-2026 The FreeRADIUS server project and contributors");
462 INFO(
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A");
463 INFO(
"PARTICULAR PURPOSE");
464 INFO(
"You may redistribute copies of FreeRADIUS under the terms of the");
465 INFO(
"GNU General Public License");
466 INFO(
"For more information about these matters, see the file named COPYRIGHT");
468 INFO(
"FreeRADIUS is developed, maintained, and supported by InkBridge Networks.");
469 INFO(
"For commercial support, please email sales@inkbridgenetworks.com");
470 INFO(
"https://inkbridgenetworks.com/");
static int const char char buffer[256]
#define USES_APPLE_DEPRECATED_API
Common header for all CONF_* types.
Configuration AVP similar to a fr_pair_t.
A section grouping multiple CONF_PAIR.
CONF_PAIR * cf_pair_alloc(CONF_SECTION *parent, char const *attr, char const *value, fr_token_t op, fr_token_t lhs_quote, fr_token_t rhs_quote)
Allocate a CONF_PAIR.
CONF_PAIR * cf_pair_find(CONF_SECTION const *cs, char const *attr)
Search for a CONF_PAIR with a specific name.
CONF_PAIR * cf_item_to_pair(CONF_ITEM const *ci)
Cast a CONF_ITEM to a CONF_PAIR.
char const * cf_pair_value(CONF_PAIR const *pair)
Return the value of a CONF_PAIR.
int cf_pair_replace(CONF_SECTION *cs, CONF_PAIR *cp, char const *value)
Replace pair value in a given section with the given value.
char const * cf_pair_attr(CONF_PAIR const *pair)
Return the attr of a CONF_PAIR.
#define cf_item_next(_parent, _curr)
#define cf_section_alloc(_ctx, _parent, _name1, _name2)
int fr_get_lsan_state(void)
int fr_get_debug_state(void)
#define fr_cond_assert_msg(_x, _fmt,...)
Calls panic_action ifndef NDEBUG, else logs error and evaluates to value of _x.
void dependency_version_print(void)
void dependency_features_init(CONF_SECTION *cs)
Initialise core feature flags.
int rad_check_lib_magic(uint64_t magic)
Check if the application linking to the library has the correct magic number.
static USES_APPLE_DEPRECATED_API uint64_t libmagic
char const * radiusd_version_short
void dependency_version_numbers_init(CONF_SECTION *cs)
Initialise core version flags.
int dependency_feature_add(CONF_SECTION *cs, char const *name, bool enabled)
Add a feature flag to the main configuration.
int dependency_version_number_add(CONF_SECTION *cs, char const *name, char const *version)
Add a library/server version pair to the main configuration.
static CONF_SECTION * default_feature_cs
Default configuration section to add features to.
static char const * spaces
static CONF_SECTION * default_version_cs
Default configuration section to add features to.
#define RUNNING_ON_VALGRIND
#define DEBUG_ENABLED3
True if global debug level 1-3 messages are enabled.
PUBLIC int snprintf(char *string, size_t length, char *format, va_alist)
char const * fr_syserror(int num)
Guaranteed to be thread-safe version of strerror.
char const * fr_openssl_version_basic(void)
#define MAGIC_VERSION(_x)
#define RADIUSD_MAGIC_NUMBER