]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoUpdate translation files
Weblate [Mon, 24 Aug 2020 07:29:19 +0000 (09:29 +0200)] 
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/
Translation: systemd/master

3 years agodocs: fix gpt-auto-generator manpage link
Ronan Pigott [Fri, 21 Aug 2020 19:12:33 +0000 (12:12 -0700)] 
docs: fix gpt-auto-generator manpage link

3 years agoMerge pull request #16808 from yuwata/test-network-reconfigure-routing-policy-rules
Zbigniew Jędrzejewski-Szmek [Fri, 21 Aug 2020 12:20:52 +0000 (14:20 +0200)] 
Merge pull request #16808 from yuwata/test-network-reconfigure-routing-policy-rules

add a test case for [RoutingPolicyRule] and fix minor issue in man page

3 years agoMerge pull request #16789 from keszybz/weblate
Zbigniew Jędrzejewski-Szmek [Fri, 21 Aug 2020 12:18:31 +0000 (14:18 +0200)] 
Merge pull request #16789 from keszybz/weblate

Import the .pot file into version control for weblate

3 years agoMerge pull request #16804 from keszybz/conditionals-and-spelling-fixes
Lennart Poettering [Fri, 21 Aug 2020 11:36:30 +0000 (13:36 +0200)] 
Merge pull request #16804 from keszybz/conditionals-and-spelling-fixes

Conditionals and spelling fixes

3 years agoRequest seccomp logging if SYSTEMD_LOG_SECCOMP environment variable is set.
Steve Dodd [Sun, 16 Aug 2020 20:57:41 +0000 (21:57 +0100)] 
Request seccomp logging if SYSTEMD_LOG_SECCOMP environment variable is set.

3 years agoMerge pull request #16686 from bluca/mount_images_opts
Zbigniew Jędrzejewski-Szmek [Fri, 21 Aug 2020 08:11:08 +0000 (10:11 +0200)] 
Merge pull request #16686 from bluca/mount_images_opts

core: add mount options support for MountImages

3 years agoseccomp: add support for riscv64
Aurelien Jarno [Wed, 19 Aug 2020 20:44:15 +0000 (22:44 +0200)] 
seccomp: add support for riscv64

This patch adds seccomp support to the riscv64 architecture. seccomp
support is available in the riscv64 kernel since version 5.5, and it
has just been added to the libseccomp library.

riscv64 uses generic syscalls like aarch64, so I used that architecture
as a reference to find which code has to be modified.

With this patch, the testsuite passes successfully, including the
test-seccomp test. The system boots and works fine with kernel 5.4 (i.e.
without seccomp support) and kernel 5.5 (i.e. with seccomp support). I
have also verified that the "SystemCallFilter=~socket" option prevents a
service to use the ping utility when running on kernel 5.5.

3 years agoman: fix invalid tag place 16808/head
Yu Watanabe [Fri, 21 Aug 2020 06:30:05 +0000 (15:30 +0900)] 
man: fix invalid tag place

3 years agotest-network: add a test case for reconfiguring routing policy rules
Yu Watanabe [Fri, 21 Aug 2020 06:27:35 +0000 (15:27 +0900)] 
test-network: add a test case for reconfiguring routing policy rules

C.f. #16784.

3 years agoMerge pull request #16803 from poettering/analyze-condition-rework
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 16:18:13 +0000 (18:18 +0200)] 
Merge pull request #16803 from poettering/analyze-condition-rework

support missing conditions/asserts everywhere

3 years agomount-util: tweak how we find inaccessible device nodes
Lennart Poettering [Wed, 19 Aug 2020 15:25:33 +0000 (17:25 +0200)] 
mount-util: tweak how we find inaccessible device nodes

On new kernels (>= 5.8) unprivileged users may create the 0:0 character
device node. Which is great, as we can use that as inaccessible device
nodes if we run unprivileged. Hence, change how we find the right
inaccessible device inodes: when the user asks for a block device node,
but we have none, try the char device node first. If that doesn't exist,
fall back to the socket node as before.

This means that:

1. in the best case we'll return a node if the right device node type
2. otherwise we hopefully at least can return a device node if one asked
   for even if the type doesn't match (i.e. we return char instead of
   the requested block device node)
3. in the worst case (old kernels…) we'll return a socket node

3 years agotree-wide: fix spelling of "fallback" 16804/head
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 09:23:26 +0000 (11:23 +0200)] 
tree-wide: fix spelling of "fallback"

Similarly to "setup" vs. "set up", "fallback" is a noun, and "fall back"
is the verb. (This is pretty clear when we construct a sentence in the
present continous: "we are falling back" not "we are fallbacking").

3 years agoman: add conditionals to more man pages
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 15:41:19 +0000 (17:41 +0200)] 
man: add conditionals to more man pages

