]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotest: collect the coverage _before_ unmounting the rootfs
Frantisek Sumsal [Thu, 21 Oct 2021 16:12:06 +0000 (18:12 +0200)] 
test: collect the coverage _before_ unmounting the rootfs

d'oh!

2 years agotest: loosen sandbox restrictions for integration tests as well
Frantisek Sumsal [Thu, 21 Oct 2021 16:06:36 +0000 (18:06 +0200)] 
test: loosen sandbox restrictions for integration tests as well

Otherwise we miss quite a lot of coverage (mainly from logind,
hostnamed, networkd, and possibly others), since they can't write their
reports with `ProtectSystem=strict`.

2 years agotest: loosen certain sandbox restrictions when collecting coverage
Frantisek Sumsal [Thu, 21 Oct 2021 15:34:43 +0000 (17:34 +0200)] 
test: loosen certain sandbox restrictions when collecting coverage

With `ProtectSystem=strict` gcov is unable to write the *.gcda files
with collected coverage. Let's add a yet another switch to make such
restriction less strict to make gcov happy.

This addresses following errors:
```
...
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/binfmt-util.c.gcda:Cannot open
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/base-filesystem.c.gcda:Cannot open
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/barrier.c.gcda:Cannot open
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/ask-password-api.c.gcda:Cannot open
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/apparmor-util.c.gcda:Cannot open
systemd-networkd[272469]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-249.a.p/acpi-fpdt.c.gcda:Cannot open
...
```

2 years agotest: wait a bit for the given PID to die if it's still alive
Frantisek Sumsal [Thu, 21 Oct 2021 13:59:57 +0000 (15:59 +0200)] 
test: wait a bit for the given PID to die if it's still alive

When playing around with the coverage-enabled build I kept hitting
an issue where dnsmasq failed to start because the previous instance was
still shutting down. This should, hopefully, help to mitigate that.

2 years agoMerge pull request #21065 from keszybz/efi-warnings
Zbigniew Jędrzejewski-Szmek [Thu, 21 Oct 2021 06:33:08 +0000 (08:33 +0200)] 
Merge pull request #21065 from keszybz/efi-warnings

Clean up unused variables in efi code

2 years agonetwork: drop unnecessary header inclusion
Yu Watanabe [Wed, 20 Oct 2021 19:26:56 +0000 (04:26 +0900)] 
network: drop unnecessary header inclusion

2 years agoCI: disable code coverage in GH Action
Luca Boccassi [Wed, 20 Oct 2021 21:10:56 +0000 (22:10 +0100)] 
CI: disable code coverage in GH Action

It is now ran on the nightly CentOS build, so that it can cover
integration tests too, and not just unit tests. It's nightly as
it considerably increases the integration test runtime, so it's
not appropriate for all PRs.

2 years agotest: don't install test-network-generator-conversion.sh w/o networkd
Frantisek Sumsal [Wed, 20 Oct 2021 17:43:34 +0000 (19:43 +0200)] 
test: don't install test-network-generator-conversion.sh w/o networkd

otherwise TEST-02 will fail:

```
=== Failed test log ===
--- test-network-generator-conversion.sh begin ---
+ [[ -n '' ]]
+ [[ -x /usr/lib/systemd/systemd-network-generator ]]
+ [[ -x /lib/systemd/systemd-network-generator ]]
+ exit 1
--- test-network-generator-conversion.sh end ---
```

Before:
```
$ meson build -Dnetworkd=false -Dinstall-tests=true
$ ninja -C build
$ DESTDIR=$PWD/test-install ninja -C build install
$ find test-install/ -name test-network-generator-conversion.sh
test-install/usr/lib/systemd/tests/test-network-generator-conversion.sh
```

After:
```
$ find test-install/ -name test-network-generator-conversion.sh
<no output>
```

2 years agotest: collect coverage in a couple more codepaths
Frantisek Sumsal [Wed, 20 Oct 2021 11:00:37 +0000 (13:00 +0200)] 
test: collect coverage in a couple more codepaths

Otherwise we'd miss coverage from TEST-{02,24,61}, since they don't go
through the "standard" `check_result_common` hook.

Follow-up to 7bf20e48bd7d641a39a14a7feb749b7e8b0fc0f6.

2 years agozsh-completion: nspawn: add --suppress-sync option
Yu Watanabe [Wed, 20 Oct 2021 13:44:35 +0000 (22:44 +0900)] 
zsh-completion: nspawn: add --suppress-sync option

