]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotest-sysusers: check that sysusers creates /etc when missing 26269/head
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 15:41:16 +0000 (16:41 +0100)] 
test-sysusers: check that sysusers creates /etc when missing

2 years agobasic/user-util: create /etc from take_etc_passwd_lock
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 15:24:50 +0000 (16:24 +0100)] 
basic/user-util: create /etc from take_etc_passwd_lock

This allows sysusers to operate with --root that is an empty directory.
It may be useful to, for example, populate the user database before installing
anything else.

firstboot was already doing this, so drop the duplicated call there.

2 years agobasic/user-util: convert prefix_roota→path_join and use _cleanup_ more
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 15:17:12 +0000 (16:17 +0100)] 
basic/user-util: convert prefix_roota→path_join and use _cleanup_ more

2 years agobasic: reword some comments
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 15:16:55 +0000 (16:16 +0100)] 
basic: reword some comments

Without commas, the sentences can be hard to parse.

2 years agosysusers: when comparing items, log debug the difference
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 14:10:03 +0000 (15:10 +0100)] 
sysusers: when comparing items, log debug the difference

2 years agosysusers: add helper to create new Item
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 13:16:48 +0000 (14:16 +0100)] 
sysusers: add helper to create new Item

2 years agopid1,sysusers: drop unused SYNTHETIC_ERRNO
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 13:21:49 +0000 (14:21 +0100)] 
pid1,sysusers: drop unused SYNTHETIC_ERRNO

The only function of SYNTHETIC_ERRNO is to set the return value.
If we're ignoring the return value, it shouldn't be used.

2 years agosysusers: drop counterproductive bitfield annotations
Zbigniew Jędrzejewski-Szmek [Tue, 31 Jan 2023 12:47:17 +0000 (13:47 +0100)] 
sysusers: drop counterproductive bitfield annotations

The usual story:
$ diff -u <(pahole build/systemd-sysusers.0) <(pahole build/systemd-sysusers)
  /* size: 80, cachelines: 2, members: 15 */
- /* sum members: 68, holes: 1, sum holes: 4 */
- /* sum bitfield members: 5 bits (0 bytes) */
- /* padding: 7 */
- /* bit_padding: 3 bits */
+ /* sum members: 73, holes: 1, sum holes: 4 */
+ /* padding: 3 */
  /* last cacheline: 16 bytes */

Effectively, because of padding, we were not saving anything. We're not putting
struct Item in arrays, but when allocating on the heap, we're going to round up to
normal alignment too.

The code becomes shorter (and quicker):
$ size build/systemd-sysusers{,.0}
   text    data     bss     dec     hex filename
  79967    2040     264   82271   1415f build/systemd-sysusers.0
  79726    2040     264   82030   1406e build/systemd-sysusers

(In case you're wondering, I wrote this long commit message for a very simple
change on purpose: I want to deflate the bitfield cargo cult a bit.)

2 years agobpf: fix restrict_fs on s390x
Ilya Leoshkevich [Mon, 30 Jan 2023 20:21:48 +0000 (21:21 +0100)] 
bpf: fix restrict_fs on s390x

Linux kernel's bpf-next contains BPF LSM support for s390x. systemd's
test-bpf-lsm currently fails with this kernel.

This is an endianness issue: in the restrict_fs bpf program,
magic_number has type unsigned long (64 bits on s390x), but magic_map
keys are uint32_t (32 bits). Accessing magic_map using 64-bit keys may
work by accident on little-endian systems, but fails hard on big-endian
ones.

Fix by casting magic_number to uint32_t.

2 years agoimportd: Always specify file unpacked by tar
Arsen Arsenović [Sat, 28 Jan 2023 21:32:41 +0000 (22:32 +0100)] 
importd: Always specify file unpacked by tar

Despite popular belief, the default file extracted by GNU tar is not stdin.  It
is the value of the TAPE environment variable, falling back on a compile-time
constant.  On my system, the default value is /dev/full, which causes tar to
just spin forever due to --ignore-zeros.  Always specifying this flag is the
safe thing to do.

  ~$ tar --show-defaults
  --format=gnu -f/dev/full -b20 --quoting-style=escape
  --rmt-command=/usr/sbin/grmt

See also: ``(tar)defaults'', available via Info viewers, and in HTML form at:
https://www.gnu.org/s/tar/manual/html_node/defaults.html

2 years agoMerge pull request #26249 from DaanDeMeyer/nspawn-uid-fix
Lennart Poettering [Tue, 31 Jan 2023 11:21:09 +0000 (12:21 +0100)] 
Merge pull request #26249 from DaanDeMeyer/nspawn-uid-fix