Fixes #16701.

3 years agomeson: add ENABLE_ANALYZE conditional
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 15:35:50 +0000 (17:35 +0200)] 
meson: add ENABLE_ANALYZE conditional

3 years agomeson: fix build/man/{man,html} to support page redirects
Zbigniew Jędrzejewski-Szmek [Fri, 7 Aug 2020 16:42:22 +0000 (18:42 +0200)] 
meson: fix build/man/{man,html} to support page redirects

Commands like build/man/man journald.conf.d would show the installed
man page (or an error if the page cannot be found in the global search
path), and not the one in the build directory. If the man page is
a redirect, or the .html is a symlink, resolve it, build the target,
and show that.

3 years agotest-string-util: add a test for strjoin()
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 11:37:31 +0000 (13:37 +0200)] 
test-string-util: add a test for strjoin()

Strangely, we didn't have one so far. I mostly wanted to verify
that NULL can be used in any spot at behaves the same as "".

3 years agotest-acl-util: output more debug info
Zbigniew Jędrzejewski-Szmek [Fri, 7 Aug 2020 16:54:37 +0000 (18:54 +0200)] 
test-acl-util: output more debug info

For some reason this failed in koji build on s390x:
--- command ---
16:12:46 PATH='/builddir/build/BUILD/systemd-stable-246.1/s390x-redhat-linux-gnu:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin' SYSTEMD_LANGUAGE_FALLBACK_MAP='/builddir/build/BUILD/systemd-stable-246.1/src/locale/language-fallback-map' SYSTEMD_KBD_MODEL_MAP='/builddir/build/BUILD/systemd-stable-246.1/src/locale/kbd-model-map' /builddir/build/BUILD/systemd-stable-246.1/s390x-redhat-linux-gnu/test-acl-util
--- stdout ---
-rw-r-----. 1 mockbuild mock 0 Aug  7 16:12 /tmp/test-empty.7RzmEc
other::---
--- stderr ---
Assertion 'r >= 0' failed at src/test/test-acl-util.c:42, function test_add_acls_for_user(). Aborting.

3 years agoMerge pull request #16543 from poettering/nspawn-run-host
Lennart Poettering [Thu, 20 Aug 2020 14:20:05 +0000 (16:20 +0200)] 
Merge pull request #16543 from poettering/nspawn-run-host

nspawn: /run/host/ tweaks

3 years agocore: add mount options support for MountImages 16686/head
Luca Boccassi [Fri, 31 Jul 2020 14:06:15 +0000 (15:06 +0100)] 
core: add mount options support for MountImages

Follow the same model established for RootImage and RootImageOptions,
and allow to either append a single list of options or tuples of
partition_number:options.

3 years agocore: change RootImageOptions to use names instead of partition numbers
Luca Boccassi [Fri, 14 Aug 2020 17:50:46 +0000 (18:50 +0100)] 
core: change RootImageOptions to use names instead of partition numbers

Follow the designations from the Discoverable Partitions Specification

3 years agocore: use strv_split_colon_pairs when parsing RootImageOptions
Luca Boccassi [Thu, 6 Aug 2020 18:43:22 +0000 (19:43 +0100)] 
core: use strv_split_colon_pairs when parsing RootImageOptions

3 years agocore: cleanup unused variables
Luca Boccassi [Thu, 6 Aug 2020 18:06:22 +0000 (19:06 +0100)] 
core: cleanup unused variables

Leftovers from previous implementation of MountImages feature, unused now

3 years agosd-bus: fix error handling on readv()
Lennart Poettering [Thu, 20 Aug 2020 10:59:23 +0000 (12:59 +0200)] 
sd-bus: fix error handling on readv()

let's make sure we collect the right error code from errno, otherwise
we'll see EPERM (i.e. error 1) for all errors readv() returns (since it
returns -1 on error), including EAGAIN.

This is definitely backport material.

A fix-up for 3691bcf3c5eebdcca5b4f1c51c745441c57a6cd1.

Fixes: #16699
3 years agocore: remove support for ConditionNull= 16803/head
Lennart Poettering [Thu, 20 Aug 2020 12:01:25 +0000 (14:01 +0200)] 
core: remove support for ConditionNull=

The concept is flawed, and mostly useless. Let's finally remove it.

It has been deprecated since 90a2ec10f2d43a8530aae856013518eb567c4039 (6
years ago) and we started to warn since
55dadc5c57ef1379dbc984938d124508a454be55 (1.5 years ago).

Let's get rid of it altogether.

3 years agocore: add missing conditions/asserts to unit file parsing
Lennart Poettering [Thu, 20 Aug 2020 11:44:12 +0000 (13:44 +0200)] 
core: add missing conditions/asserts to unit file parsing