Follow-up for 4a4654e0241fbeabecb8587fd3520b6b39264b9c.

2 years agoMerge pull request #21051 from poettering/nspawn-no-sync
Yu Watanabe [Wed, 20 Oct 2021 13:42:43 +0000 (22:42 +0900)] 
Merge pull request #21051 from poettering/nspawn-no-sync

nspawn: add --suppress-sync=yes mode for turning sync() and friends i…

2 years agoMerge pull request #21055 from yuwata/network-dhcp6-pd-route-lifetime-metric
Luca Boccassi [Wed, 20 Oct 2021 13:38:03 +0000 (14:38 +0100)] 
Merge pull request #21055 from yuwata/network-dhcp6-pd-route-lifetime-metric

network: dhcp6pd: set lifetime and route metric

2 years agoMerge pull request #21061 from poettering/direct-io-loopback-tweaks
Yu Watanabe [Wed, 20 Oct 2021 13:21:30 +0000 (22:21 +0900)] 
Merge pull request #21061 from poettering/direct-io-loopback-tweaks

tweaks to O_DIRECT loop work

2 years agoTypos found by codespell
Dimitri Papadopoulos [Wed, 20 Oct 2021 07:38:57 +0000 (09:38 +0200)] 
Typos found by codespell

2 years agoefi: check input parameter 21065/head
Zbigniew Jędrzejewski-Szmek [Wed, 20 Oct 2021 11:57:38 +0000 (13:57 +0200)] 
efi: check input parameter

clang complained about an unused variable. We cast the buffer to
struct boot_params, so let's check that it's at least this long.

2 years agoefi: drop two unused variables
Zbigniew Jędrzejewski-Szmek [Wed, 20 Oct 2021 11:53:27 +0000 (13:53 +0200)] 
efi: drop two unused variables

It seems the code was added in 2553a5482c77980429565d14662f309e385bd472 and
those two were never used for anything.

2 years agonspawn: add --suppress-sync=yes mode for turning sync() and friends into NOPs via... 21051/head
Lennart Poettering [Tue, 19 Oct 2021 12:56:49 +0000 (14:56 +0200)] 
nspawn: add --suppress-sync=yes mode for turning sync() and friends into NOPs via seccomp

This is supposed to be used by package/image builders such as mkosi to
speed up building, since it allows us to suppress sync() inside a
container.

This does what Debian's eatmydata tool does, but for a container, and
via seccomp (instead of LD_PRELOAD).

2 years agoloop-util: call loop_device_make_internal() at the right place 21061/head
Lennart Poettering [Wed, 20 Oct 2021 07:57:16 +0000 (09:57 +0200)] 
loop-util: call loop_device_make_internal() at the right place

The whole reason loop_device_make_internal() exists (as opposed to just
loop_device_make()) is to avoid mangling the loop flags value/call
getenv twice. Hence let's actually call it when we already mangled the
flags value.

2 years agoloop-util: add debug logging about O_RDWR vs. O_RDONLY + O_DIRECT mode
Lennart Poettering [Wed, 20 Oct 2021 07:56:20 +0000 (09:56 +0200)] 
loop-util: add debug logging about O_RDWR vs. O_RDONLY + O_DIRECT mode

Once we managed to open the file let's log what we wanted and what we
got.

2 years agoloop-util: minor coding style updates
Lennart Poettering [Wed, 20 Oct 2021 07:55:33 +0000 (09:55 +0200)] 
loop-util: minor coding style updates

As suggested here: https://github.com/systemd/systemd/pull/21044#pullrequestreview-783530343

2 years agoMerge pull request #21041 from yuwata/network-bpf-neighbor
Yu Watanabe [Wed, 20 Oct 2021 04:30:32 +0000 (13:30 +0900)] 
Merge pull request #21041 from yuwata/network-bpf-neighbor

network: introduce BPF to reject netlink messages about non-static neighbor

2 years agoMerge pull request #21056 from yuwata/test-network-cleanups
Yu Watanabe [Wed, 20 Oct 2021 04:29:45 +0000 (13:29 +0900)] 
Merge pull request #21056 from yuwata/test-network-cleanups

test-network: several cleanups related to dnsmasq

2 years agotest-network: cleanup dnsmasq related file on setup 21056/head
Yu Watanabe [Thu, 14 Oct 2021 17:00:27 +0000 (02:00 +0900)] 
test-network: cleanup dnsmasq related file on setup

