Commit Graph

470 Commits

Author SHA1 Message Date
Michal Domonkos 89c6a9d607 Really disable OpenMP if too old
Fix up for commit 6a780f1.
2020-12-04 08:59:01 +02:00
Panu Matilainen c223d84fbf Eliminate use of obsolete gethostbyname() function
We only actually used gethostbyname() for canonicalizing buildhost,
convert that to use getaddrinfo() instead, which actually has an
option for retrieving exactly what we want.

The other "use" was to initialize name services, but as we don't need
or use hostnames for any operation, we can just as well drop it. User
and group names are what we care about.
2020-11-23 13:00:59 +02:00
Fabrice Fontaine 13585fbbe8 configure.ac: fix cross-compilation
Use AC_COMPILE_IFELSE as AC_RUN_IFELSE raises a build failure when
cross-compiling

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-11-11 12:03:52 +02:00
Jes Sorensen 9b3a65ef06 plugins/fsverity: Install fsverity signatures
This plugin installs fsverity signatures for regular files, when a signature
is found in the RPM. It tries to enable them unconditionally, but fails
gracefully if fsverity isn't supported or enabled.

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2020-09-04 13:22:38 +03:00
Jes Sorensen b296cbb67a Add basic autoconf and framework for fsverity support
Use the same signing key argument as is used for IMA file signing.

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2020-09-04 13:22:38 +03:00
Michal Domonkos e912be833e Bump Lua to 5.2 in configure script
In line with commit 6d4c68b.  While at it, also state the required
version in the error message.
2020-09-02 09:47:16 +03:00
Michal Domonkos 6a780f10c2 Check for OpenMP version at configure time
Only accept OpenMP >= 4.5, due to the "priority" clause that we use
since commit 6f6f5e7, and also document that in the INSTALL file.

If explicitly required with --enable-openmp, fail configuration if the
version is not available.

https://www.openmp.org/wp-content/uploads/openmp-4.5.pdf

Resolves: #1315
2020-09-02 09:47:16 +03:00
Martin Liska e6ecb47d15 zstd compression: port to the new API.
Port zstd compression to the new API (ZSTD_compressStream2).
2020-07-30 14:04:21 +02:00
Panu Matilainen d009ac4828 Remove support for NSS
NSS is a behemoth of a library which drags in a whole runtime subsystem
of its own which is often at odds with normal Unix system behavior
(hello SIGPIPE). Now that we have nicer alternatives available there's
little reason to lug this baggage along. NSS was deprecated in rpm 4.16
(commit 0b9efb93fb).
2020-05-29 08:54:56 +03:00
Panu Matilainen cf967331d3 Remove support for beecrypt
Beecrypt whose upstream is dead for more than ten years now, was deprecated
in rpm 4.16 (in commit 0910e6aa9e).
2020-05-29 08:54:56 +03:00
Panu Matilainen 3ca518876f Bump version to mark beginning of a new development cycle 2020-05-29 08:54:56 +03:00
Igor Raits a9199f17be macros: Drop internal macros which are not used in RPM and Fedora
The special note requires remsh which is used internally, under
different name (with one underscore instead of two).

Those macros are not used anywhere in RPM, neither in Fedora as of
today.

References: https://github.com/rpm-software-management/rpm/issues/1211
Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
2020-05-28 13:57:56 +03:00
Neal Gompa 0b9efb93fb Deprecate NSS support
The NSS library often changes in ways that somehow breaks rpm,
and these days upstream does not care about consumers of NSS other
than itself. This inflicts untold amounts of suffering on users
of rpm in distributions where rpm is linked to NSS.

Now that we have a couple of good, well-supported options, there is
no reason to keep supporting NSS as an option.

So now, we are deprecating it for later removal.
2020-04-16 15:53:18 +03:00
Neal Gompa 0910e6aa9e Add a warning when beecrypt is selected for the crypto library
Let's make it absolutely clear that selecting beecrypt is deprecated
and those continuing to use it should be aware that the option will
go away soon.
2020-04-16 15:53:18 +03:00
Panu Matilainen 8ed452dd86 Flush 1998 vintage fcntl-compatibility mess from system.h
fcntl.h is standard, include it from places that need it and drop
from system.h.
2020-04-02 13:53:38 +03:00
Panu Matilainen f8b8e86ae3 Flush 20+ year old statfs() jungle, always use standard statvfs()
Unlike that multiple statfs() variants, statvfs() is actually in
POSIX 1-2001 already and covers everything we need so there's little
point mucking with anything else. statvfs() is what Linux has been
using all along anyway this means no change on the primary platform.