3 years agoanalyze: rework condition testing
Lennart Poettering [Thu, 20 Aug 2020 11:43:00 +0000 (13:43 +0200)] 
analyze: rework condition testing

Let's drop the private table and just use the generic concepts we have
in place already that make the same information available.

Fixes: #16781
3 years agocoding style: document how to break a function declaration
Luca Boccassi [Thu, 20 Aug 2020 11:11:26 +0000 (12:11 +0100)] 
coding style: document how to break a function declaration

3 years agoman: fix xml tags
Lennart Poettering [Thu, 20 Aug 2020 11:11:20 +0000 (13:11 +0200)] 
man: fix xml tags

3 years agoMerge pull request #16221 from bluca/show_microsec
Lennart Poettering [Thu, 20 Aug 2020 11:15:04 +0000 (13:15 +0200)] 
Merge pull request #16221 from bluca/show_microsec

systemctl: add --timestamp to change timestamp print format

3 years agouser-runtime-dir: deal gracefully with missing logind properties
Lennart Poettering [Wed, 19 Aug 2020 15:05:44 +0000 (17:05 +0200)] 
user-runtime-dir: deal gracefully with missing logind properties

Fixes: #16685
3 years agoMerge pull request #16559 from benzea/benzea/memory-recursiveprot
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 11:05:07 +0000 (13:05 +0200)] 
Merge pull request #16559 from benzea/benzea/memory-recursiveprot

mount-setup: Enable memory_recursiveprot for cgroup2

3 years agoMerge pull request #16677 from poettering/statx-mntid
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 08:58:14 +0000 (10:58 +0200)] 
Merge pull request #16677 from poettering/statx-mntid

make use of new kernel 5.8 statx() mount id/mountpoint APIs

3 years agoMerge pull request #16782 from keszybz/seccomp-use-cleanup
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 08:27:55 +0000 (10:27 +0200)] 
Merge pull request #16782 from keszybz/seccomp-use-cleanup

Use less iffedeffery around syscall names and _cleanup_ in one more place