Just for safety.

2 years agotest-network: drop pid_file argument from stop_dnsmasq()
Yu Watanabe [Thu, 14 Oct 2021 16:54:11 +0000 (01:54 +0900)] 
test-network: drop pid_file argument from stop_dnsmasq()

2 years agotest-network: use constant variables in dnsmasq command
Yu Watanabe [Thu, 14 Oct 2021 16:36:08 +0000 (01:36 +0900)] 
test-network: use constant variables in dnsmasq command

2 years agonetwork: dhcp6pd: set default metric 256 for delegated prefix 21055/head
Yu Watanabe [Thu, 14 Oct 2021 20:57:30 +0000 (05:57 +0900)] 
network: dhcp6pd: set default metric 256 for delegated prefix

When Assign= in [DHCPv6PrefixDelegation] is enabled, then the kernel
will create the prefix route for the assigned address with metric 256.
When Assign= is disabled, then the kernel will create the route with
metric 1024.

For the default value, we should choose a smaller value (higher priority)
than 1024, as the unreachable routes for delegated prefix will be
configured with 1024.

2 years agonetwork: dhcp6: explicitly specify metric for unreachable route
Yu Watanabe [Thu, 14 Oct 2021 21:00:22 +0000 (06:00 +0900)] 
network: dhcp6: explicitly specify metric for unreachable route

For static IPv6 routes without metric is specified, then we use 1024.
But such an adjustment is not performed to dynamic routes. So, let's
specify the metric explicitly.
Otherwise, configured routes will be handled as foreign.

2 years agonetwork: dhcp6pd: set lifetime to routes for assigned prefixes
Yu Watanabe [Thu, 14 Oct 2021 19:21:21 +0000 (04:21 +0900)] 
network: dhcp6pd: set lifetime to routes for assigned prefixes

Note that the kernel (at least 5.14.11) seems not to support lifetime
for IPv6 unreachable routes. The lifetime for routes of the type will be
handled by sd-event's timer event source.
So, we cannot confirm the lifetime with 'ip route' command.

2 years agosd-dhcp6-client: introduce sd_dhcp6_lease_get_timestamp()
Yu Watanabe [Thu, 14 Oct 2021 19:19:59 +0000 (04:19 +0900)] 
sd-dhcp6-client: introduce sd_dhcp6_lease_get_timestamp()

2 years agoMerge pull request #21035 from yuwata/network-route-fix-lifetime
Yu Watanabe [Tue, 19 Oct 2021 16:48:44 +0000 (01:48 +0900)] 
Merge pull request #21035 from yuwata/network-route-fix-lifetime

network: route: drop kernel version check

2 years agoMerge pull request #21044 from poettering/loopback-direct-io
Lennart Poettering [Tue, 19 Oct 2021 16:42:25 +0000 (18:42 +0200)] 
Merge pull request #21044 from poettering/loopback-direct-io

loop-util: enable LO_FLAGS_DIRECT_IO by default on loopback devices

2 years agoCI: disable opensuse mkosi CI
Daan De Meyer [Tue, 19 Oct 2021 13:54:07 +0000 (14:54 +0100)] 
CI: disable opensuse mkosi CI

Until https://github.com/systemd/systemd/issues/21019 is fixed,
there's no point in running the opensuse CI job so let's disable
it for now.

2 years agoloop-util: work around cache invalidation bug in older kernels 21044/head
Lennart Poettering [Mon, 18 Oct 2021 20:34:54 +0000 (22:34 +0200)] 
loop-util: work around cache invalidation bug in older kernels

Inspired by the discussions in #21003.

Inspired in particular by what Android apexd does:

https://android.googlesource.com/platform/system/apex/+/refs/heads/master/apexd/apexd_loop.cpp

2 years agoloop-util: enable LO_FLAGS_DIRECT_IO by default on loopback devices
Lennart Poettering [Mon, 18 Oct 2021 15:23:30 +0000 (17:23 +0200)] 
loop-util: enable LO_FLAGS_DIRECT_IO by default on loopback devices

Fixes: #21003
2 years agonetwork: introduce BPF to reject netlink messages about non-static neighbor 21041/head
Yu Watanabe [Mon, 18 Oct 2021 18:55:24 +0000 (03:55 +0900)] 
network: introduce BPF to reject netlink messages about non-static neighbor

Fixes #21031.

