Skip to content

Compilation fails with --with-lmdb #2008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mdunc opened this issue Jan 25, 2019 · 2 comments
Closed

Compilation fails with --with-lmdb #2008

mdunc opened this issue Jan 25, 2019 · 2 comments
Assignees
Labels
3.x Related to ModSecurity version 3.x

Comments

@mdunc
Copy link

mdunc commented Jan 25, 2019

Describe the bug

When compiling with LMDB, compilation fails with an error regarding Regex

Logs and dumps

Output of:
Compilation error:

collection/backend/lmdb.cc: In member function 'virtual void modsecurity::collection::backend::LMDB::resolveRegularExpression(const string&, std::vector<const modsecurity::VariableValue*>*, modsecurity::Variables::KeyExclusions&)':
collection/backend/lmdb.cc:541:38: error: use of deleted function 'modsecurity::Utils::Regex::Regex(const modsecurity::Utils::Regex&)'
     Utils::Regex r = Utils::Regex(var);
                                      ^
In file included from ../src/variables/variable.h:28:0,
                 from ../src/collection/backend/lmdb.h:39,
                 from collection/backend/lmdb.cc:17:
../src/utils/regex.h:57:5: note: declared here
     Regex(const Regex&) = delete;
     ^
Makefile:2608: recipe for target 'collection/backend/libmodsecurity_la-lmdb.lo' failed
make[3]: *** [collection/backend/libmodsecurity_la-lmdb.lo] Error 1
make[3]: Leaving directory '/build/ModSecurity/src'
Makefile:3196: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/build/ModSecurity/src'
Makefile:1009: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/build/ModSecurity/src'
Makefile:1014: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

To Reproduce

Steps to reproduce the behavior:

Easily reproducible in a fresh Ubuntu 16.04 Docker container, but I imagine other distros are also affected.

docker run --rm -ti ubuntu:16.04 bash

#install build dependencies
apt update
apt -y install build-essential git libpcre3-dev libltdl-dev libtool zlib1g-dev autoconf
mkdir /build
cd /build

#compile and install lmdb
git clone https://github.com/LMDB/lmdb.git
cd lmdb/libraries/liblmdb
make && make install && ldconfig

#compile and install ModSecurity
cd /build
git clone https://github.com/SpiderLabs/ModSecurity.git
cd ModSecurity
git checkout v3/master
git submodule init
git submodule update
./build.sh
./configure --with-lmdb
make && make install

Expected behavior

The expected behavior is the compilation completes successfully as it did before.

@mdunc mdunc changed the title Compilations fails with --with-lmdb Compilation fails with --with-lmdb Jan 25, 2019
@mdunc
Copy link
Author

mdunc commented Jan 25, 2019

If I checkout e0a0fa0, it compiles just fine.

@WGH-
Copy link
Contributor

WGH- commented Jan 25, 2019

The fix is simple, I wonder why CI didn't catch this though. I'll check that.

WGH- added a commit to WGH-/ModSecurity that referenced this issue Jan 27, 2019
LMBD is not built by default since 6143eb9,
so add explicit --with-lmdb configuration.

Missing --with-lmdb build allowed a bug in PR owasp-modsecurity#2003 to pass
through, causing issue owasp-modsecurity#2008.
WGH- added a commit to WGH-/ModSecurity that referenced this issue Jan 27, 2019
@zimmerle zimmerle self-assigned this Jan 28, 2019
@zimmerle zimmerle added the 3.x Related to ModSecurity version 3.x label Jan 28, 2019
zimmerle pushed a commit that referenced this issue Jan 28, 2019
LMBD is not built by default since 6143eb9,
so add explicit --with-lmdb configuration.

Missing --with-lmdb build allowed a bug in PR #2003 to pass
through, causing issue #2008.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

No branches or pull requests

3 participants