3 years agohwdb: ACCEL_MOUNT_MATRIX for Irbis TW118 (#16786)
brainrom [Thu, 20 Aug 2020 08:23:35 +0000 (13:23 +0500)] 
hwdb: ACCEL_MOUNT_MATRIX for Irbis TW118 (#16786)

This was required to get orientation sensor work properly in my tablet.

3 years agocore: create per-user inaccessible node from the service manager 16543/head
Lennart Poettering [Wed, 19 Aug 2020 15:42:33 +0000 (17:42 +0200)] 
core: create per-user inaccessible node from the service manager

Previously, we'd create them from user-runtime-dir@.service. That has
one benefit: since this service runs privileged, we can create the full
set of device nodes. It has one major drawback though: it security-wise
problematic to create files/directories in directories as privileged
user in directories owned by unprivileged users, since they can use
symlinks to redirect what we want to do. As a general rule we hence
avoid this logic: only unpriv code should populate unpriv directories.

Hence, let's move this code to an appropriate place in the service
manager. This means we lose the inaccessible block device node, but
since there's already a fallback in place, this shouldn't be too bad.

3 years agodoc: document what we now place in /run/host
Lennart Poettering [Fri, 14 Aug 2020 17:49:29 +0000 (19:49 +0200)] 
doc: document what we now place in /run/host

3 years agonspawn: provide $container and $container_uuid in /run/host too
Lennart Poettering [Fri, 14 Aug 2020 17:58:37 +0000 (19:58 +0200)] 
nspawn: provide $container and $container_uuid in /run/host too

This has the major benefit that the entire payload of the container can
access these files there. Previously, we'd set them only as env vars,
but that meant only PID 1 could read them directly or other privileged
payload code with access to /run/1/environ.

3 years agonspawn,pid1: pass "inaccessible" nodes from cntr mgr to pid1 payload via /run/host
Lennart Poettering [Fri, 14 Aug 2020 16:56:54 +0000 (18:56 +0200)] 
nspawn,pid1: pass "inaccessible" nodes from cntr mgr to pid1 payload via /run/host

Let's make /run/host the sole place we pass stuff from host to container
in and place the "inaccessible" nodes in /run/host too.

In contrast to the previous two commits this is a minor compat break, but
not a relevant one I think. Previously the container manager would place
these nodes in /run/systemd/inaccessible/ and that's where PID 1 in the
container would try to add them too when missing. Container manager and
PID 1 in the container would thus manage the same dir together.

With this change the container manager now passes an immutable directory
to the container and leaves /run/systemd entirely untouched, and managed
exclusively by PID 1 inside the container, which is nice to have clear
separation on who manages what.

In order to make sure systemd then usses the /run/host/inaccesible/
nodes this commit changes PID 1 to look for that dir and if it exists
will symlink it to /run/systemd/inaccessible.

Now, this will work fine if new nspawn and new pid 1 in the container
work together. as then the symlink is created and the difference between
the two dirs won't matter.

For the case where an old nspawn invokes a new PID 1: in this case
things work as they always worked: the dir is managed together.

For the case where different container manager invokes a new PID 1: in
this case the nodes aren't typically passed in, and PID 1 in the
container will try to create them and will likely fail partially (though
gracefully) when trying to create char/block device nodes. THis is fine
though as there are fallbacks in place for that case.

For the case where a new nspawn invokes an old PID1: this is were the
(minor) incompatibily happens: in this case new nspawn will place the
nodes in the /run/host/inaccessible/ subdir, but the PID 1 in the
container won't look for them there. Since the nodes are also not
pre-created in /run/systed/inaccessible/ PID 1 will try to create them
there as if a different container manager sets them up. This is of
course not sexy, but is not a total loss, since as mentioned fallbacks
are in place anyway. Hence I think it's OK to accept this minor
incompatibility.

3 years agonspawn: move $NOTIFY_SOCKET into /run/host/ too
Lennart Poettering [Wed, 22 Jul 2020 16:00:18 +0000 (18:00 +0200)] 
nspawn: move $NOTIFY_SOCKET into /run/host/ too

The sd_notify() socket that nspawn binds that the payload can use to
talk to it was previously stored in /run/systemd/nspawn/notify, which is
weird (as in the previous commit) since this makes /run/systemd
something that is cooperatively maintained by systemd inside the
container and nspawn outside of it.

We now have a better place where container managers can put the stuff
they want to pass to the payload: /run/host/, hence let's make use of
that.

This is not a compat breakage, since the sd_notify() protocol is based
on the $NOTIFY_SOCKET env var, where we place the new socket path.

3 years agonspawn/machine: move mount propagation dir to /run/host/incoming
Lennart Poettering [Wed, 22 Jul 2020 15:57:29 +0000 (17:57 +0200)] 
nspawn/machine: move mount propagation dir to /run/host/incoming

Previously we'd use a directory /run/systemd/nspawn/incoming for
accepting mounts to propagate from the host. This is a bit weird, since
we have a shared namespace: /run/systemd/ contains both stuff managed by
the surround nspawn as well as from the systemd inside.

We now have the /run/host/ hierarchy that has special stuff we want to
pass from host to container. Let's make use of that here, and move this
directory here too.

This is not a compat breakage, since the payload never interfaces with
that directory natively: it's only nspawn and machined that need to
agree on it.

3 years agoMerge pull request #16790 from poettering/core-if-block-merge
Zbigniew Jędrzejewski-Szmek [Thu, 20 Aug 2020 08:15:01 +0000 (10:15 +0200)] 
Merge pull request #16790 from poettering/core-if-block-merge

core: merge a few if blocks

3 years agobasic/virt: treat "pouch" as a container type (id: pouch)
Wen Yang [Wed, 19 Aug 2020 11:47:03 +0000 (19:47 +0800)] 
basic/virt: treat "pouch" as a container type (id: pouch)

3 years agoMerge pull request #16792 from poettering/machine-id-chroot
Anita Zhang [Thu, 20 Aug 2020 06:21:56 +0000 (23:21 -0700)] 
Merge pull request #16792 from poettering/machine-id-chroot

machine-id-setup: don't use KVM or container manager supplied uuid if…

3 years agoMerge pull request #16793 from poettering/path-join-more
Anita Zhang [Thu, 20 Aug 2020 06:12:50 +0000 (23:12 -0700)] 
Merge pull request #16793 from poettering/path-join-more

path-lookup: path_join() all the things!

3 years agoman: Fix typo in systemd-tmpfiles
Phaedrus Leeds [Wed, 19 Aug 2020 16:36:32 +0000 (09:36 -0700)] 
man: Fix typo in systemd-tmpfiles

3 years agopath-lookup: path_join() all the things! 16793/head
Lennart Poettering [Wed, 19 Aug 2020 16:27:52 +0000 (18:27 +0200)] 
path-lookup: path_join() all the things!

When we talk about paths, better use path_join(), who knows what callers
pass to us, i.e. prefixed with "/" or not.

3 years agomachine-id-setup: don't use KVM or container manager supplied uuid if in chroot env 16792/head
Lennart Poettering [Wed, 19 Aug 2020 15:07:41 +0000 (17:07 +0200)] 
machine-id-setup: don't use KVM or container manager supplied uuid if in chroot env

Fixes: #16758
3 years agomount-setup: drop pointless zero initialization 16790/head
Lennart Poettering [Wed, 19 Aug 2020 15:47:32 +0000 (17:47 +0200)] 
mount-setup: drop pointless zero initialization

3 years agocore: merge a few if blocks
Lennart Poettering [Wed, 19 Aug 2020 15:45:33 +0000 (17:45 +0200)] 
core: merge a few if blocks

arg_system == true and getpid() == 1 hold under the very same condition
this early in the main() function (this only changes later when we start
parsing command lines, where arg_system = true is set if users invoke us
in test mode even when getpid() != 1.

Hence, let's simplify things, and merge a couple of if branches and not
pretend they were orthogonal.

3 years agopo: import the .pot file into version control 16789/head
Zbigniew Jędrzejewski-Szmek [Wed, 19 Aug 2020 16:02:22 +0000 (18:02 +0200)] 
po: import the .pot file into version control

Fixes #14531.

3 years agoRevert "gitignore .pot file"
Zbigniew Jędrzejewski-Szmek [Wed, 19 Aug 2020 16:01:07 +0000 (18:01 +0200)] 
Revert "gitignore .pot file"

This reverts commit ee4e9a1090941797d7ed64e23a49ceeba762577c.

It seems we need the .pot file in the repo to allow weblate to import it.

3 years agosystemctl: add --timestamp to change timestamp print format 16221/head
Luca Boccassi [Fri, 19 Jun 2020 10:26:22 +0000 (11:26 +0100)] 
systemctl: add --timestamp to change timestamp print format

Timestamps for unit start/stop are recorded with microsecond granularity,
but status and show truncate to second granularity by default.
Add a --timestamp=pretty|us|utc option to allow including the microseconds
or to use the UTC TZ to all timestamps printed by systemctl.

3 years agobasic/time-util: add function to format timestamps with different styles
Luca Boccassi [Fri, 19 Jun 2020 10:24:09 +0000 (11:24 +0100)] 
basic/time-util: add function to format timestamps with different styles

Instead of a multiple fixed format helper functions, add an enum and
a single helper, so that it's easier to extend in the future.

3 years agohomed: default to "btrfs" as fs type in the LUKS backend
Lennart Poettering [Tue, 18 Aug 2020 13:11:06 +0000 (15:11 +0200)] 
homed: default to "btrfs" as fs type in the LUKS backend

Apparently both Fedora and suse default to btrfs now, it should hence be
good enough for us too.

This enables a bunch of really nice things for us, most importanly we
can resize home directories freely (i.e. both grow *and* shrink) while
online. It also allows us to add nice subvolume based home directory
snapshotting later on.

Also, whenever we mention the three supported types, alaways mention
them in alphabetical order, which is also our new order of preference.

3 years agoMerge pull request #16771 from poettering/dyn-pwq
Lennart Poettering [Wed, 19 Aug 2020 13:40:41 +0000 (15:40 +0200)] 
Merge pull request #16771 from poettering/dyn-pwq

make libpwquality a dlopen() dependency + use it in systemd-firstboot, too

3 years agoMerge pull request #16762 from poettering/homed-fixlets
Zbigniew Jędrzejewski-Szmek [Wed, 19 Aug 2020 09:43:49 +0000 (11:43 +0200)] 
Merge pull request #16762 from poettering/homed-fixlets

homed: five fixlets

3 years agoman: Improve MemoryMin=/MemoryLow= description 16559/head
Benjamin Berg [Fri, 24 Jul 2020 11:17:23 +0000 (13:17 +0200)] 
man: Improve MemoryMin=/MemoryLow= description

The description didn't really explain how the distribution mechanism
works exactly and the relationship of leaf and slice units.

Update the documentation and also explicitly explain the expected
behaviour as it is created by the memory_recursiveprot cgroup2 mount
option.

3 years agomount-setup: Enable memory_recursiveprot for cgroup2
Benjamin Berg [Thu, 23 Jul 2020 10:56:32 +0000 (12:56 +0200)] 
mount-setup: Enable memory_recursiveprot for cgroup2

When available, enable memory_recursiveprot. Realistically it always
makes sense to delegate MemoryLow= and MemoryMin= to all children of a
slice/unit.

The kernel option is not enabled by default as it might cause
regressions in some setups. However, it is the better default in
general, and it results in a more flexible and obvious behaviour.

The alternative to using this option would be for user's to also set
DefaultMemoryLow= on slices when assigning MemoryLow=. However, this
makes the effect of MemoryLow= on some children less obvious, as it
could result in a lower protection rather than increasing it.

From the kernel documentation:

  memory_recursiveprot

        Recursively apply memory.min and memory.low protection to
        entire subtrees, without requiring explicit downward
        propagation into leaf cgroups.  This allows protecting entire
        subtrees from one another, while retaining free competition
        within those subtrees.  This should have been the default
        behavior but is a mount-option to avoid regressing setups
        relying on the original semantics (e.g. specifying bogusly
        high 'bypass' protection values at higher tree levels).

This was added in kernel commit 8a931f801340c (mm: memcontrol:
recursive memory.low protection), which became available in 5.7 and was
subsequently fixed in kernel 5.7.7 (mm: memcontrol: handle div0 crash
race condition in memory.low).

3 years agoshared/seccomp: use _cleanup_ in one more place 16782/head
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 15:06:28 +0000 (17:06 +0200)] 
shared/seccomp: use _cleanup_ in one more place

(cherry picked from commit 27605d6a836d85563faf41db9f7a72883d44c0ff)

3 years agoshared/seccomp: do not use ifdef guards around textual syscall names
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 14:10:47 +0000 (16:10 +0200)] 
shared/seccomp: do not use ifdef guards around textual syscall names

It is possible that we will be running with an upgraded libseccomp, in which
case libseccomp might know the syscall name, even if the number is not known at
the time when systemd is being compiled. The guard only serves to break such
upgrades, by requiring that we also recompile systemd.

For s390-specific syscalls, use a define to exclude them, so that that we don't
try to filter them on other arches.

(cherry picked from commit 6cf852e79eb0eced2f77653941f9c75c3bd79386)

3 years agoMerge pull request #16640 from keszybz/various-patches
Lennart Poettering [Wed, 19 Aug 2020 08:30:45 +0000 (10:30 +0200)] 
Merge pull request #16640 from keszybz/various-patches

Improve systemd-analyze security a bit and other assorted bits

3 years agomeson: add min version for libfdisk
Anita Zhang [Tue, 18 Aug 2020 06:09:38 +0000 (23:09 -0700)] 
meson: add min version for libfdisk

Was trying to run src/partition/test-repart.sh on CentOS 8 and the first
resize call kept failing with ERANGE. Turned out that CentOS 8 comes
with libfdisk-devel-2.32.1 which is missing
https://github.com/karelzak/util-linux/commit/2f35c1ead621f42f32f7777232568cb03185b473
(in libfdisk 2.33 and up).

3 years agoupdate TODO 16677/head
Lennart Poettering [Wed, 5 Aug 2020 22:03:23 +0000 (00:03 +0200)] 
update TODO

3 years agomountpoint-util: use new kernel 5.8 statx() API for determining mount points
Lennart Poettering [Wed, 5 Aug 2020 21:53:42 +0000 (23:53 +0200)] 
mountpoint-util: use new kernel 5.8 statx() API for determining mount points

We finally have an explicit API for this in the kernel. It's great and
simple. Let's use it!

3 years agomountpoint-util: use new kernel 5.8 statx() API for determining mnt_id
Lennart Poettering [Wed, 5 Aug 2020 21:28:21 +0000 (23:28 +0200)] 
mountpoint-util: use new kernel 5.8 statx() API for determining mnt_id

The kernel finally has a proper API to determine the mnt_id of a file.
Let's use it.

This adds support for the STATX_MNT_ID field of statx(), added in
kernel 5.8.

3 years agomountpoint-util: minor modernizations
Lennart Poettering [Wed, 5 Aug 2020 21:28:14 +0000 (23:28 +0200)] 
mountpoint-util: minor modernizations

3 years agoupdate TODO 16771/head
Lennart Poettering [Tue, 18 Aug 2020 08:41:18 +0000 (10:41 +0200)] 
update TODO

3 years agofirstboot: hook up with libpwquality
Lennart Poettering [Tue, 18 Aug 2020 08:37:44 +0000 (10:37 +0200)] 
firstboot: hook up with libpwquality

3 years agohome: make libpwquality dep a runtime dlopen() one
Lennart Poettering [Tue, 18 Aug 2020 07:56:56 +0000 (09:56 +0200)] 
home: make libpwquality dep a runtime dlopen() one

Also, let's move the glue for this to src/shared/ so that we later can
reuse this in sysemd-firstboot.

Given that libpwquality is a more a leaf dependency, let's make it
runtime optional, so that downstream distros can downgrade their package
deps from Required to Recommended.

3 years agoMerge pull request #16780 from alyssais/grammar
Anita Zhang [Wed, 19 Aug 2020 05:41:34 +0000 (22:41 -0700)] 
Merge pull request #16780 from alyssais/grammar

load-fragment: fix grammar in error messages

3 years agoload-fragment: fix grammar in error messages 16780/head
Alyssa Ross [Tue, 18 Aug 2020 20:56:59 +0000 (20:56 +0000)] 
load-fragment: fix grammar in error messages

3 years agoFix function description in logind man page
Nicolas Fella [Tue, 18 Aug 2020 20:36:47 +0000 (22:36 +0200)] 
Fix function description in logind man page

Fix a presumed copy&paste error. SetLockedHint corresponds to the "locked hint", not the "idle hint".

3 years agonetwork: do not fail if UseMTU=yes on DHCP lease lost
Yu Watanabe [Tue, 18 Aug 2020 10:21:25 +0000 (19:21 +0900)] 
network: do not fail if UseMTU=yes on DHCP lease lost

This fixes a bug introduced by 6906794dd1698954b349ec3ec84f1494ecd63cd3.

Fixes #16768.

3 years agoMerge pull request #16687 from DaanDeMeyer/bootloader-machine-id
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 13:05:26 +0000 (15:05 +0200)] 
Merge pull request #16687 from DaanDeMeyer/bootloader-machine-id