2 years agosd-netlink: introduce sd_netlink_attach_filter()
Yu Watanabe [Mon, 18 Oct 2021 17:41:38 +0000 (02:41 +0900)] 
sd-netlink: introduce sd_netlink_attach_filter()

2 years agonetwork: route: drop kernel version check for route expiration 21035/head
Yu Watanabe [Fri, 15 Oct 2021 01:07:57 +0000 (10:07 +0900)] 
network: route: drop kernel version check for route expiration

Even in newer kernel version, it seems that some route type does not
support expiration, e.g. IPv4 route or unreachable route. Let's use
timer event source for such routes.

2 years agoMerge pull request #20905 from medhefgo/boot-cleanup
Lennart Poettering [Tue, 19 Oct 2021 08:23:12 +0000 (10:23 +0200)] 
Merge pull request #20905 from medhefgo/boot-cleanup

sd-boot: Code cleanups

2 years agoMerge pull request #20988 from DaanDeMeyer/rotate-reason
Zbigniew Jędrzejewski-Szmek [Tue, 19 Oct 2021 07:53:31 +0000 (09:53 +0200)] 
Merge pull request #20988 from DaanDeMeyer/rotate-reason

journal: Improve rotation logging

2 years agoMerge pull request #21037 from yuwata/network-dhcp6-pd-simplify-distribute
Zbigniew Jędrzejewski-Szmek [Tue, 19 Oct 2021 07:24:38 +0000 (09:24 +0200)] 
Merge pull request #21037 from yuwata/network-dhcp6-pd-simplify-distribute

network: dhcp6-pd: simplify dhcp6_pd_prefix_distribute()

2 years agoMerge pull request #21036 from yuwata/network-dhcp6-pd-manage-prefix-with-hashmap
Zbigniew Jędrzejewski-Szmek [Tue, 19 Oct 2021 07:22:32 +0000 (09:22 +0200)] 
Merge pull request #21036 from yuwata/network-dhcp6-pd-manage-prefix-with-hashmap

network: dhcp6-pd: manage prefix with hashmap

2 years agoutmp: remove /dev from line
Vincent Bernat [Mon, 18 Oct 2021 18:58:43 +0000 (20:58 +0200)] 
utmp: remove /dev from line

utmp(5) says `ut_line` is the device name minus the leading "/dev/". Therefore,
remove it. Without that, when using UtmpMode=user, we get `/dev/tty` in the
output of `last`/`w`.

2 years agoMerge pull request #21038 from yuwata/network-dhcp6-pd-fix-address-check
Zbigniew Jędrzejewski-Szmek [Tue, 19 Oct 2021 07:16:09 +0000 (09:16 +0200)] 
Merge pull request #21038 from yuwata/network-dhcp6-pd-fix-address-check

network: dhcp6-pd: fix address check

2 years agonetwork: neighbor: fix log message
Yu Watanabe [Tue, 19 Oct 2021 03:58:06 +0000 (12:58 +0900)] 
network: neighbor: fix log message

2 years agomeson: use partial_dependency() to get include directory
Alexander Kanavin [Mon, 18 Oct 2021 08:13:07 +0000 (10:13 +0200)] 
meson: use partial_dependency() to get include directory

Getting the variable directly from pkg-config (without
adding the sysroot prefix) is prone to host contamination
when building in sysroots as the compiler starts looking for the
headers on the host in addition to the sysroot.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
2 years agotree-wide: use AF_NETLINK instead of PF_NETLINK
Yu Watanabe [Mon, 18 Oct 2021 16:49:53 +0000 (01:49 +0900)] 
tree-wide: use AF_NETLINK instead of PF_NETLINK

2 years agoMerge pull request #21034 from poettering/homed-password-cache-tweaks
Lennart Poettering [Mon, 18 Oct 2021 20:46:16 +0000 (22:46 +0200)] 
Merge pull request #21034 from poettering/homed-password-cache-tweaks

homed: minor tweaks to the PasswordCache logic

2 years agoMerge pull request #21028 from poettering/watchdog-fixlets
Lennart Poettering [Mon, 18 Oct 2021 20:45:44 +0000 (22:45 +0200)] 
Merge pull request #21028 from poettering/watchdog-fixlets

pid1: various small watchdog tweaks and fixes

2 years agohomework: move allocation/destruction into outer/generic scope
Lennart Poettering [Mon, 18 Oct 2021 11:59:29 +0000 (13:59 +0200)] 
homework: move allocation/destruction into outer/generic scope