nspawn: Make sure we create bind mount points as the correct UID/GID

2 years agoMerge pull request #26245 from ldv-alt/tmpfiles-fixes
Lennart Poettering [Mon, 30 Jan 2023 16:14:03 +0000 (17:14 +0100)] 
Merge pull request #26245 from ldv-alt/tmpfiles-fixes

tmpfiles: fix specifier expansion in arguments of C and L lines

2 years agoMerge pull request #23956 from mrc0mmand/resolved-ipv6
Yu Watanabe [Mon, 30 Jan 2023 10:21:19 +0000 (19:21 +0900)] 
Merge pull request #23956 from mrc0mmand/resolved-ipv6

test: cover (not only) IPv6 in the resolved test suite

2 years agoMerge pull request #25374 from yuwata/sleep-fixlets
Luca Boccassi [Mon, 30 Jan 2023 09:51:21 +0000 (09:51 +0000)] 
Merge pull request #25374 from yuwata/sleep-fixlets

sleep: several fixlets

2 years agoMerge pull request #26252 from DaanDeMeyer/mkosi-drop-workaround
Daan De Meyer [Sun, 29 Jan 2023 18:31:15 +0000 (19:31 +0100)] 
Merge pull request #26252 from DaanDeMeyer/mkosi-drop-workaround

mkosi fixes

2 years agotest-systemd-tmpfiles: Fix execution when user is not in /etc/passwd
Daan De Meyer [Sat, 28 Jan 2023 14:09:25 +0000 (15:09 +0100)] 
test-systemd-tmpfiles: Fix execution when user is not in /etc/passwd

We might be running in a chroot as a uid that doesn't exist in /etc/passwd.
Let's make sure we don't fail in this scenario.

We pass $HOME when resetting the env so that we can find a home directory
and skip tests that depend on user name/group.

2 years agomkosi: Disable auditd when running with nspawn in CI 26252/head
Daan De Meyer [Sun, 29 Jan 2023 16:34:21 +0000 (17:34 +0100)] 
mkosi: Disable auditd when running with nspawn in CI

auditd fails to start in CentOS Stream 9 causing CI failures so let's
disable it when running with nspawn in CI.

2 years agomkosi: Add back CentOS Stream 8 to CI
Daan De Meyer [Sun, 29 Jan 2023 14:17:06 +0000 (15:17 +0100)] 
mkosi: Add back CentOS Stream 8 to CI

It's still useful to test the EFI handover logic in systemd-boot.
We use a mkosi.prepare script to install a newer python and update
the system to use it.

2 years agomkosi: Drop focal workaround in build script
Daan De Meyer [Sun, 29 Jan 2023 14:07:38 +0000 (15:07 +0100)] 
mkosi: Drop focal workaround in build script

Now that jammy is the latest LTS, lets drop the focal workaround
from the build script.

2 years agomkosi: Don't modify rootfs in build script
Daan De Meyer [Sun, 29 Jan 2023 14:04:13 +0000 (15:04 +0100)] 
mkosi: Don't modify rootfs in build script

When unprivileged mkosi becomes available, builds will be executed
as an unprivileged user, so we won't be able to modify the rootfs
anymore. Let's update the build script to account for this.

2 years agomkosi: Fix shellcheck warnings
Daan De Meyer [Sun, 29 Jan 2023 16:05:04 +0000 (17:05 +0100)] 
mkosi: Fix shellcheck warnings

2 years agoupdate footer to 2023
cake03 [Sun, 29 Jan 2023 05:13:10 +0000 (05:13 +0000)] 
update footer to 2023

2 years agomkosi: Drop epel-testing repository from centos config
Daan De Meyer [Sun, 29 Jan 2023 09:45:17 +0000 (10:45 +0100)] 
mkosi: Drop epel-testing repository from centos config

python3-pefile was pushed to epel 9 stable.

2 years agonspawn: Make sure we create bind mount points as the correct UID/GID 26249/head
Daan De Meyer [Sat, 28 Jan 2023 14:12:08 +0000 (15:12 +0100)] 
nspawn: Make sure we create bind mount points as the correct UID/GID

When using --private-users, we have to create bind mount points as
the user that will become root in the user namespace, so let's take
that into account.

2 years agomkdir-label: Add mkdir_parents_safe_label()
Daan De Meyer [Sat, 28 Jan 2023 14:11:29 +0000 (15:11 +0100)] 
mkdir-label: Add mkdir_parents_safe_label()

2 years agosd-dhcp-server: allow to send header only message
Yu Watanabe [Sat, 28 Jan 2023 05:01:37 +0000 (14:01 +0900)] 
sd-dhcp-server: allow to send header only message