Allow bootctl and kernel-install to be called without /etc/machine-id present

3 years agohomework: downgrade chattr failure log message 16762/head
Lennart Poettering [Mon, 17 Aug 2020 20:07:55 +0000 (22:07 +0200)] 
homework: downgrade chattr failure log message

NOCOW is a btrfs-only thing hence don't log louder than necessary if we
don't have it.

3 years agohomework: explicitly close cryptsetup context, to not keep loopback device busy
Lennart Poettering [Mon, 17 Aug 2020 20:09:04 +0000 (22:09 +0200)] 
homework: explicitly close cryptsetup context, to not keep loopback device busy

The cryptsetup context pins the loop device even after deactivation.
Let's explicitly release the context to make sure the subsequent
loopback device detaching works cleanly.

3 years agohomework: correct error passed into log message
Lennart Poettering [Mon, 17 Aug 2020 18:20:47 +0000 (20:20 +0200)] 
homework: correct error passed into log message

3 years agohomework: sync everything to disk before we rename LUKS loopback file into place
Lennart Poettering [Mon, 17 Aug 2020 17:54:38 +0000 (19:54 +0200)] 
homework: sync everything to disk before we rename LUKS loopback file into place

This how this works on Linux: when atomically creating a file we need to
fully populate it under a temporary name and then when we are fully
done, sync it and the directory it is contained in, before renaming it
to the final name.