Previously in most cases we'd allocate the HomeSetup context object
in generic code in homework.c. But for some cases we allocated them
instead inside the specific code in homework-{cifs,directory,luks}.c
Let's clean that up, and systematically allocate it in the outer
"entrypoint" calls in homework.c instead of the inner ones.

This doesn't change much in behaviour (i.e. it just means when something
fails we'll now clean it up one stack frame further up). But it will
allow is to more easily work with the context objects, since we'll have
them around in all stack frames.

2 years agohomework: unify code that opens the backing image file in open_image_file()
Lennart Poettering [Thu, 14 Oct 2021 13:43:08 +0000 (15:43 +0200)] 
homework: unify code that opens the backing image file in open_image_file()

Also, reuse an already opened image file if we have one.

2 years agonetwork: route: fix possible overflow in conversion usec_t -> uint32_t
Yu Watanabe [Fri, 15 Oct 2021 01:06:25 +0000 (10:06 +0900)] 
network: route: fix possible overflow in conversion usec_t -> uint32_t

2 years agonetwork: dhcp6: use IPv6 specific functions 21036/head
Yu Watanabe [Wed, 13 Oct 2021 18:22:30 +0000 (03:22 +0900)] 
network: dhcp6: use IPv6 specific functions

2 years agonetwork: dhcp6: manage assigned downstream prefixes by using Hashmap
Yu Watanabe [Wed, 13 Oct 2021 18:10:31 +0000 (03:10 +0900)] 
network: dhcp6: manage assigned downstream prefixes by using Hashmap

When a system has thousands of downstream interfaces, previously the
total cost of finding free subnet ID was O(n^2), where n is the number
of downstream interfaces.

This makes assigned prefixes are managed by Manager with Hashmap. So,
the cost becomes O(n log n).

2 years agonetwork: dhcp6: shorten code a bit 21037/head
Yu Watanabe [Wed, 13 Oct 2021 17:57:10 +0000 (02:57 +0900)] 
network: dhcp6: shorten code a bit

2 years agonetwork: dhcp6: always assign prefix through dhcp6_pd_assign_prefix()
Yu Watanabe [Wed, 13 Oct 2021 17:54:20 +0000 (02:54 +0900)] 
network: dhcp6: always assign prefix through dhcp6_pd_assign_prefix()

For uplink interface, we request Assign= is enabled in the above.
So, we can always use dhcp6_pd_assign_prefix().

Just a minor simplification for later commits.

2 years agonetwork: dhcp6pd: check if address is ready only when Assign=yes 21038/head
Yu Watanabe [Thu, 14 Oct 2021 20:37:18 +0000 (05:37 +0900)] 
network: dhcp6pd: check if address is ready only when Assign=yes

2 years agonetwork: add missing DHCPv6PD address check
Yu Watanabe [Thu, 14 Oct 2021 17:53:52 +0000 (02:53 +0900)] 
network: add missing DHCPv6PD address check

2 years agojournal: Expand rotate log messages in journald 20988/head
Daan De Meyer [Tue, 12 Oct 2021 10:20:59 +0000 (11:20 +0100)] 
journal: Expand rotate log messages in journald

Make sure we always log when we rotate journals and always do so at
least at INFO log level. Doing so we make sure there's always a clear
reason available explaining why we rotated a journal.

2 years agojournal: Add two more log messages to journal_file_rotate_suggested()
Daan De Meyer [Tue, 12 Oct 2021 10:03:44 +0000 (11:03 +0100)] 
journal: Add two more log messages to journal_file_rotate_suggested()

This ensures every reason for rotation has an associated log message.

2 years agodocs: Fix value for "processId" in HACKING doc
Daan De Meyer [Mon, 18 Oct 2021 12:29:15 +0000 (14:29 +0200)] 
docs: Fix value for "processId" in HACKING doc

This needs to be pickRemoteProcess to make sure the UI shows
the PIDs of processes in the mkosi container instead of processes
on the host system.

2 years agohomework: mae sure PasswordCache is really optional 21034/head
Lennart Poettering [Mon, 18 Oct 2021 13:31:10 +0000 (15:31 +0200)] 
homework: mae sure PasswordCache is really optional

It was supposed to be optional (i.e. there's a reason why we never
assert()ed on it), and in many codepaths it is, let's make sure it is
everywhere.

