Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.5.2
-
None
Description
While building the latest 10.5 git head I noticed that if requires Internet access during the build. If there is no Internet, it will fail with:
-- Using src='http://ftp.pcre.org/pub/pcre/pcre2-10.34.zip'
|
CMake Error at pcre2-stamp/download-pcre2.cmake:159 (message):
|
Each download failed!
|
|
error: downloading 'http://ftp.pcre.org/pub/pcre/pcre2-10.34.zip' failed
|
status_code: 6
|
status_string: "Couldn't resolve host name"
|
log:
|
--- LOG BEGIN ---
|
Could not resolve host: ftp.pcre.org
|
Requiring mandatory Internet access for a build is bad practice and universally forbidden across all Linux distributions and all places that care about security and reliability.
All build dependencies should be stated explicitly in the build dependencies, and there should be no need to access the public Internet during the download. If there are any such extra steps, they should be strictly optional. Preferably though there would be no such step at all anywhere.
I could also go into detail to explain how this feature can be used moderately easily to backdoor all MariaDB 10.5 builds and completely compromise the supply chain security, but I assume all involved parties understand this anyway and this feature was just some temporary misjudgment.
PCRE2 is a build requirements. The build will automatically decide whether to use the system PCRE2 or try to download one.
You can also force the desired outcome with -DWITH_PCRE=system or -DWITH_PCRE=bundled.
Note that on our debian builders nothing is downloaded, see e.g. https://buildbot.askmonty.org/buildbot/builders/kvm-deb-stretch-amd64/builds/12728/steps/compile/logs/stdio
But it looks like dependencies aren't correctly specified in the control file, it should require libpcre2-dev, not libpcre3-dev.
And the build isn't easy to backdoor, because cmake verifies the md5 hash of the downloaded tarball. So an attacker would need to create a poisoned tarball with exactly the same md5 hash to be able to compromise the build.