3 years agohomed: downgrade quota message in containers
Lennart Poettering [Mon, 17 Aug 2020 16:19:30 +0000 (18:19 +0200)] 
homed: downgrade quota message in containers

quota syscalls and operations are typically prohibited in containers.
Let's not make noise about that, needlessly.

3 years agolog: don't explicitly re-open log for failed assertions
Franck Bui [Mon, 3 Aug 2020 15:50:11 +0000 (17:50 +0200)] 
log: don't explicitly re-open log for failed assertions

This was needed before commit 16e4fd87c5be06d2b7a3b368205c8c5bab9df32a added a
mode that opens the log fds for every single log message. This mode is used in
execute.c since then making the explicit call to log_open unnecessary.

This basically reverts ea89a119cda917a17bd186b3c13197acfd655b12.

3 years agoresolve: lift limits on search domains count or length
Dimitri John Ledkov [Fri, 7 Aug 2020 11:47:09 +0000 (12:47 +0100)] 
resolve: lift limits on search domains count or length

glibc 2.26 lifted restrictions on search domains count or length to
unlimited. This has also been backported to 2.17 in some distributions (RHEL 7
and derivatives). Other softwares may have their own limits for search domains,
but we should not restrict what is written out any more.

https://sourceware.org/legacy-ml/libc-announce/2017/msg00001.html