2 years agohomework: make PasswordCache const wherever we can
Lennart Poettering [Mon, 18 Oct 2021 12:58:36 +0000 (14:58 +0200)] 
homework: make PasswordCache const wherever we can

2 years agojournal: Add log level argument to journal_file_rotate_suggested()
Daan De Meyer [Tue, 12 Oct 2021 10:00:00 +0000 (11:00 +0100)] 
journal: Add log level argument to journal_file_rotate_suggested()

When journald is rotating a file, we'd like to log the reason at
LOG_INFO or higher instead of LOG_DEBUG. For journalctl --header,
logging the reason at a level higher than LOG_DEBUG doesn't really
make sense. To accomodate both use cases, make the log level used
by journal_file_rotate_suggested() configurable.

2 years agoMerge pull request #21026 from keszybz/licensing-info-for-generated-files
Luca Boccassi [Mon, 18 Oct 2021 12:08:36 +0000 (13:08 +0100)] 
Merge pull request #21026 from keszybz/licensing-info-for-generated-files

Licensing info for generated files

2 years agowatchdog: fix fd validity check 21028/head
Lennart Poettering [Mon, 18 Oct 2021 09:26:58 +0000 (11:26 +0200)] 
watchdog: fix fd validity check

2 years agowatchdog: drop unnecessary variable
Lennart Poettering [Mon, 18 Oct 2021 09:26:49 +0000 (11:26 +0200)] 
watchdog: drop unnecessary variable

2 years agowatchdog: always prefer /dev/watchdog0 over /dev/watchdog
Lennart Poettering [Mon, 18 Oct 2021 09:21:42 +0000 (11:21 +0200)] 
watchdog: always prefer /dev/watchdog0 over /dev/watchdog

2 years agowatchdog: fix error code handling
Lennart Poettering [Mon, 18 Oct 2021 09:17:11 +0000 (11:17 +0200)] 
watchdog: fix error code handling

2 years agodocs: mark spdx headers with the default license to website files 21026/head
Zbigniew Jędrzejewski-Szmek [Mon, 18 Oct 2021 06:56:45 +0000 (08:56 +0200)] 
docs: mark spdx headers with the default license to website files

Those were added in b41a3f66c97e3d861faed04b727daf929383b827 without
an explicit license, so they are under the default license. Some files
already got a header previously, so this only touches the remaining.

The same should be done for docs/_data/extra_pages.json, but it's json, and
json doesn't allow comments.

2 years agolicensing: add a license file for the fonts we carry
Zbigniew Jędrzejewski-Szmek [Mon, 18 Oct 2021 06:40:04 +0000 (08:40 +0200)] 
licensing: add a license file for the fonts we carry

2 years agofuzz-fido-id-desc: drop unused case file
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 18:24:10 +0000 (20:24 +0200)] 
fuzz-fido-id-desc: drop unused case file

It wasn't picked up automatically because it's not in
test/fuzz/fuzz-fido-id-desc/. But looking at the contents, it doesn't seem to
be in the expected input format either.

2 years agoTEST-06-SELINUX: add the usual spdx license header to policy files
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 18:09:09 +0000 (20:09 +0200)] 
TEST-06-SELINUX: add the usual spdx license header to policy files

2 years agogitattributes: introduce and use "generated" attribute
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 17:49:15 +0000 (19:49 +0200)] 
gitattributes: introduce and use "generated" attribute

I want to mark some files to be ignored for licensing purposes,
e.g. output from fuzzers and other samples. By using the gitattribute
machinery for this we don't need to design a custom protocol:

$ git check-attr generated test/test-sysusers/unhappy-*
test/test-sysusers/unhappy-1.expected-err: generated: set
test/test-sysusers/unhappy-1.input: generated: unspecified
test/test-sysusers/unhappy-2.expected-err: generated: set
test/test-sysusers/unhappy-2.input: generated: unspecified
test/test-sysusers/unhappy-3.expected-err: generated: set
test/test-sysusers/unhappy-3.input: generated: unspecified

2 years agogitattributes: mark more files as "binary"
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 17:44:47 +0000 (19:44 +0200)] 
gitattributes: mark more files as "binary"

This way we know that we shouldn't look for a spdx header in them.

2 years agotests: use !/usr/bin/env bash consistently
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 16:14:58 +0000 (18:14 +0200)] 
tests: use !/usr/bin/env bash consistently