If we receive a header only message, and the server is running in relay
mode, then the assertion was triggered.

Fixes #26151.

2 years agoukify: python 3.9 compat followup
Daan De Meyer [Fri, 27 Jan 2023 20:21:51 +0000 (21:21 +0100)] 
ukify: python 3.9 compat followup

2 years agosleep: enumerate only existing and non-device batteries 25374/head
Yu Watanabe [Sun, 13 Nov 2022 17:54:50 +0000 (02:54 +0900)] 
sleep: enumerate only existing and non-device batteries

The enumerator is now mostly consistent with on_ac_power() in
udev-util.c.

2 years agosleep: fix indentation
Yu Watanabe [Sun, 13 Nov 2022 17:52:55 +0000 (02:52 +0900)] 
sleep: fix indentation

2 years agosleep: introduce siphash24_compress_id128()
Yu Watanabe [Sun, 13 Nov 2022 17:49:19 +0000 (02:49 +0900)] 
sleep: introduce siphash24_compress_id128()

Also, rename get_battery_identifier() to siphash24_compress_device_sysattr().

This also makes any errors in sd_id128_get_machine() or id128_get_product()
ignored. For the machine ID, the failure should not be significant unless
the file stored in the discharge level is reused by another system, which
is quite unusual. For the product ID, if the firmware provides useless
ID (all zero or all 0xFF), then loading/storing the discharge rate
becomes completely broken, that should be avoided.

Note, now sysattrs are used instead of properties in uevent files, but
both provide the same information, hence no functionality should be
changed.

2 years agosleep: simplify code a bit
Yu Watanabe [Sun, 13 Nov 2022 17:46:53 +0000 (02:46 +0900)] 
sleep: simplify code a bit

- use device_get_sysattr_int(),
- drop redundant log message.

2 years agosleep: coding style fixlets
Yu Watanabe [Sun, 13 Nov 2022 17:44:13 +0000 (02:44 +0900)] 
sleep: coding style fixlets

2 years agosleep: introduce SuspendEstimationSec=
Yu Watanabe [Sun, 13 Nov 2022 17:08:05 +0000 (02:08 +0900)] 
sleep: introduce SuspendEstimationSec=

Before v252, HibernateDelaySec= specifies the maximum timespan that the
system in suspend state, and the system hibernate after the timespan.

However, after 96d662fa4c8cab24da57523c5e49e6ef3967fc13, the setting is
repurposed as the default interval to measure battery charge level and
estimate the battery discharging late. And if the system has enough
battery capacity, then the system will stay in suspend state and not
hibernate even if the time passed. See issue #25269.

To keep the backward compatibility, let's introduce another setting
SuspendEstimationSec= for controlling the interval to measure
battery charge level, and make HibernateDelaySec= work as of v251.

This also drops implementation details from the man page.

Fixes #25269.

2 years agotest: wrap delv & dig when running with sanitizers 23956/head
Frantisek Sumsal [Fri, 27 Jan 2023 14:34:36 +0000 (15:34 +0100)] 
test: wrap delv & dig when running with sanitizers

On Arch both delv and dig pull in libnss_resolve:

```
$ grep resolve /etc/nsswitch.conf
hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
```

2 years agotest: don't hang indefinitely on no match
Frantisek Sumsal [Fri, 27 Jan 2023 13:29:42 +0000 (14:29 +0100)] 
test: don't hang indefinitely on no match

2 years agotest: add a test for the OPENPGPKEY RR
Frantisek Sumsal [Fri, 8 Jul 2022 18:23:13 +0000 (20:23 +0200)] 
test: add a test for the OPENPGPKEY RR

2 years agotest: add a couple of SRV records to check service resolution
Frantisek Sumsal [Fri, 8 Jul 2022 16:12:47 +0000 (18:12 +0200)] 
test: add a couple of SRV records to check service resolution

2 years agotest: cover IPv6 in the resolved test suite
Frantisek Sumsal [Fri, 8 Jul 2022 11:36:03 +0000 (13:36 +0200)] 
test: cover IPv6 in the resolved test suite

2 years agomkosi: Update and enable ukify in mkosi builds
Daan De Meyer [Tue, 24 Jan 2023 11:51:31 +0000 (12:51 +0100)] 
mkosi: Update and enable ukify in mkosi builds

We also add the necessary deps for ukify to the mkosi configs.

CentOS Stream 8 is dropped from CI because its python version is too
old (3.6) to be able to run ukify.