3 years agoMerge pull request #16761 from keszybz/missing-syscall-cleanup
Zbigniew Jędrzejewski-Szmek [Tue, 18 Aug 2020 08:01:19 +0000 (10:01 +0200)] 
Merge pull request #16761 from keszybz/missing-syscall-cleanup

Missing syscall cleanup

3 years agomissing_syscall: do not use function name that may conflict with glibc 16761/head
Zbigniew Jędrzejewski-Szmek [Sun, 16 Aug 2020 14:19:29 +0000 (16:19 +0200)] 
missing_syscall: do not use function name that may conflict with glibc

This was done for all replacements back in 5187dd2c403caf92d09f3491e41f1ceb3f10491f,
but some newer stuff didn't do this.

3 years agomissing_syscall: fix pidfd_{send_signal,open} numbers for alpha
Zbigniew Jędrzejewski-Szmek [Sat, 15 Aug 2020 17:01:23 +0000 (19:01 +0200)] 
missing_syscall: fix pidfd_{send_signal,open} numbers for alpha

Also order the syscalls by syscall number for easier comparisons with the
kernel headers.

Fixup for 5f152f43d04e5aad6a3f98f45f020a66e3aac717.

3 years agomissing_syscall: add forgotten check for __NR_get_mempolicy nonnegativity
Zbigniew Jędrzejewski-Szmek [Sat, 15 Aug 2020 16:54:18 +0000 (18:54 +0200)] 
missing_syscall: add forgotten check for __NR_get_mempolicy nonnegativity

