mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Uses autotools to idenfiy if sys/utsname.h is present
Fix build problem on the msc_status_engine, reported by: Walter Hop and Derek Werthmuller.
This commit is contained in:
parent
33231378d7
commit
50e4961dd4
@ -14,6 +14,7 @@
|
||||
|
||||
#include "msc_status_engine.h"
|
||||
#include "apr_sha1.h"
|
||||
#include "modsecurity_config.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock2.h>
|
||||
@ -26,7 +27,6 @@
|
||||
#include <net/if.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#ifndef IFT_ETHER
|
||||
@ -34,12 +34,13 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __gnu_linux__
|
||||
#include <sys/utsname.h>
|
||||
#if (defined(__linux__) || defined(__gnu_linux__))
|
||||
#include <linux/if.h>
|
||||
#include <linux/sockios.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_UTSNAME_H
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
|
||||
// Bese32 encode, based on:
|
||||
// https://code.google.com/p/google-authenticator/source/browse/libpam/base32.c
|
||||
@ -133,7 +134,9 @@ int DSOLOCAL msc_status_engine_machine_name(char *machine_name, size_t len) {
|
||||
if (GetComputerName(machine_name, &lenComputerName) == 0) {
|
||||
goto failed;
|
||||
}
|
||||
#else
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_UTSNAME_H
|
||||
static struct utsname u;
|
||||
|
||||
if ( uname( &u ) < 0 ) {
|
||||
@ -180,7 +183,7 @@ int DSOLOCAL msc_status_engine_mac_address (unsigned char *mac)
|
||||
freeifaddrs( ifaphead );
|
||||
#endif
|
||||
|
||||
#if __gnu_linux__
|
||||
#if (defined(__linux__) || defined(__gnu_linux__))
|
||||
struct ifconf conf;
|
||||
int sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP );
|
||||
struct ifreq* ifr;
|
||||
|
@ -33,7 +33,7 @@ AC_PATH_PROGS(ENV_CMD, [env printenv], )
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h sys/types.h sys/stat.h])
|
||||
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h sys/types.h sys/stat.h sys/utsname.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
|
Loading…
x
Reference in New Issue
Block a user