2 years agotmpfiles: automatically create /etc/credstore/ and friends
Lennart Poettering [Thu, 26 Jan 2023 21:30:27 +0000 (22:30 +0100)] 
tmpfiles: automatically create /etc/credstore/ and friends

This adds a tmpfiles.d/ snippet for LoadCredential= style credentials
directories in /etc/ and /run/.

This is done primarily to ensure that the access modes for the dirs are
set up properly, in the most restrictive ways. Specifically these are
set to 0000, so that CAP_DAC_OVERRIDE is necessary to enumerate and read
the credentials, and being UID=0 is not sufficient to do so.

This creates /etc/credstore/, but leaves /run/credstore/ absent if
missing, for now. Thinking is: the latter being non-persistent is
created by software usually, not manually by users, and hence more
likely right. But dunno, we might want to revisit this sooner or later.

This is ultimately an exercise to advertise the LoadCredential= concept
a bit, and do so in a reasonably secure way, underlining the safety of
the concept.

2 years agoMerge pull request #26228 from DaanDeMeyer/resolve-cap
Lennart Poettering [Fri, 27 Jan 2023 09:03:17 +0000 (10:03 +0100)] 
Merge pull request #26228 from DaanDeMeyer/resolve-cap

resolve: Skip stubs if running in a container with userns but without network namespace

2 years agojournald: don't check for -EREMCHG on open, given that open doesn't generate it
Lennart Poettering [Thu, 26 Jan 2023 16:32:52 +0000 (17:32 +0100)] 
journald: don't check for -EREMCHG on open, given that open doesn't generate it

We generate EREMCHG when writing entries, but not during open, hence
don't bother with checking for it.

2 years agojournal: use TAKE_PTR() at one more place
Lennart Poettering [Thu, 26 Jan 2023 16:12:10 +0000 (17:12 +0100)] 
journal: use TAKE_PTR() at one more place

2 years agoboot: Use aarch64 virtual counter
Jan Janssen [Thu, 26 Jan 2023 22:10:53 +0000 (23:10 +0100)] 
boot: Use aarch64 virtual counter

This should be used in VMs and should also yield the same value when
running on real devices. It is also what grub uses.

Fixes: #26224
2 years agoresolve: Skip creating stubs if missing CAP_NET_BIND_SERVICE 26228/head
Daan De Meyer [Thu, 26 Jan 2023 21:20:01 +0000 (22:20 +0100)] 
resolve: Skip creating stubs if missing CAP_NET_BIND_SERVICE

If we don't have CAP_NET_BIND_SERVICE, we won't be able to bind
the stub listener socket, so let's skip creating it and log a warning.

We do the same for the extra stubs if they're configured on privileged
ports.

2 years agonspawn: Drop CAP_NET_BIND_SERVICE when in userns but not in netns
Daan De Meyer [Thu, 26 Jan 2023 21:18:47 +0000 (22:18 +0100)] 
nspawn: Drop CAP_NET_BIND_SERVICE when in userns but not in netns

If we're in a user namespace but not unsharing the network namespace,
we won't be able to bind any privileged ports even with
CAP_NET_BIND_SERVICE, so let's drop it from the retained capabilities
so services can condition themselves on that.

2 years agoMerge pull request #26209 from PeterCxy/doc-fido2-changes
Zbigniew Jędrzejewski-Szmek [Thu, 26 Jan 2023 15:29:06 +0000 (16:29 +0100)] 
Merge pull request #26209 from PeterCxy/doc-fido2-changes

Update NEWS and docs regarding FIDO2 support in systemd-crypt{enroll,setup}

2 years agoNEWS: Add entry about support for multiple FIDO2 tokens 26209/head
Peter Cai [Thu, 26 Jan 2023 01:47:35 +0000 (20:47 -0500)] 
NEWS: Add entry about support for multiple FIDO2 tokens

2 years agodocs: Update crypt{enroll,setup} limitations regarding FIDO2
Peter Cai [Thu, 26 Jan 2023 01:39:17 +0000 (20:39 -0500)] 
docs: Update crypt{enroll,setup} limitations regarding FIDO2

2 years agojournal: prefix all functions with "server_" that operate on Server objects
Lennart Poettering [Thu, 26 Jan 2023 09:39:28 +0000 (10:39 +0100)] 
journal: prefix all functions with "server_" that operate on Server objects

Just some search/replace, no real code changes.

The majority of functions already followed this rule, but some did not.
Fix that.

2 years agojournal-file: be a tiny bit more careful with generating seqnums
Lennart Poettering [Mon, 23 Jan 2023 21:46:12 +0000 (22:46 +0100)] 
journal-file: be a tiny bit more careful with generating seqnums

