mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Fixed byte conversion issue during logging under zlinux
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -15,6 +15,8 @@
|
|||||||
* Added a better random bytes generator using apr_generate_random_bytes() to create
|
* Added a better random bytes generator using apr_generate_random_bytes() to create
|
||||||
the HMAC key.
|
the HMAC key.
|
||||||
|
|
||||||
|
* Fixed byte conversion issue during logging under Linux s390x platform.
|
||||||
|
|
||||||
* Fixed compilation bug with LibXML2 2.9.0 (Thanks Athmane Madjoudj).
|
* Fixed compilation bug with LibXML2 2.9.0 (Thanks Athmane Madjoudj).
|
||||||
|
|
||||||
* Fixed parsing error with modsecurity-recommended.conf and Apache 2.4.
|
* Fixed parsing error with modsecurity-recommended.conf and Apache 2.4.
|
||||||
|
@@ -229,7 +229,11 @@ static char *construct_auditlog_filename(apr_pool_t *mp, const char *uniqueid) {
|
|||||||
* as an audit log boundary.
|
* as an audit log boundary.
|
||||||
*/
|
*/
|
||||||
static char *create_auditlog_boundary(request_rec *r) {
|
static char *create_auditlog_boundary(request_rec *r) {
|
||||||
|
#ifdef LINUX_S390
|
||||||
|
int data = swap_int32(rand());
|
||||||
|
#else
|
||||||
unsigned long data = rand();
|
unsigned long data = rand();
|
||||||
|
#endif
|
||||||
/* Do note that I tried using apr_generate_random_bytes but it turned
|
/* Do note that I tried using apr_generate_random_bytes but it turned
|
||||||
* out to be terribly slow for some reason. Needs further investigation.
|
* out to be terribly slow for some reason. Needs further investigation.
|
||||||
*/
|
*/
|
||||||
|
@@ -74,6 +74,15 @@ static unsigned char *c2x(unsigned what, unsigned char *where);
|
|||||||
static unsigned char x2c(unsigned char *what);
|
static unsigned char x2c(unsigned char *what);
|
||||||
static unsigned char xsingle2c(unsigned char *what);
|
static unsigned char xsingle2c(unsigned char *what);
|
||||||
|
|
||||||
|
#ifdef LINUX_S390
|
||||||
|
int swap_int32(int x) {
|
||||||
|
int swap = ((x>>24)&0xff) | ((x<<8)&0xff0000) |
|
||||||
|
((x>>8)&0xff00) | ((x<<24)&0xff000000);
|
||||||
|
return swap;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/** \brief Decode utf-8 to unicode format.
|
/** \brief Decode utf-8 to unicode format.
|
||||||
*
|
*
|
||||||
* \param mp Pointer to memory pool
|
* \param mp Pointer to memory pool
|
||||||
|
@@ -46,6 +46,11 @@ int DSOLOCAL inet_pton(int family, const char *src, void *dst);
|
|||||||
#define UNICODE_ERROR_RESTRICTED_CHARACTER -4
|
#define UNICODE_ERROR_RESTRICTED_CHARACTER -4
|
||||||
#define UNICODE_ERROR_DECODING_ERROR -5
|
#define UNICODE_ERROR_DECODING_ERROR -5
|
||||||
|
|
||||||
|
#ifdef LINUX_S390
|
||||||
|
int DSOLOCAL swap_int32(int x);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
char DSOLOCAL *utf8_unicode_inplace_ex(apr_pool_t *mp, unsigned char *input, long int input_len, int *changed);
|
char DSOLOCAL *utf8_unicode_inplace_ex(apr_pool_t *mp, unsigned char *input, long int input_len, int *changed);
|
||||||
|
|
||||||
char DSOLOCAL *m_strcasestr(const char *haystack, const char *needle);
|
char DSOLOCAL *m_strcasestr(const char *haystack, const char *needle);
|
||||||
|
@@ -100,6 +100,11 @@ case $host in
|
|||||||
*-*-linux*)
|
*-*-linux*)
|
||||||
echo "Checking plataform... Identified as Linux"
|
echo "Checking plataform... Identified as Linux"
|
||||||
linuxos=true
|
linuxos=true
|
||||||
|
case "${host_cpu}" in
|
||||||
|
s390x)
|
||||||
|
cpu_type="-DLINUX_S390"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
*-*-solaris*)
|
*-*-solaris*)
|
||||||
echo "Checking plataform... Identified as Solaris"
|
echo "Checking plataform... Identified as Solaris"
|
||||||
@@ -135,6 +140,7 @@ AM_CONDITIONAL([AIX], [test x$aixos = xtrue])
|
|||||||
AM_CONDITIONAL([HPUX], [test x$hpuxos = xtrue])
|
AM_CONDITIONAL([HPUX], [test x$hpuxos = xtrue])
|
||||||
AM_CONDITIONAL([MACOSX], [test x$macos = xtrue])
|
AM_CONDITIONAL([MACOSX], [test x$macos = xtrue])
|
||||||
AM_CONDITIONAL([LINUX], [test x$linuxos = xtrue])
|
AM_CONDITIONAL([LINUX], [test x$linuxos = xtrue])
|
||||||
|
AM_CONDITIONAL([LINUX390], [test x$linuxos390 = xtrue])
|
||||||
AM_CONDITIONAL([SOLARIS], [test x$solarisos = xtrue])
|
AM_CONDITIONAL([SOLARIS], [test x$solarisos = xtrue])
|
||||||
AM_CONDITIONAL([FREEBSD], [test x$freebsdos = xtrue])
|
AM_CONDITIONAL([FREEBSD], [test x$freebsdos = xtrue])
|
||||||
AM_CONDITIONAL([OPENBSD], [test x$openbsdos = xtrue])
|
AM_CONDITIONAL([OPENBSD], [test x$openbsdos = xtrue])
|
||||||
@@ -627,7 +633,7 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api"
|
MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api $cpu_type"
|
||||||
|
|
||||||
APXS_WRAPPER=build/apxs-wrapper
|
APXS_WRAPPER=build/apxs-wrapper
|
||||||
APXS_EXTRA_CFLAGS=""
|
APXS_EXTRA_CFLAGS=""
|
||||||
|
Reference in New Issue
Block a user