We do it in other cases, we should here too.

Fixup for b070c7c0e13.

3 years agoshared/cgroup-setup: reduce scope of variables 16640/head
Zbigniew Jędrzejewski-Szmek [Fri, 31 Jul 2020 08:49:57 +0000 (10:49 +0200)] 
shared/cgroup-setup: reduce scope of variables

3 years agobasic/utf8: rename parameter
Zbigniew Jędrzejewski-Szmek [Thu, 30 Jul 2020 15:08:39 +0000 (17:08 +0200)] 
basic/utf8: rename parameter

Every time I was using this function I had to check whether "newline"
means that newlines are good or bad.

3 years agobasic/string-util: reduce scope of variables
Zbigniew Jędrzejewski-Szmek [Thu, 30 Jul 2020 15:00:25 +0000 (17:00 +0200)] 
basic/string-util: reduce scope of variables

3 years agojournal: adjust line about when the journal begins and ends
Zbigniew Jędrzejewski-Szmek [Fri, 24 Jul 2020 10:19:08 +0000 (12:19 +0200)] 
journal: adjust line about when the journal begins and ends

This comes up occasionally with new users. The phrase "Logs begin ..." is
ambiguous because it can be taken to mean the logs being displayed or all logs
(the intended meaning). Let's rephrase this as "Journal begins ..." to make
this clearer.

3 years agoanalyze-security: include an actual syscall name in the message
Zbigniew Jędrzejewski-Szmek [Sat, 1 Aug 2020 09:41:57 +0000 (11:41 +0200)] 
analyze-security: include an actual syscall name in the message

This information was already available in the debug output, but I think it
is good to include it in the message in the table. This makes it easier to wrap
one's head around the allowlist/denylist filtering.

3 years agotest: accept that char device 0/0 can now be created witout privileges
Lennart Poettering [Fri, 14 Aug 2020 19:50:55 +0000 (21:50 +0200)] 
test: accept that char device 0/0 can now be created witout privileges

Fixes: #16721
3 years agohwdb: ACCEL_MOUNT_MATRIX quirk for Acer SP111-32*
Grant Mathews [Sun, 16 Aug 2020 19:16:22 +0000 (12:16 -0700)] 
hwdb: ACCEL_MOUNT_MATRIX quirk for Acer SP111-32*

3 years agosocket-netlink: make address argument const
Lennart Poettering [Mon, 17 Aug 2020 08:51:17 +0000 (10:51 +0200)] 
socket-netlink: make address argument const

3 years agoman: move 'files' module in NSS 'hosts:' line before myhostname
Lennart Poettering [Mon, 17 Aug 2020 07:10:32 +0000 (09:10 +0200)] 
man: move 'files' module in NSS 'hosts:' line before myhostname

I am pretty sure /etc/hosts (i.e. an explicitly configured, local,
trusted database) should be useful for overriding the automatic
myhostname logic.

resolved's internal logic handles it that way and hence we should
suggest it in the NSS fallback line, too.

Let's also bring the factory file back into sync with what the docs say.

And update the prose a bit too, to actually match what we recommend.

3 years agotools/make-man-index: fix purpose text that contains tags
Haochen Tong [Sun, 16 Aug 2020 01:28:46 +0000 (03:28 +0200)] 
tools/make-man-index: fix purpose text that contains tags

3 years agotest-fs-util: skip encrypted path test if we get EACCES
Topi Miettinen [Mon, 17 Aug 2020 09:08:57 +0000 (12:08 +0300)] 
test-fs-util: skip encrypted path test if we get EACCES

Unprivileged test-fs-util fails on my system since /sys/dev/block is
inaccessible for unprivileged users, so let's skip encrypted path test if we
get EACCES or similar.

3 years agoREADME: fix indentation
Lennart Poettering [Sun, 16 Aug 2020 16:25:18 +0000 (18:25 +0200)] 
README: fix indentation

All paragraphs are indented to 8 spaces, but one. Fix that.

3 years agoupdate TODO
Lennart Poettering [Mon, 17 Aug 2020 07:10:15 +0000 (09:10 +0200)] 
update TODO

3 years agoNewer Glibc use faccessat2 to implement faccessat
Michael Scherer [Sat, 15 Aug 2020 16:12:02 +0000 (18:12 +0200)] 
Newer Glibc use faccessat2 to implement faccessat

cf https://repo.or.cz/glibc.git/commit/3d3ab573a5f3071992cbc4f57d50d1d29d55bde2

This cause breakage on Fedora Rawhide: https://bugzilla.redhat.com/show_bug.cgi?id=1869030