Let's handle overflows in a vaguely reasonable way, i.e. avoid the
special values 0 and UINT64_MAX

2 years agosleep: drop unnecessary temporal vaiable and initialization
Yu Watanabe [Sun, 13 Nov 2022 15:09:34 +0000 (00:09 +0900)] 
sleep: drop unnecessary temporal vaiable and initialization

2 years agosleep: fetch_batteries_capacity_by_name() does not return -ENOENT
Yu Watanabe [Sun, 13 Nov 2022 23:31:09 +0000 (08:31 +0900)] 
sleep: fetch_batteries_capacity_by_name() does not return -ENOENT

2 years agosleep: rename hibernate_delay_sec -> _usec
Yu Watanabe [Sun, 13 Nov 2022 14:59:49 +0000 (23:59 +0900)] 
sleep: rename hibernate_delay_sec -> _usec

2 years agoupdate TODO
Lennart Poettering [Thu, 26 Jan 2023 10:51:38 +0000 (11:51 +0100)] 
update TODO

2 years agojournald: minor modernizations in kmsg handling code
Lennart Poettering [Thu, 26 Jan 2023 09:10:20 +0000 (10:10 +0100)] 
journald: minor modernizations in kmsg handling code

Nothing earth shattering. Mostly just fixes (and some more careful
checking of the boolean variables we keep)

2 years agoMerge pull request #26198 from poettering/journal-strict-mode
Lennart Poettering [Thu, 26 Jan 2023 10:19:54 +0000 (11:19 +0100)] 
Merge pull request #26198 from poettering/journal-strict-mode

journal: enforce strict ordering only when writing journal files from journald, but not from journal-remote and similar

2 years agogithub/labeller: fix yaml syntax
Zbigniew Jędrzejewski-Szmek [Thu, 26 Jan 2023 09:42:05 +0000 (10:42 +0100)] 
github/labeller: fix yaml syntax

2 years agogithub/labeller: add more match patterns
Zbigniew Jędrzejewski-Szmek [Wed, 25 Jan 2023 16:41:16 +0000 (17:41 +0100)] 
github/labeller: add more match patterns

2 years agojournal: automatically pick up boot ID in journal_file_append_entry()
Lennart Poettering [Thu, 19 Jan 2023 21:45:17 +0000 (22:45 +0100)] 
journal: automatically pick up boot ID in journal_file_append_entry()

Let's pick up the boot ID early if unspecified, in
journal_file_append_entry(). This is symmetric to the fact that we
already pick up the monotonic timestamp in journal_file_append_entry()
if unspecified, and given that the monotonic clock is not too useful
without its boot ID it makes a lot of sense to pick them up at the same
time.

There are two relevant callers of journal_file_append_entry() right now:
journald (which leaves the boot ID unspecified) and journal-remote
(there are also some tests, but those don't matter too much). The former
calls it to store new entries in the journal file, the latter for
converting/processing/merging existing ones (where it passes along the
original boot ID). This new code hence only is relevant on the former,
and using the boot ID of the current system is the right choice for live
generated entries.

Note that this effectively changes little, since the lower-level
function journal_file_append_entry_internal() will copy boot ID stored
in the file header into all records if unspecified, and typically that's
the one of the local system. But strictly speaking this is not the right
thing to do, since we actually might end up appending to journal files
from previous boots. (The lower level function is indirectly used by
various tests, where the copying-from-header logic kinda makes sense
since they are detached from any live messages streaming in from the
host after all).

2 years agosha256: header needs stddef
William Roberts [Wed, 25 Jan 2023 19:46:19 +0000 (13:46 -0600)] 
sha256: header needs stddef

The sha256 header uses size_t which is within stddef, so add it.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
2 years agojournal: add some line breaks/comments 26198/head
Lennart Poettering [Wed, 25 Jan 2023 14:05:36 +0000 (15:05 +0100)] 
journal: add some line breaks/comments

2 years agojournal-file: make strict order optional
Lennart Poettering [Thu, 19 Jan 2023 21:45:06 +0000 (22:45 +0100)] 
journal-file: make strict order optional

This is a follow-up for 1d8d483f59ffa62974772fb58a8ef4abe88550ec and
makes the strict ordering by realtime clock within each journal file
optional, not mandatory. It then enables it for all journal files
written by journald, but leaves it off on others (for example those
written by journald-remote).

This relaxes the logic behind writing journal files to the status quo
ante for all cases where the journal files are not generated, but are
merged/processed/propagated. Typically when processing journal records
from many files ordering by realtime clock and monotonic clock are
contradictory, and cannot be universally guaranteed as the records are
interleaved. By enforcing strict rules we would thus end up generating
myriads of separate journal files, each with just a few records in them.

Hence, let's losen restrictions again, but continue to enforce them in
journald, i.e. when we original create the journal files locally.

Note that generally there's nothing really wring with having journal
files with non-monotonically ordered entries by realtime clock. Looking
for records will not be deterministic anymore, but that's inherent to a
realtime clock that jumps up and down. So you won't get the "only"
answer, but still *a* answer that is correct if you seek for a realtime
clock.

This also adds similar logic on the monotonic clock, which is also only
enabled when generating journal files locally. This should be harder to
trigger (as journald will generate the messages, and should run with a
stable boot id and monotonic clock), but let's better be safe than
sorry, and refuse on the lower layer what makes no sense, even if it's
unlikely the higher layer will ever generate records that aren't ordered
by their monotonic clock.

2 years agoMerge pull request #26204 from poettering/journal-header-compoung-init
Lennart Poettering [Wed, 25 Jan 2023 20:22:07 +0000 (21:22 +0100)] 
Merge pull request #26204 from poettering/journal-header-compoung-init

journal: use compound initialization for journal file "Header" structure

2 years agoMerge pull request #26179 from medhefgo/boot-no-gnu-efi
Luca Boccassi [Wed, 25 Jan 2023 19:51:24 +0000 (19:51 +0000)] 
Merge pull request #26179 from medhefgo/boot-no-gnu-efi

boot: Use size_t/unicode string literals

2 years agorepart: Add roothash to output of all verity siblings
Daan De Meyer [Wed, 25 Jan 2023 14:56:30 +0000 (15:56 +0100)] 
repart: Add roothash to output of all verity siblings

This can be used to match verity partitions together using the repart
JSON output.

2 years agoMerge pull request #26195 from mrc0mmand/update-uapi
Luca Boccassi [Wed, 25 Jan 2023 19:49:00 +0000 (19:49 +0000)] 
Merge pull request #26195 from mrc0mmand/update-uapi

basic/linux: update l2tp.h

2 years agoMerge pull request #26192 from mrc0mmand/fix-errno-check
Luca Boccassi [Wed, 25 Jan 2023 19:48:23 +0000 (19:48 +0000)] 
Merge pull request #26192 from mrc0mmand/fix-errno-check

sysupdate: fix errno check

2 years agotest-execute: Skip when /sys is read-only
Daan De Meyer [Wed, 25 Jan 2023 08:39:13 +0000 (09:39 +0100)] 
test-execute: Skip when /sys is read-only

The test depends on /sys being writable, so let's skip it when /sys
is read-only.

2 years agotest: skip firstboot --prompt-keymap check if keymaps are missing
Michael Biebl [Wed, 25 Jan 2023 08:13:37 +0000 (09:13 +0100)] 
test: skip firstboot --prompt-keymap check if keymaps are missing

Fixes: #26165
2 years agoMerge pull request #26197 from poettering/journal-file-size-t-fix
Lennart Poettering [Wed, 25 Jan 2023 18:04:11 +0000 (19:04 +0100)] 
Merge pull request #26197 from poettering/journal-file-size-t-fix

journal: some trivial size_t array size fixes

2 years agojournal: use compound initialization for journal file Header structure 26204/head
Lennart Poettering [Wed, 25 Jan 2023 17:48:31 +0000 (18:48 +0100)] 
journal: use compound initialization for journal file Header structure

2 years agojournal-def: fix type of signature to match the actual field in the Header structure
Lennart Poettering [Wed, 25 Jan 2023 17:47:05 +0000 (18:47 +0100)] 
journal-def: fix type of signature to match the actual field in the Header structure

2 years agoboot: Use unicode literals 26179/head
Jan Janssen [Fri, 9 Dec 2022 10:15:41 +0000 (11:15 +0100)] 
boot: Use unicode literals

No changes in behavior.

2 years agoboot: Use unsigned for beep counting
Jan Janssen [Wed, 25 Jan 2023 14:23:49 +0000 (15:23 +0100)] 
boot: Use unsigned for beep counting

2 years agoboot: Replace UINTN with size_t
Jan Janssen [Fri, 9 Dec 2022 10:13:09 +0000 (11:13 +0100)] 
boot: Replace UINTN with size_t

No changes in behavior.

2 years agodlfcn: add new safe_dclose() helper
Lennart Poettering [Wed, 25 Jan 2023 10:54:44 +0000 (11:54 +0100)] 
dlfcn: add new safe_dclose() helper

Let's allow destructing loaded module handles in our usual way that is
fine with NULL handles, and also returns the NULL handle again.

2 years agopartition: fix build with newer linux/btrfs.h uapi header 26195/head
Frantisek Sumsal [Wed, 25 Jan 2023 12:21:09 +0000 (13:21 +0100)] 
partition: fix build with newer linux/btrfs.h uapi header

linux/btrfs.h needs  to be included after sys/mount.h, as since [0]
linux/btrfs.h includes linux/fs.h causing build errors:

```
In file included from /usr/include/linux/fs.h:19,
                 from ../src/basic/linux/btrfs.h:29,
                 from ../src/partition/growfs.c:6:
/usr/include/sys/mount.h:35:3: error: expected identifier before numeric constant
   35 |   MS_RDONLY = 1,                /* Mount read-only.  */
      |   ^~~~~~~~~
[1222/2169] Compiling C object systemd-creds.p/src_creds_creds.c.o
ninja: build stopped: subcommand failed.
```

See: https://github.com/systemd/systemd/issues/8507

[0] https://github.com/torvalds/linux/commit/a28135303a669917002f569aecebd5758263e4aa

2 years agobasic/linux: update linux uapi headers
Frantisek Sumsal [Wed, 25 Jan 2023 11:37:49 +0000 (12:37 +0100)] 
basic/linux: update linux uapi headers

IPPROTO_L2TP was moved from linux/l2tp.h to linux/in.h [0], so let's
reflect that change to fix build with newer kernels:

```
In file included from ../src/libsystemd/sd-netlink/netlink-types-genl.c:10:
../src/basic/linux/l2tp.h:16: error: "IPPROTO_L2TP" redefined [-Werror]
   16 | #define IPPROTO_L2TP            115
      |
In file included from ../src/libsystemd/sd-netlink/netlink-types-genl.c:3:
/usr/include/netinet/in.h:85: note: this is the location of the previous definition
   85 | #define IPPROTO_L2TP            IPPROTO_L2TP
      |
cc1: all warnings being treated as errors
```

When at it, update the rest of the headers we ship as well.

[0] https://github.com/torvalds/linux/commit/65b32f801bfbc54dc98144a6ec26082b59d131ee

2 years agojournal-file: cast file size to to fixed size type 26197/head
Lennart Poettering [Wed, 25 Jan 2023 13:09:19 +0000 (14:09 +0100)] 
journal-file: cast file size to to fixed size type

(We generally avoid using off_t for file sizes/offsets, and instead use
uint64_t to get the same behaviour everywhere. Do so here too.)

2 years agojournal-file: fix type of array counter
Lennart Poettering [Wed, 25 Jan 2023 13:07:50 +0000 (14:07 +0100)] 
journal-file: fix type of array counter

2 years agoMerge pull request #26193 from aafeijoo-suse/cryptenroll-unlock-fido2-device-man...
Luca Boccassi [Wed, 25 Jan 2023 13:15:13 +0000 (13:15 +0000)] 
Merge pull request #26193 from aafeijoo-suse/cryptenroll-unlock-fido2-device-man-and-bash-completion-fix

Add missing --unlock-fido2-device to systemd-cryptenroll man and bash-completion

2 years agoman: add missing --unlock-fido2-device to systemd-cryptenroll 26193/head
Antonio Alvarez Feijoo [Wed, 25 Jan 2023 10:58:19 +0000 (11:58 +0100)] 
man: add missing --unlock-fido2-device to systemd-cryptenroll

2 years agoupdate TODO
Lennart Poettering [Wed, 25 Jan 2023 10:54:02 +0000 (11:54 +0100)] 
update TODO

2 years agobash-completion: add missing --unlock-fido2-device to systemd-cryptenroll
Antonio Alvarez Feijoo [Wed, 25 Jan 2023 10:53:50 +0000 (11:53 +0100)] 
bash-completion: add missing --unlock-fido2-device to systemd-cryptenroll

2 years agobootctl-status: several follow-ups for unlink command
Yu Watanabe [Wed, 25 Jan 2023 02:26:21 +0000 (11:26 +0900)] 
bootctl-status: several follow-ups for unlink command

Follow-ups for 8702496bfb0205764569782a9a2ebd11fd80e5e8.

- add missing error cause in logging,
- add several missing assertions,
- drop an unnecessary initialization,
- make boot_config_find_in() return negative errno if nothing found,
- and several coding style fixlets.

2 years agobootctl-uki: several follow-ups for inspect_osrel()
Yu Watanabe [Wed, 25 Jan 2023 02:05:46 +0000 (11:05 +0900)] 
bootctl-uki: several follow-ups for inspect_osrel()

Follow-ups for #26124 and #26158.

- use os_release_pretty_name(),
- constify the buffer passed to inspect_osrel(),
- propagate errors in inspect_osrele(), and ignore them in the caller
  side,
- and several coding style fixlets.

2 years agococcinelle: skip the empty-to-null transformation on the macro itself 26192/head
Frantisek Sumsal [Wed, 25 Jan 2023 10:35:06 +0000 (11:35 +0100)] 
coccinelle: skip the empty-to-null transformation on the macro itself

Since the empty_to_null() function was "macrofied", we need to use a bit
of black magic to make Coccinelle avoid running the transformation on
the macro itself.

Follow-up to ef2409cbde3.

2 years agosysupdate: fix errno check
Frantisek Sumsal [Wed, 25 Jan 2023 10:28:46 +0000 (11:28 +0100)] 
sysupdate: fix errno check

2 years agoNEWS: update date and location v253-rc1
Luca Boccassi [Tue, 24 Jan 2023 23:09:17 +0000 (23:09 +0000)] 
NEWS: update date and location

2 years agoshared/efi-loader: fix compilation with !ENABLE_EFI, improve messages
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jan 2023 21:45:25 +0000 (22:45 +0100)] 
shared/efi-loader: fix compilation with !ENABLE_EFI, improve messages