This adjustment was last done in f96bc66901ecbcf7ecb280d9442fd0cc92e67186,
but it seems some files were missed and some were added later.

2 years agotests: add spdx headers to scripts and Makefiles
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 16:13:06 +0000 (18:13 +0200)] 
tests: add spdx headers to scripts and Makefiles

2 years agotests: add spdx license header to test unit/link/network/conf files
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 16:07:22 +0000 (18:07 +0200)] 
tests: add spdx license header to test unit/link/network/conf files

Those are all consumed by our parser, so they all support comments.
I was considering whether they should have a license header at all,
but in the end I decided to add it because those files are often created
by copying parts of real unit files. And if the real ones have a license,
then those might as well. It's easier to add it than to make an exception.

2 years agobpf: fix SPDX short identifier for LGPL-2.1-or-later
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 15:03:45 +0000 (17:03 +0200)] 
bpf: fix SPDX short identifier for LGPL-2.1-or-later

2 years agolicensing: add two missing spdx headers
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 07:46:19 +0000 (09:46 +0200)] 
licensing: add two missing spdx headers

Both files were developed in our tree, so they are under the default license.

2 years agogitattributes: mark fuzz inputs that are pure binary as such
Zbigniew Jędrzejewski-Szmek [Sat, 16 Oct 2021 16:19:19 +0000 (18:19 +0200)] 
gitattributes: mark fuzz inputs that are pure binary as such

We also have a bunch of files that have some bytes and a lot
of text, like the journal export format. For those, it is still quite
useful when the tools try to diff them, so let's not mark those.

2 years agohomed: replace "already_activated" boolean parameter by a flags value
Lennart Poettering [Sun, 17 Oct 2021 07:42:15 +0000 (09:42 +0200)] 
homed: replace "already_activated" boolean parameter by a flags value

This is mostly preparation for further defined flags to be added in
later PRs/commits.

No change in behaviour just the flagsification.

2 years agomacro: Move ALIGN_TO to macro-fundamental.h and introduce CONST_ALIGN_TO 20905/head
Jan Janssen [Wed, 6 Oct 2021 08:21:42 +0000 (10:21 +0200)] 
macro: Move ALIGN_TO to macro-fundamental.h and introduce CONST_ALIGN_TO

2 years agosd-boot: Require gnu-efi 3.0.5
Jan Janssen [Thu, 30 Sep 2021 10:51:32 +0000 (12:51 +0200)] 
sd-boot: Require gnu-efi 3.0.5

This version is from 2017 and should be stale enough to not cause
an outrage. All the relevant distros have it or a newer version.

We also already depend on some symbols defined in 3.0.5 anyway,
so let's take the opportunity to reduce our missing_efi.h
baggage.

2 years agosd-boot: Get rid of uefi_call_wrapper
Jan Janssen [Thu, 30 Sep 2021 10:11:56 +0000 (12:11 +0200)] 
sd-boot: Get rid of uefi_call_wrapper

The uefi_call_wrapper exists to convert to the right calling convention
and presumably predates compilers that can do so natively. The only
architecture where this is even needed is x86_64.
But because we are building with GNU_EFI_USE_MS_ABI defined, the
EFIAPI macro tells the compiler to use the right calling convention
for EFI functions. Our shim callback (which is called by EFI itself)
already relies on this.

This also adds a safety check to make se we are compiling with
GNU_EFI_USE_MS_ABI defined and also adds it to the compiler args
unconditionally. It is only used with x86_64 anyways, so it should
be fine to do so. EFI_FUNCTION_WRAPPER is unused in gnu-efi, so
it is dropped.

2 years agosd-boot: Convert VOID -> void
Jan Janssen [Thu, 30 Sep 2021 09:17:22 +0000 (11:17 +0200)] 
sd-boot: Convert VOID -> void

We are already using void in several places and having a screaming
typedef for void feels pointless. There are also CONST, IN, OUT
and OPTIONAL which we aren't using either.

This leaves missing_efi.h to keep it in line with how they are
defined in gnu-efi and/or the specs.

2 years agosd-boot: Rework print_status()
Jan Janssen [Thu, 30 Sep 2021 07:46:55 +0000 (09:46 +0200)] 
sd-boot: Rework print_status()

A little helper function and some unusual formatting makes this
whole thing a lot easier on the eyes. Also, right-aligning the
properties for better readability at runtime.