If this actually regresses something, adding back OS-specific bits
is not a problem, but at least we'll get a clean start with that.
2020-03-30 10:28:41 +02:00
Panu Matilainen dd08abdd12 Drop support for dmalloc
Last dmalloc release is from 2007, and these days there are plenty of
other, maintained tools for debugging memory issues.
2020-03-27 15:49:18 +02:00
Panu Matilainen 3017eae9a3 Drop unmaintained "hacking docs" doxygen docs
We only maintain API docs for public interfaces, this is just
unnecessary clutter that nobody builds anyway.
2020-03-27 15:49:18 +02:00
Panu Matilainen 8d628a138e Assume/require POSIX-compliant chmod(1)
The message about telling your OS vendor about GNU utilities that
gets removed here dates back to 1997. The X syntax to chmod goes back
to at least 2004 specification of POSIX 1003.1, I think we can safely
assume that capability in 2020. And that OS vendors know about GNU :)
2020-03-27 15:49:18 +02:00
Panu Matilainen 9318433c7f We don't use yacc for anything, don't bother testing for it 2020-03-27 15:49:18 +02:00
Panu Matilainen cd6e4eb9e0 Move the auxiliary build tool clutter to a subdirectory 2020-03-27 15:48:46 +02:00
Panu Matilainen 4762c7a3ad Bump gettext version to 0.18.2 to get rid of deprecation warnings
Our beloved gettext 0.16.1 version causes automake to complain about
AM_PROG_MKDIR_P being deprecated although we never directly use such
a macro for anything. This appears to have been fixed in gettext 0.18.2
so bump to that version, having been released in 2012 makes it, um,
mature enough, even for rpm purposes.
2020-03-25 15:40:04 +02:00
Panu Matilainen fc0169eb03 Deprecate Berkeley DB database backend
Berkeley DB 5.x is dead upstream ever since the license change some
seven years ago. Mark as deprecated for later removal now that we're
starting to have viable alternatives.
2020-03-23 13:44:29 +02:00
Panu Matilainen 60baf9c297 Deprecate beecrypt support
Beecrypt upstream is dead for seven years, this is not a healthy situation
(death tends to have that effect...) for any component, and even less
so for security sensitive component. Deprecate for later removal now
that we have multiple nicer alternatives.
2020-03-23 13:44:29 +02:00
Panu Matilainen cec09e4e00 Remove support for obsolete --with-beecrypt configure switch 2020-03-23 13:44:29 +02:00
Panu Matilainen 7de982ac09 Drop the experimental LMDB backend
In the three years that LMDB support has been in the tree, and four
since upstream promised 1.0.0 in a couple of months, there have been
no upstream changes towards eliminating the key size limitations that
we need. And in the meanwhile it has become clearer that LMDB is not
the promised land it seemed on the outset, instead it has issues
like requiring the database size to be pre-determined (#902).

Drop support for LMDB, there's active development going on in the area
of database backends and we cannot afford to drag along an experimental
backend that is blocked on upstream design limitations and shows no signs
of moving forward. We can always bring it back if the upstream situation
changes.
2020-03-20 12:31:04 +02:00
Michael Schroeder 7cc9eb84a3 Add support for reading BDB without the library
This commit implements a read-only backend that allows accessing
of BerkeleyDB databases without using the BerkeleyDB library.
The code supports btree version 9-10 and hash version 8-10.

There are two use cases for this:

1) Conversion of an existing BerkeleyDB to a different
   backend.

2) Allowing package scriptlets to do database queries while
   in a transaction that replaced rpm with a version that
   no longer links against BerkeleyDB.

If both BerkeleyDB and the read-only backend are enabled, rpm will
default to BerkeleyDB.
2020-01-13 16:12:13 +02:00
Michael Schroeder 7949d290b8 Remove the experimental status from the ndb database 2020-01-13 13:09:52 +02:00
Michael Schroeder 4c7323f69b Fix building with no BerkeleyDB support
The configure script used to define BDB even if BerkeleyDB has
been disabled.
2019-12-26 09:00:37 +01:00
Panu Matilainen 9c8a3faf42 Fix sqlite database access for unprivileged readers in WAL mode
As of sqlite 3.22.0, a database in WAL mode can be opened readonly
if one or more of the following is true:

1) The -shm and -wal files already exists and are readable
2) There is write permission on the directory containing the database
   so that the -shm and -wal files can be created.
3) The database connection is opened using the immutable query parameter.

Regular users running queries cannot have permission to create, and
immutable databases can only exist on readonly media (because all locking
is disabled) so there's no choice but to leave the -shm and -wal files
around at all times, a little ugly as it might be.
2019-11-21 09:36:50 +02:00
Ross Burton 22ed98efe3 configure.ac: prefer pkg-config to find libgcrypt
libgcrypt from 1.8.5 provides a pkg-config file as well as the traditional
libgcrypt-config script.  As pkg-config is more resiliant in the face of
complicated build environments (for example cross-compilation and sysroots)
prefer the pkg-config file, falling back to libgcrypt-config if that doesn't
exist.
2019-11-21 09:36:28 +02:00
Panu Matilainen 9fe75561f9 Replace uses of localtime() with the re-entrant variant
LGTM flags localtime() as a "dangerous" function, which seems a bit
over the top to me, but as we're flirting with threads, it certainly
is not thread-safe.
2019-10-31 11:59:20 +01:00
Panu Matilainen 07129b641b Add an experimental sqlite based rpmdb backend
All normal functionality is expected to work. Automatic generation
of missing index tables is missing, but that's not relevant at this time.
Going forward, we'll also want some sort of compatibility tracking
for the sql schema.

The database scheme basically just mirrors what BDB does, using strings
for strings and blobs for everything else due to the way integers are
handled in the sqlite C API, for now at least. Some amount of schema
changes are to be expected before this is considered final.

Performance is similar or better with BDB in the current unsafe CDB
model, but sqlite uses proper database transactions so this is expected
to be an order of magnitude more robust.

Many things are stupid and/or kind of backwards here due to the internal
API, which I've avoided changing in order to keep it backportable for the
time being. https://github.com/rpm-software-management/rpm/pull/836 is
needed but otherwise this should drop quite trivially into 4.14.x too.
However as we're planning for a longer term future here, it would be dumb
to limit ourselves by what's possible with an internal BDB-oriented API,
so I've fairly major changes planned in that direction.
2019-10-18 10:38:34 +03:00
Panu Matilainen a84a33816a Add configure option to build with -Werror
-Werror is a bit tricky as it'll cause autoconf tests fail left and right
if it's just passed normally via CFLAGS, so we need to sneak it in
by some other means.

Note that while developers should always enable this, -Werror must never
ever be a default as it'll eventually just cause bogus build failures
when old releases get built with newer compilers.
2019-10-16 12:12:40 +03:00
Michael Schroeder 3625ca14c7 Refactor mmap/munmap/mremap handling in ndb
Also emulate mremap with mmap/munmap in ndb if it is not
available.
2019-10-16 12:09:51 +03:00
Panu Matilainen 5c0801a1a3 Change the default crypto implementation to libgcrypt (from NSS)
libgcrypt is a much more straightforward and lightweight as a library,
doesn't come with a massive runtime library of its own, runtime which
messes with SIGPIPE and all, has a nice clearly compatible license (LGPL)
and is somewhat faster than NSS. What's not to like?