When compiled without ENABLE_EFI, efi_stub_measured() was not defined, so
compilation would fail. But it's not enough to add a stub that returns
-EOPNOTSUPP. We call this function in various places and usually print the error
at warning or error level, so we'd print a confusing message. We also can't add
a stub that always returns 0, because then we'd print a message like "Kernel
stub did not measure", which would be confusing too. Adding special handling for
-EOPNOTSUPP in every caller is also unattractive. So instead efi_stub_measured()
is reworked to log the warning or error internally, and such logging is removed
from the callers, and a stub is added that logs a custom message.

2 years agoMerge pull request #26184 from keszybz/cleanups
Luca Boccassi [Tue, 24 Jan 2023 23:07:05 +0000 (23:07 +0000)] 
Merge pull request #26184 from keszybz/cleanups

Various fixups to recent commits

2 years agolocale: rename new XKB variables to match Debian/Ubuntu's
Luca Boccassi [Tue, 24 Jan 2023 17:18:31 +0000 (17:18 +0000)] 
locale: rename new XKB variables to match Debian/Ubuntu's

Debian/Ubuntu use almost the same variables, but without '_'. Given
our usage is new, rename them so that they match and downstream tech
debt can be removed.

Follow-up for https://github.com/systemd/systemd/pull/25805