2 years agosd-boot: Rearm the watchdog in console_key_read
Jan Janssen [Tue, 28 Sep 2021 08:57:06 +0000 (10:57 +0200)] 
sd-boot: Rearm the watchdog in console_key_read

Let's not disable the watchdog at all and instead rearm it inside
of console_key_read(). This way, we are covered by the watchdog everywhere.

2 years agosd-boot: Check for OOM in some places
Jan Janssen [Tue, 28 Sep 2021 08:21:42 +0000 (10:21 +0200)] 
sd-boot: Check for OOM in some places

2 years agoMerge pull request #21013 from mxre/feature/stub-dtb
Lennart Poettering [Sun, 17 Oct 2021 09:27:03 +0000 (11:27 +0200)] 
Merge pull request #21013 from mxre/feature/stub-dtb

[sd-stub] add support for embedding devicetree

2 years agoMerge pull request #21023 from poettering/home-prepare-rename
Yu Watanabe [Sat, 16 Oct 2021 19:32:07 +0000 (04:32 +0900)] 
Merge pull request #21023 from poettering/home-prepare-rename

homed: rename some functions

2 years agohomed: rename home_setup_undo() → home_setup_done() 21023/head
Lennart Poettering [Sat, 16 Oct 2021 12:45:42 +0000 (14:45 +0200)] 
homed: rename home_setup_undo() → home_setup_done()

This function is a destructor, hence it should be named like one.

(We usually use xyz_free() for a destructor that frees the object passed
itself. xyz_unref() we typically use for destructors that are similar,
but ref counted. xyz_done() usually is used for destructors which free
the members of an object, but not the object itself – to allow stack
allocation of objects. We don't strictly follow this, but it's good to
stick to rules wherever we can.)

No actual code change, just renaming.

2 years agohomed: rename home_prepare*() → home_setup*()
Lennart Poettering [Wed, 13 Oct 2021 20:24:24 +0000 (22:24 +0200)] 
homed: rename home_prepare*() → home_setup*()

These set of functions are constructors for an object called HomeSetup,
which has a destructor home_setup_undo(), hence to be reasonably
symmetric, let's call it home_setup*() too, instead of using a new verb
"prepare" for its name.

No actual code changes, just some renaming.

2 years agopo: add a false positive to POTFILES.skip
Piotr Drąg [Sat, 16 Oct 2021 11:59:20 +0000 (13:59 +0200)] 
po: add a false positive to POTFILES.skip

2 years ago[st-stub] documenting the .dtb section 21013/head
Max Resch [Sat, 16 Oct 2021 11:26:21 +0000 (13:26 +0200)] 
[st-stub] documenting the .dtb section

2 years agohomework: reuse home_validate_update_luks() at one more place
Lennart Poettering [Wed, 13 Oct 2021 20:40:11 +0000 (22:40 +0200)] 
homework: reuse home_validate_update_luks() at one more place

We have the same code at two places, let's reuse it. Given the more
generic scope let's rename the function home_get_state() since it
retrieve the current setup state of the LUKS logic.

2 years agohomework: remove duplicate error logging when doing ext4 resizes
Lennart Poettering [Thu, 14 Oct 2021 15:23:29 +0000 (17:23 +0200)] 
homework: remove duplicate error logging when doing ext4 resizes

2 years agohomework: let's simply some code via erase_and_free()
Lennart Poettering [Fri, 15 Oct 2021 16:00:38 +0000 (18:00 +0200)] 
homework: let's simply some code via erase_and_free()

2 years agohomed,shutdown: call valgrind magic after LOOP_GET_STATUS64
Lennart Poettering [Fri, 15 Oct 2021 15:58:13 +0000 (17:58 +0200)] 
homed,shutdown: call valgrind magic after LOOP_GET_STATUS64

valgrind doesn't understand LOOP_GET_STATUS64. We already work around
this in various placed, via VALGRIND_MAKE_MEM_DEFINE(), but we forgot
three places. Let's fix that.

2 years agouserdb: fix type to pass to connect()
Yu Watanabe [Fri, 15 Oct 2021 20:04:26 +0000 (05:04 +0900)] 
userdb: fix type to pass to connect()

Fixes https://github.com/systemd/systemd/pull/20613#issuecomment-944621275.

2 years ago[sd-stub] add support for embedding devicetree
Max Resch [Fri, 15 Oct 2021 12:18:57 +0000 (14:18 +0200)] 
[sd-stub] add support for embedding devicetree