Change the default and add relevant documentation to INSTALL. Drop
the hopefully now unnecessary override from distcheck flags, and
switch CI over too. Note that in CI, openssl-devel is still needed
for ima-evm (missing dep in ima-evm-utils-devel?)
2019-09-11 09:58:00 +03:00
Michael Schroeder 037106ecc8 Support libgrypt as crypto library 2019-09-10 09:55:41 +03:00
Panu Matilainen 67f8f2b01d Axe support for Python 2
Python 2 will be EOL by the time of the next major rpm release,
time to retire the Python 2 bindings. Specifically we require
Python >= 3.1 for surrogateescape-support.
2019-08-12 09:54:44 +03:00
Panu Matilainen 7c520be4da Bump version to mark the beginning of new devel cycle 2019-06-26 17:54:30 +03:00
Panu Matilainen 464d21dc8c Fix build with --disable-openmp
AC_OPENMP supports --enable/disable-openmp out of the box, but as it
only sets OPENMP_CFLAGS *if needed by the compiler to support openmp*,
it's utterly useless for conditional building. And because AC_OPENMP
doesn't set $ac_cv_prog_c_openmp to anything if --disable-openmp was
used, we need to test that it's neither empty nor unsupported to
determine if we actually have openmp, in order to set an autoconf
define that we can actually use to conditionalize aspects of the
build on. Argh.
2019-06-24 17:12:17 +02:00
Howard Johnson 4c2b3f25f6 Rename rpmqv.c to rpm.c, as it's the main source for the rpm command 2019-06-03 15:10:46 +03:00
Panu Matilainen 56662b1b1b Add infrastructure for OpenMP support in librpmbuild
Enable OpenMP use in librpmbuild and set the number of OMP threads
from rpm config after spec parsing. The place matters as we want to
allow individual specs to control and disable parallel builds.
2019-05-21 10:54:53 +02:00
Panu Matilainen d48981ad7e Support build-id generation from compressed ELF files (elfutils >= 0.175)
Use dwelf_elf_begin() for reading ELF files for build-id generation on
versions that have it to support compressed ELF files such as kernel
modules (RhBug:1650072,1650074). Note that debugedit still cannot handle
compressed files, this is only for build-id generation.
2019-04-10 09:39:37 +03:00
Panu Matilainen ad16a04b6e Add plugin for logging audit events for package operations as per OSPP v4.2
When enabled, log audit events for package install, update and remove.
The log includes the operation, package nevra, signature check result,
whether signatures are being enforced enforced and overall operation
result code. Package install/update/remove are logged as such,
obsoletion is logged as install + remove (whereas the erasure element
on updates is silent). Enable compilation in CI.

Loosely based on initial RHEL 7-8 implementations by Pavlina Moravcova
Varekova and Florian Festi (RhBug:1555326, RhBug:1607612)
2019-04-09 11:04:02 +02:00
Panu Matilainen 1fac727638 Default to Python 3 for bindings, deprecate Python 2 support
Python 2 EOL is closing in fast, time we start looking forward instead
of backward too. Document how to build for Python 2 for now, and update
version requirements.
2019-02-26 11:58:15 +02:00
Panu Matilainen 3e6b0d0fb8 Don't bother checking for python and perl binaries
Should've been in commit ba85c95963,
we no longer use these for anything. Drop check for PGP while at it.
2019-02-26 10:02:01 +02:00
Panu Matilainen e1d3811883 Support building rpm without Berkeley DB, simplify the configuration
Replace the --with-external-db switch with the following simple logic:
if internal copy of BDB is detected, use it, otherwise look for an
external one. By default BDB is still required, but it's now possible
to build without it by using --disable-bdb argument to configure.
If no database is built in, we'll segfault for now, to be dealt with
in coming commits.

This is a rather historical moment, BTW.
2019-02-01 15:21:08 +02:00
Panu Matilainen 815a362875 Fix BDB build when automatically selecting internal BDB
Commit 9e64f8d5b7 was supposed to allow
this but actually building the internal BDB requires with_external_db to
be "no", whereas in the automatic case it was "maybe", resulting in
the internal BDB not actually getting built at all.
2019-02-01 13:54:59 +02:00
Panu Matilainen b4c832caed Add experimental support for non-privileged chroot on Linux
If host kernel supports user namespaces, this allows non-privileged users
to perform chrooted operations such as installations and verification.
With caveats. Only root:root ownership is supported in the namespace, so
packages with other file ownerships will fail to install properly, chown()
fails with -EINVAL similarly to what happens on squashed NFS-mount. We
don't handle that particularly gracefully.

Also add the obligatory disabler, and use it for the test-suite for
now. Only two tests (61 and 342) actually fail because of it, simply
because things are ... different with user namespaces.
2019-01-17 14:08:21 +02:00
Panu Matilainen 69e8b91dcc Add a built-in macro for fetching number of CPUs, affinity aware and all
There's an increasing number of placing wanting to know the number of
CPU's for parallel processing, and increasingly these things are running
in containers and such where the total host CPU count is not meaningful.
2019-01-15 11:16:04 +02:00