See:
 https://github.com/systemd/systemd/issues/24228
 https://github.com/systemd/systemd/pull/25412

2 years agodocs: Update HACKING.md to mention latest mkosi is needed
Daan De Meyer [Tue, 24 Jan 2023 11:46:41 +0000 (12:46 +0100)] 
docs: Update HACKING.md to mention latest mkosi is needed

Let's require users to run mkosi from git so we can fix any issues
forward instead of trying to keep the configs working with older
versions.

2 years agomeson: Do not include headers in source lists
Jan Janssen [Tue, 24 Jan 2023 14:14:15 +0000 (15:14 +0100)] 
meson: Do not include headers in source lists

Meson+ninja+compiler do this for us and are better at it.

https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools

2 years agoUpdate NEWS
Luca Boccassi [Tue, 24 Jan 2023 19:12:36 +0000 (19:12 +0000)] 
Update NEWS

2 years agoConsolidate various TAKE_* into TAKE_GENERIC(), add TAKE_STRUCT()
Dan Streetman [Tue, 6 Dec 2022 18:07:34 +0000 (13:07 -0500)] 
Consolidate various TAKE_* into TAKE_GENERIC(), add TAKE_STRUCT()

2 years agoman: clarify that MESSAGE= should not appear more than once in the same journal entry
Lennart Poettering [Tue, 24 Jan 2023 15:39:02 +0000 (16:39 +0100)] 
man: clarify that MESSAGE= should not appear more than once in the same journal entry

One would think this was clear already, but apparently it's not clear
enough, hence let's be more explicit.

Fixes: #26175
2 years agotest-sleep: reduce timeout 26184/head
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jan 2023 06:58:23 +0000 (07:58 +0100)] 
test-sleep: reduce timeout

The timeout was raised during review and I wrote that I lowered it, but forgot
to actually commit the diff. Follow-up for 31f62bdd79472c32d52408956d5c82e9991ca425.

2 years agoNEWS: update for v253-rc1
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jan 2023 18:13:29 +0000 (19:13 +0100)] 
NEWS: update for v253-rc1