Skip to content

SecRemoteRule 'crypto' option unavailable on 32-bit machines even though apu has crypto support #882

Closed
@skurtn

Description

@skurtn

Description

Mod Security doesn't properly set WITH_APU_CRYPTO on a 32-bit Linux system.

Error

configure: WARNING: APR util was not compiled with crypto support. SecRemoteRule will not support the parameter 'crypto'

Summary

The test code in configure.ac effectively generates the following source code, then attempts to compile it. The result being, if a compile (or definition) error is found, it will enable/disable crypto support accordingly: gcc -O2 $(apu-1-config --cflags) file.c

/* confdefs.h */
/* a bunch of un-related #define go here */
/* end confdefs.h.  */
#include <apr_crypto.h>
int
main ()
{
          #if APU_HAVE_CRYPTO == 0
          #error APR util was not compiled with crypto support.
          #endif

  return 0;
}

However, manually compiling the code on a 32-bit machine yields the following:

# gcc -O2  -I/usr/local/apache/include  -o issue /tmp/issue.c
In file included from /usr/local/apache/include/apr_pools.h:43,
                 from /usr/local/apache/include/apr_crypto.h:21,
                 from /tmp/lol.c:49:
/usr/local/apache/include/apr.h:358: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘apr_off_t’

This is due to the fact that apr-1-config --cflags --cppflags isn't being passed along. In doing so, the additional necessary compile parameters are not passed, and apr_off_t is not properly defined.

If the test code is compiled with apr-1-config output, crypto support is detected, and thus enabled.

# /usr/local/apache/bin/apr-1-config --cflags --cppflags
 -pthread -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions