]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 months agotest: use free() instead of mfree() 32055/head
Frantisek Sumsal [Tue, 2 Apr 2024 16:08:50 +0000 (18:08 +0200)] 
test: use free() instead of mfree()

Since we don't use the returned value anyway.

5 months agosysext: use mfree() in one more place
Frantisek Sumsal [Tue, 2 Apr 2024 16:08:30 +0000 (18:08 +0200)] 
sysext: use mfree() in one more place

5 months agoSimplify a couple of conditions
Frantisek Sumsal [Tue, 2 Apr 2024 16:07:50 +0000 (18:07 +0200)] 
Simplify a couple of conditions

5 months agoUse IN_SET() more
Frantisek Sumsal [Tue, 2 Apr 2024 16:06:24 +0000 (18:06 +0200)] 
Use IN_SET() more

5 months agoMerge pull request #32004 from YHNdnzj/umount-new-cycle
Luca Boccassi [Tue, 2 Apr 2024 14:52:46 +0000 (15:52 +0100)] 
Merge pull request #32004 from YHNdnzj/umount-new-cycle

core/mount: if mount is gone eventually, consider it success

5 months agoMerge pull request #32042 from YHNdnzj/implicit-mounts-for
Luca Boccassi [Tue, 2 Apr 2024 12:24:56 +0000 (13:24 +0100)] 
Merge pull request #32042 from YHNdnzj/implicit-mounts-for

units: remove one implicit RequiresMountsFor=

5 months agobuild(deps): bump systemd/mkosi
dependabot[bot] [Mon, 1 Apr 2024 09:12:59 +0000 (09:12 +0000)] 
build(deps): bump systemd/mkosi

Bumps [systemd/mkosi](https://github.com/systemd/mkosi) from 31af101620fc2996517d87e86da310f7ba553d58 to 4dfdf98ed2877a1e40f37234e0b8fbba0fec3584.
- [Release notes](https://github.com/systemd/mkosi/releases)
- [Changelog](https://github.com/systemd/mkosi/blob/main/NEWS.md)
- [Commits](https://github.com/systemd/mkosi/compare/31af101620fc2996517d87e86da310f7ba553d58...4dfdf98ed2877a1e40f37234e0b8fbba0fec3584)

---
updated-dependencies:
- dependency-name: systemd/mkosi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agomkosi: Use '-' instead of '.' to separate upstream version and debian revision
Daan De Meyer [Tue, 2 Apr 2024 09:19:22 +0000 (11:19 +0200)] 
mkosi: Use '-' instead of '.' to separate upstream version and debian revision

The debian revision starts after the '-' character, so make sure the
timestamp we append is treated as the revision instead of being a part
of the upstream version.

5 months agobuild(deps): bump pkg/debian from `44fe1d4` to `e780b50`
dependabot[bot] [Mon, 1 Apr 2024 09:33:13 +0000 (09:33 +0000)] 
build(deps): bump pkg/debian from `44fe1d4` to `e780b50`

Bumps pkg/debian from `44fe1d4` to `e780b50`.

---
updated-dependencies:
- dependency-name: pkg/debian
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agocore/mount: if mount is gone eventually, consider it success 32004/head
Mike Yuan [Thu, 28 Mar 2024 16:43:25 +0000 (00:43 +0800)] 
core/mount: if mount is gone eventually, consider it success

Currently, if unmount initiated by us fails, we record
that in result. Later, if we tried again and succeeded,
or someone else successfully unmounted it, the unit
state is still considered failed. Let's be more tolerant
instead, and forget about previous failure.

Alternative to #32002

5 months agocore/mount: if unmount retries exceeded max, record as failure
Mike Yuan [Thu, 28 Mar 2024 16:51:27 +0000 (00:51 +0800)] 
core/mount: if unmount retries exceeded max, record as failure

5 months agoman/tmpfiles.d: drop doubled space
Mike Yuan [Tue, 2 Apr 2024 09:11:47 +0000 (17:11 +0800)] 
man/tmpfiles.d: drop doubled space

5 months agodoc(tmpfiles.d): remove deprecated `F` type
Eisuke Kawashima [Mon, 1 Apr 2024 17:35:04 +0000 (02:35 +0900)] 
doc(tmpfiles.d): remove deprecated `F` type

close #32044

5 months agounits: remove implicit RequiresMountsFor= 32042/head
Mike Yuan [Mon, 1 Apr 2024 11:44:51 +0000 (19:44 +0800)] 
units: remove implicit RequiresMountsFor=

5 months agocore/unit: use FOREACH_ARRAY at one more place
Mike Yuan [Mon, 1 Apr 2024 11:42:02 +0000 (19:42 +0800)] 
core/unit: use FOREACH_ARRAY at one more place

5 months agocore/service: ensure we don't restart on SERVICE_SKIP_CONDITION
Mike Yuan [Sat, 30 Mar 2024 13:16:49 +0000 (21:16 +0800)] 
core/service: ensure we don't restart on SERVICE_SKIP_CONDITION

service_shall_restart() always returns false if result
is SERVICE_SKIP_CONDITION, so drop unreachable code.

5 months agobuild(deps): bump redhat-plumbers-in-action/differential-shellcheck
dependabot[bot] [Mon, 1 Apr 2024 09:12:54 +0000 (09:12 +0000)] 
build(deps): bump redhat-plumbers-in-action/differential-shellcheck

Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/redhat-plumbers-in-action/differential-shellcheck/compare/b9df2a9417f69c056e0aeaf870abd9a2065a403e...c15070885a82a2c93db8a765d332c38c50dde8b3)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agosysupdate: print assumed value
Burak Gerz [Fri, 29 Mar 2024 23:41:51 +0000 (00:41 +0100)] 
sysupdate: print assumed value

The MatchPattern= in Target specification is documented as mandatory,
but if not defined sysupdate will assume the same value as definied
in Source specification and continue execution. Print this
assumptions to the user

5 months agoFix assertion in socknameinfo_pretty()
Daan De Meyer [Sun, 31 Mar 2024 16:24:35 +0000 (18:24 +0200)] 
Fix assertion in socknameinfo_pretty()

5 months agomkosi: Update centos to latest
Daan De Meyer [Sun, 31 Mar 2024 20:39:19 +0000 (22:39 +0200)] 
mkosi: Update centos to latest

Due to dependabot and pagure not playing nice with each other, we're
going to have to update this one manually for a while.

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

5 months agorepart: Add DefaultSubvolume= setting
Daan De Meyer [Fri, 29 Mar 2024 14:56:01 +0000 (15:56 +0100)] 
repart: Add DefaultSubvolume= setting

We already have Subvolumes= to create subvolumes, let's add
DefaultSubvolume= as well to set the default subvolume.

5 months agomanager: Freeze/Thaw: Don't fail units w/o cgroup
Adrian Vovk [Fri, 29 Mar 2024 00:38:09 +0000 (20:38 -0400)] 
manager: Freeze/Thaw: Don't fail units w/o cgroup

Previously, it was impossible to freeze or thaw a slice if it is an
ancestor to a unit that had no running cgroup (i.e. a service with
RemainAfterExit=yes). Instead of failing with EBUSY (which would
confusingly get reported as "Unit has pending job") we just silently
no-op.

I noticed this because we now have user-runtime-dir@.service, which
would make it impossible to freeze/thaw user.slice or user-<UID>.slice

5 months agoMerge pull request #32010 from bluca/reexec_rate_limit
Luca Boccassi [Fri, 29 Mar 2024 17:16:36 +0000 (17:16 +0000)] 
Merge pull request #32010 from bluca/reexec_rate_limit

core: serialize reload rate limit and apply ReloadLimit to reexec too

5 months agomkosi: Switch to linux-virtual on Ubuntu
Daan De Meyer [Fri, 29 Mar 2024 07:28:57 +0000 (08:28 +0100)] 
mkosi: Switch to linux-virtual on Ubuntu

This now finally has support for credentials and erofs so let's switch
to this much smaller kernel package that doesn't pull in linux-firmware.

5 months agoudevadm-test: prettify test results
Yu Watanabe [Fri, 29 Mar 2024 04:03:49 +0000 (13:03 +0900)] 
udevadm-test: prettify test results

5 months agocore: apply ReloadLimit to reexec too 32010/head
Luca Boccassi [Fri, 29 Mar 2024 01:29:07 +0000 (01:29 +0000)] 
core: apply ReloadLimit to reexec too

Same reason as the reload, reexec is disruptive and it requires the
same privileges, so if somebody wants to limit reloads, they'll also
want to limit reexecs, so use the same setting.

5 months agocore: serialize reload rate limit
Luca Boccassi [Fri, 29 Mar 2024 01:15:26 +0000 (01:15 +0000)] 
core: serialize reload rate limit

Otherwise the rate limit is lost on reexec, and the privileges to call it
are the same as reloads

5 months agoMerge pull request #32013 from yuwata/align-table
Daan De Meyer [Fri, 29 Mar 2024 07:30:59 +0000 (08:30 +0100)] 
Merge pull request #32013 from yuwata/align-table

core: align table

5 months agounit-def: append trailing comma for the last entry 32013/head
Yu Watanabe [Fri, 29 Mar 2024 04:53:01 +0000 (13:53 +0900)] 
unit-def: append trailing comma for the last entry

5 months agocore: align table
Yu Watanabe [Fri, 29 Mar 2024 04:51:15 +0000 (13:51 +0900)] 
core: align table

5 months agoMerge pull request #31998 from yuwata/udev-event-mode
Yu Watanabe [Fri, 29 Mar 2024 02:31:58 +0000 (11:31 +0900)] 
Merge pull request #31998 from yuwata/udev-event-mode

udev: make udevadm test and test-builtin not destructive

5 months agoportable: the 'flags' parameter is now used in DetachImageWithExtensions() and Reatta...
Luca Boccassi [Thu, 28 Mar 2024 22:17:26 +0000 (22:17 +0000)] 
portable: the 'flags' parameter is now used in DetachImageWithExtensions() and ReattachImageWithExtensions()

5 months agoudev: make udevadm test and test-builtin not destructive 31998/head
Yu Watanabe [Thu, 28 Mar 2024 07:24:59 +0000 (16:24 +0900)] 
udev: make udevadm test and test-builtin not destructive

Previously, 'udevadm test' performs not only processing udev rules,
but made several destructive change on the system; updating udev
database, device node permission, devlinks, network interface
properties, and so on.

Similary, 'udevadm test-builtin' may perform something destructive,
especially by 'keyboard', 'kmod', and 'net_setup_link' builtins.

Let's make these commands and test executables not change device
configurations.

5 months agoMerge pull request #31986 from YHNdnzj/suspend-mem-mode
Yu Watanabe [Fri, 29 Mar 2024 00:30:54 +0000 (09:30 +0900)] 
Merge pull request #31986 from YHNdnzj/suspend-mem-mode

sleep: add SleepMemMode= setting for configuring /sys/power/mem_sleep

5 months agonetwork: save the real rdnss address
Ronan Pigott [Thu, 28 Mar 2024 00:19:43 +0000 (17:19 -0700)] 
network: save the real rdnss address

... instead of the router that informed us

Fixes: 86a66e9b9504 ("network: also save NTP servers and friends obtained by other protocols")
5 months agotest: make coverage runs happy with capsule@.service
Frantisek Sumsal [Thu, 28 Mar 2024 13:57:26 +0000 (14:57 +0100)] 
test: make coverage runs happy with capsule@.service

capsule@.service uses DynamicUser=yes, so let's use the same tweak we
use for other such units.

5 months agologin: Fix fallback error handling
Daan De Meyer [Thu, 28 Mar 2024 16:05:33 +0000 (17:05 +0100)] 
login: Fix fallback error handling

5 months agotest: disable IPv6AcceptRA= for test network interfaces with static address
Yu Watanabe [Thu, 28 Mar 2024 03:52:01 +0000 (12:52 +0900)] 
test: disable IPv6AcceptRA= for test network interfaces with static address

This hopefully improves test performance.

5 months agoMerge pull request #31994 from yuwata/network-dhcp-server-follow-ups
Luca Boccassi [Thu, 28 Mar 2024 12:35:13 +0000 (12:35 +0000)] 
Merge pull request #31994 from yuwata/network-dhcp-server-follow-ups

network: several fixlets for PersistLeases=

5 months agondisc-option: allow to set valid time of options
Yu Watanabe [Sun, 17 Mar 2024 06:23:38 +0000 (15:23 +0900)] 
ndisc-option: allow to set valid time of options

When an option is delegated from an upstream server, its lifetime
may be limited by a time. Such functionality will be used later by
sd-radv.

This also remove 'offset' argument from the option setter
ndisc_option_set_xyz(), and make it update existing option.
See comments in ndisc_option_add_link_layer_address() for more details.

5 months agojournalctl-filter: use add_match_boot_id() instead of add_match_this_boot()
Yu Watanabe [Fri, 22 Mar 2024 08:46:00 +0000 (17:46 +0900)] 
journalctl-filter: use add_match_boot_id() instead of add_match_this_boot()

The function add_match_this_boot() calls sd_journal_add_conjunction(),
hence, we cannot specify multiple devices in the extra match arguments,
e.g., "journalctl /dev/sda /dev/sdb" shows no entry.

5 months agosleep: add SleepMemMode= setting for configuring /sys/power/mem_sleep 31986/head
Mike Yuan [Wed, 27 Mar 2024 11:45:34 +0000 (19:45 +0800)] 
sleep: add SleepMemMode= setting for configuring /sys/power/mem_sleep

The setting is used when /sys/power/state is set to 'mem'
(common for suspend) or /sys/power/disk is set to 'suspend'
(hybrid-sleep). We default to kernel choice here, i.e.
respect what's set through 'mem_sleep_default=' kernel
cmdline option.

5 months agosleep: make write_mode take a path
Mike Yuan [Wed, 27 Mar 2024 11:45:08 +0000 (19:45 +0800)] 
sleep: make write_mode take a path

Similar to the previous commit, preparation
for adding support for /sys/power/mem_sleep.

5 months agosleep-config: make sleep_mode_supported take a path
Mike Yuan [Tue, 26 Mar 2024 16:24:58 +0000 (00:24 +0800)] 
sleep-config: make sleep_mode_supported take a path

Preparation for later commits.

5 months agostring-util: modernize string_contains_word_strv a bit
Mike Yuan [Tue, 26 Mar 2024 16:15:40 +0000 (00:15 +0800)] 
string-util: modernize string_contains_word_strv a bit

Also correct the comment on flags.

5 months agosleep-config: fix potential memory leak
Mike Yuan [Wed, 27 Mar 2024 13:03:30 +0000 (21:03 +0800)] 
sleep-config: fix potential memory leak

Follow-up for 77bd39385eae7b8e3182e66292b9f94bb54e235d

5 months agoman/systemd-sleep: reorder options
Mike Yuan [Wed, 27 Mar 2024 11:59:51 +0000 (19:59 +0800)] 
man/systemd-sleep: reorder options

5 months agosleep-config: make sleep_operation_is_hibernation uppercase
Mike Yuan [Tue, 26 Mar 2024 16:30:06 +0000 (00:30 +0800)] 
sleep-config: make sleep_operation_is_hibernation uppercase

5 months agoudev-event: split out update_clone()
Yu Watanabe [Thu, 28 Mar 2024 05:49:28 +0000 (14:49 +0900)] 
udev-event: split out update_clone()

No functional change, preparation for later commits.

5 months agohomed: Release(): fix assertion failure
Adrian Vovk [Thu, 21 Mar 2024 23:28:38 +0000 (19:28 -0400)] 
homed: Release(): fix assertion failure

This fixes a race condition crash in homed that would happen in the
following sequence of events:

1. Client 1 takes a ref on the home area
2. Client 1 calls some method via dbus
3. Client 2 calls Release()

In homed, the Release() would check if a ref is still held (in this
case: yes it is) and returns an error. Except that is done through a
code-path that asserts that no operations are ongoing. In this case,
it's valid to have an ongoing operation, and so the assertion fails
causing homed to crash.

5 months agorun: fix generated unit name clash after soft-reboot
Luca Boccassi [Wed, 27 Mar 2024 21:14:15 +0000 (21:14 +0000)] 
run: fix generated unit name clash after soft-reboot

When sd-run connects to D-Bus rather than the private socket, it will
generate the transient unit name using the bus ID assigned by the D-Bus
broker/daemon. The issue is that this ID is only unique per D-Bus run,
if the broker/daemon restarts it starts again from 1, and it's a simple
incremental counter for each client.
So if a transient unit run-u6.service starts and fails, and it is not
collected (default on failure), and the system soft-reboots, any new
transient unit might conflict as the counter will restart:

Failed to start transient service unit: Unit run-u6.service was already loaded or has a fragment file.

Get the soft-reboot counter, and if it's greater than zero, append it
to the autogenerated unit name to avoid clashes.

5 months agoMerge pull request #31989 from mrc0mmand/test-loop-dev-check
Yu Watanabe [Thu, 28 Mar 2024 02:19:32 +0000 (11:19 +0900)] 
Merge pull request #31989 from mrc0mmand/test-loop-dev-check

test: check for /dev/loop-control when checking lodev availability

5 months agoMerge pull request #31963 from yuwata/journalctl-authenticate-cleanups
Yu Watanabe [Thu, 28 Mar 2024 02:19:21 +0000 (11:19 +0900)] 
Merge pull request #31963 from yuwata/journalctl-authenticate-cleanups

journalctl-authenticate: several cleanups

5 months agotest-network: add test cases for PersistLeases=no 31994/head
Yu Watanabe [Thu, 28 Mar 2024 02:07:35 +0000 (11:07 +0900)] 
test-network: add test cases for PersistLeases=no

5 months agonetwork: make [DHCPServer] in networkd.conf work
Yu Watanabe [Thu, 28 Mar 2024 01:39:26 +0000 (10:39 +0900)] 
network: make [DHCPServer] in networkd.conf work

Follow-up for a3ed665a29ea9355c78a2a6b3a032b9504499dd6.

Fixes https://github.com/systemd/systemd/pull/31977#discussion_r1542196572.

5 months agonetwork: fix typo
Yu Watanabe [Thu, 28 Mar 2024 01:37:35 +0000 (10:37 +0900)] 
network: fix typo

Follow-up for a3ed665a29ea9355c78a2a6b3a032b9504499dd6.

5 months agoMerge pull request #31985 from DaanDeMeyer/mkosi
Yu Watanabe [Thu, 28 Mar 2024 01:21:34 +0000 (10:21 +0900)] 
Merge pull request #31985 from DaanDeMeyer/mkosi

mkosi: Copy built packages to output directory

5 months agotimedate: fix typo
Yu Watanabe [Thu, 28 Mar 2024 00:54:48 +0000 (09:54 +0900)] 
timedate: fix typo

Follow-up for 3a51e31be9f626cf772733cb289ed64739fab0e4.

5 months agojournalctl-authenticate: return earlier if we are not on a TTY 31963/head
Yu Watanabe [Tue, 26 Mar 2024 14:42:21 +0000 (23:42 +0900)] 
journalctl-authenticate: return earlier if we are not on a TTY

No functional change, just refactoring.

5 months agojournalctl-authenticate: use open_tmpfile_linkable() and link_tmpfile()
Yu Watanabe [Tue, 26 Mar 2024 14:39:43 +0000 (23:39 +0900)] 
journalctl-authenticate: use open_tmpfile_linkable() and link_tmpfile()

This also
- use path_join(),
- rename variables to more descriptive names.

5 months agojournalctl-authenticate: drop unnecessary safe_close()
Yu Watanabe [Tue, 26 Mar 2024 13:40:43 +0000 (22:40 +0900)] 
journalctl-authenticate: drop unnecessary safe_close()

Follow-up for 7560fffcd2531786b9c1ca657667a43e90331326.

Addresses https://github.com/systemd/systemd/pull/31879#discussion_r1539063239.

5 months agojournalctl-authenticate: use is_dir() and refuse symlink for /var/log/journal
Yu Watanabe [Mon, 25 Mar 2024 13:15:51 +0000 (22:15 +0900)] 
journalctl-authenticate: use is_dir() and refuse symlink for /var/log/journal

I am not sure it is explicitly documented that /var/log/journal should
be a directory, rather than a symlink to a directory, but the current
code of journald seems not to support symlinked directory well. Let's
refuse that at least here and now.

5 months agoanalyze: fix plot with soft-reboot
Luca Boccassi [Wed, 27 Mar 2024 16:35:20 +0000 (16:35 +0000)] 
analyze: fix plot with soft-reboot

Clamp times and start counting from when soft-reboot is started
to avoid creating a huge graph, like it's done for the user
instance.

5 months agotest: cleanup the test script a bit 31989/head
Frantisek Sumsal [Wed, 27 Mar 2024 19:13:24 +0000 (20:13 +0100)] 
test: cleanup the test script a bit

5 months agotest: check for /dev/loop-control when checking lodev availability
Frantisek Sumsal [Wed, 27 Mar 2024 18:35:30 +0000 (19:35 +0100)] 
test: check for /dev/loop-control when checking lodev availability

losetup in util-linux 2.40 started reporting lost loop devices [0] and
it has an unfortunate side-effect where it reports lost devices even in
containers, which then makes the loop device check "falsely" pass [1].

Let's just check for /dev/loop-control explicitly to "work around" this.

[0] https://github.com/util-linux/util-linux/commit/a6ca0456cc6d704a786f6b66d8bb2d89ff18eba7
[1] https://github.com/util-linux/util-linux/issues/2824

5 months agotimedated: Respond on org.freedesktop.timedate1.SetNTP only when really finished
Michal Koutný [Tue, 20 Feb 2024 18:26:16 +0000 (19:26 +0100)] 
timedated: Respond on org.freedesktop.timedate1.SetNTP only when really finished

The method returns prematurely (before jobs it triggers terminate). This
is externally visible because other methods may fail if jobs did not
finish.
Postpone the DBus method response until we collect all signals for
finished jobs.
systemd-timedated keeps track of in-flight DBus requests and answers
them all in unspecified order when jobs finish. The capacity of requests
in systemd-timedated is limited.

Fixes: #17739
5 months agomkosi: Copy built packages to output directory 31985/head
Daan De Meyer [Wed, 27 Mar 2024 13:05:44 +0000 (14:05 +0100)] 
mkosi: Copy built packages to output directory

This allows the built packages to be inspected if needed, or installed
on the host system for anyone who's daring enough to do so.

5 months agomkosi: Update to latest
Daan De Meyer [Wed, 27 Mar 2024 14:49:06 +0000 (15:49 +0100)] 
mkosi: Update to latest

5 months agonetwork/dhcp-server: introduce PersistLeases= setting
Yu Watanabe [Fri, 15 Mar 2024 17:32:50 +0000 (02:32 +0900)] 
network/dhcp-server: introduce PersistLeases= setting

Requested at https://github.com/systemd/systemd/pull/31772#issuecomment-2000053357.

5 months agojournalctl-show/util: add missing header
Antonio Alvarez Feijoo [Wed, 27 Mar 2024 07:45:19 +0000 (08:45 +0100)] 
journalctl-show/util: add missing header

```
[1237/2836] Compiling C object journalctl.p/src_journal_journalctl-show.c.o
FAILED: journalctl.p/src_journal_journalctl-show.c.o
cc -Ijournalctl.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -Wno-missing-field-initializers -Wno-unused-parameter -Wno-nonnull-compare -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Wno-unused-result -Werror=shadow -fno-strict-aliasing -fvisibility=hidden -fno-omit-frame-pointer -include config.h -pthread -MD -MQ journalctl.p/src_journal_journalctl-show.c.o -MF journalctl.p/src_journal_journalctl-show.c.o.d -o journalctl.p/src_journal_journalctl-show.c.o -c ../src/journal/journalctl-show.c
../src/journal/journalctl-show.c: In function ‘setup_event’:
../src/journal/journalctl-show.c:330:38: error: ‘STDOUT_FILENO’ undeclared (first use in this function)
  330 |         r = sd_event_add_io(e, NULL, STDOUT_FILENO, EPOLLHUP|EPOLLERR, NULL, INT_TO_PTR(-ECANCELED));
      |                                      ^~~~~~~~~~~~~
../src/journal/journalctl-show.c:330:38: note: each undeclared identifier is reported only once for each function it appears in
[1238/2836] Compiling C object journalctl.p/src_journal_journalctl-util.c.o
FAILED: journalctl.p/src_journal_journalctl-util.c.o
cc -Ijournalctl.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -Wno-missing-field-initializers -Wno-unused-parameter -Wno-nonnull-compare -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Wno-unused-result -Werror=shadow -fno-strict-aliasing -fvisibility=hidden -fno-omit-frame-pointer -include config.h -pthread -MD -MQ journalctl.p/src_journal_journalctl-util.c.o -MF journalctl.p/src_journal_journalctl-util.c.o.d -o journalctl.p/src_journal_journalctl-util.c.o -c ../src/journal/journalctl-util.c
../src/journal/journalctl-util.c: In function ‘acquire_journal’:
../src/journal/journalctl-util.c:36:60: error: ‘STDIN_FILENO’ undeclared (first use in this function)
   36 |                 r = sd_journal_open_files_fd(&j, (int[]) { STDIN_FILENO }, 1, arg_journal_additional_open_flags);
      |                                                            ^~~~~~~~~~~~
../src/journal/journalctl-util.c:36:60: note: each undeclared identifier is reported only once for each function it appears in
```

Fixes ade2db83fe7fa5011490f94fbeb5cf9263f26514

5 months agosd-ndisc-router: introduce sd_ndisc_router_set_sender_address()
Yu Watanabe [Wed, 6 Mar 2024 03:28:51 +0000 (12:28 +0900)] 
sd-ndisc-router: introduce sd_ndisc_router_set_sender_address()

Currently this is not used, but will be used later to modify the sender
address.

5 months agondisc-option: add HomeAgent option support
Yu Watanabe [Sat, 16 Mar 2024 06:52:18 +0000 (15:52 +0900)] 
ndisc-option: add HomeAgent option support

Currently, these are not used, but will be used later in sd-radv.

5 months agoMerge pull request #31965 from yuwata/logs-show-cleanups
Luca Boccassi [Wed, 27 Mar 2024 13:09:56 +0000 (13:09 +0000)] 
Merge pull request #31965 from yuwata/logs-show-cleanups

logs-show: several cleanups

5 months agoMerge pull request #31964 from yuwata/journalctl-filter-cleanups
Luca Boccassi [Wed, 27 Mar 2024 13:07:43 +0000 (13:07 +0000)] 
Merge pull request #31964 from yuwata/journalctl-filter-cleanups

journalctl-filter: several cleanups

5 months agoMerge pull request #31954 from DaanDeMeyer/mkosi
Daan De Meyer [Wed, 27 Mar 2024 12:27:44 +0000 (13:27 +0100)] 
Merge pull request #31954 from DaanDeMeyer/mkosi

mkosi: Re-enable OpenSUSE build

5 months agomkosi: Specify --without docs if needed for fedora/centos 31954/head
Daan De Meyer [Wed, 27 Mar 2024 12:00:11 +0000 (13:00 +0100)] 
mkosi: Specify --without docs if needed for fedora/centos

5 months agoUpdate pkg/fedora to latest
Daan De Meyer [Wed, 27 Mar 2024 11:58:17 +0000 (12:58 +0100)] 
Update pkg/fedora to latest

5 months agomkosi: Merge base and system images
Daan De Meyer [Wed, 27 Mar 2024 10:07:52 +0000 (11:07 +0100)] 
mkosi: Merge base and system images

The only reason to have these split up is to be able to build extension
images that use the base image as a base tree and install extra packages.
Until we have such a use case, let's merge the base and system images to
simplify things a bit.

We keep the mkosi.images/ directory to not cause too many conflicts with
the integration tests PR.

5 months agomkosi: Re-enable OpenSUSE build
Daan De Meyer [Tue, 26 Mar 2024 09:42:00 +0000 (10:42 +0100)] 
mkosi: Re-enable OpenSUSE build

5 months agomkosi: Update to latest
Daan De Meyer [Tue, 26 Mar 2024 10:16:55 +0000 (11:16 +0100)] 
mkosi: Update to latest

5 months agoMerge pull request #31980 from bluca/soft_reboot_timestamps
Luca Boccassi [Wed, 27 Mar 2024 10:30:12 +0000 (10:30 +0000)] 
Merge pull request #31980 from bluca/soft_reboot_timestamps

soft-reboot: fix timestamps accounting for sd-analyze, add new timestamp, add new counter

5 months agobuild(deps): bump pkg/debian from `1932e19` to `44fe1d4`
dependabot[bot] [Wed, 27 Mar 2024 09:12:48 +0000 (09:12 +0000)] 
build(deps): bump pkg/debian from `1932e19` to `44fe1d4`

Bumps pkg/debian from `1932e19` to `44fe1d4`.

---
updated-dependencies:
- dependency-name: pkg/debian
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agocore: add counter for soft-reboot iterations 31980/head
Luca Boccassi [Wed, 27 Mar 2024 00:30:45 +0000 (00:30 +0000)] 
core: add counter for soft-reboot iterations

Allow to query via D-Bus how many times the current booted system has
been soft rebooted

5 months agoanalyze: show only current times after soft-reboot
Luca Boccassi [Tue, 26 Mar 2024 22:32:04 +0000 (22:32 +0000)] 
analyze: show only current times after soft-reboot

The firmware/loader/kernel times are no longer relevant for the startup
sequence on soft-reboot, so use only the userspace timestamps

5 months agocore: add SoftRebootStartTimestamp
Luca Boccassi [Tue, 26 Mar 2024 22:30:43 +0000 (22:30 +0000)] 
core: add SoftRebootStartTimestamp

Will be useful to calculate how long it took to shut down the system before starting
in the new root

5 months agocore: do not serialize timestamps that are re-measured on soft-reboot
Luca Boccassi [Tue, 26 Mar 2024 22:28:58 +0000 (22:28 +0000)] 
core: do not serialize timestamps that are re-measured on soft-reboot

Otherwise the de-serialization overwrites the timestamps taken after
soft-reboot (e.g.: userspace start/finish) and sd-analyze shows bogus
data

5 months agoMerge pull request #31789 from jsitnicki/socket-pass-fds-to-exec
Yu Watanabe [Wed, 27 Mar 2024 01:18:13 +0000 (10:18 +0900)] 
Merge pull request #31789 from jsitnicki/socket-pass-fds-to-exec

Pass socket FDs to all ExecXYZ= commands in socket unit but ExecStartPre=

5 months agoresolved: always return the validated answers when validating
Ronan Pigott [Tue, 26 Mar 2024 07:33:19 +0000 (00:33 -0700)] 
resolved: always return the validated answers when validating

We normally expect sd-resolved only to return the validated subset of a
validated response. In some cases we give up on validating, because we
have enough information already to conclude the answer is bogus.

Let's be sure to always reply with only the validated subset in these
cases too, so that we don't return bogus answers and confuse primitive
clients that won't see the SERVFAIL rcode.

5 months agoresolved: minor dnssec fixups
Ronan Pigott [Tue, 26 Mar 2024 18:00:44 +0000 (11:00 -0700)] 
resolved: minor dnssec fixups

Fixes: ce5b9d5b3c24 ("resolved: request DS with DNSKEY")
5 months agoshared/logs-show: restore infinite loop avoidance for corrupted journals
Zbigniew Jędrzejewski-Szmek [Tue, 26 Mar 2024 17:46:23 +0000 (18:46 +0100)] 
shared/logs-show: restore infinite loop avoidance for corrupted journals

Fixes a bug introduced in e44f06065bf20e8d0e4adacff61350ebd36f299e: it was
supposed to be a refactoring, but unfortunately FOREACH_ARRAY is implemented
using a for loop, so when the 'goto finish' was replaced by 'break', it only
broke the inner loop, leading to a infinite loop.

5 months agohome: fix typo
Yu Watanabe [Tue, 26 Mar 2024 19:07:49 +0000 (04:07 +0900)] 
home: fix typo

Follow-up for 5ec87d577f92effe27a62e965e02a6f9a40f81cc.

5 months agotest: integration test for PassFileDescriptorsToExec= option 31789/head
Jakub Sitnicki [Thu, 14 Mar 2024 10:20:50 +0000 (11:20 +0100)] 
test: integration test for PassFileDescriptorsToExec= option

Check if socket file descriptors are passed to ExecXYZ= commands from the
socket unit depending on whether PassFileDescriptorsToExec= option is set.

5 months agosocket: pass socket FDs to all ExecXYZ= commands but ExecStartPre=
Jakub Sitnicki [Thu, 15 Feb 2024 17:02:50 +0000 (18:02 +0100)] 
socket: pass socket FDs to all ExecXYZ= commands but ExecStartPre=

Today listen file descriptors created by socket unit don't get passed to
commands in Exec{Start,Stop}{Pre,Post}= socket options.

This prevents ExecXYZ= commands from accessing the created socket FDs to do
any kind of system setup which involves the socket but is not covered by
existing socket unit options.

One concrete example is to insert a socket FD into a BPF map capable of
holding socket references, such as BPF sockmap/sockhash [1] or
reuseport_sockarray [2]. Or, similarly, send the file descriptor with
SCM_RIGHTS to another process, which has access to a BPF map for storing
sockets.

To unblock this use case, pass ListenXYZ= file descriptors to ExecXYZ=
commands as listen FDs [4]. As an exception, ExecStartPre= command does not
inherit any file descriptors because it gets invoked before the listen FDs
are created.

This new behavior can potentially break existing configurations. Commands
invoked from ExecXYZ= might not expect to inherit file descriptors through
sd_listen_fds protocol.

To prevent breakage, add a new socket unit parameter,
PassFileDescriptorsToExec=, to control whether ExecXYZ= programs inherit
listen FDs.

[1] https://docs.kernel.org/bpf/map_sockmap.html
[2] https://lore.kernel.org/r/20180808075917.3009181-1-kafai@fb.com
[3] https://man.archlinux.org/man/socket.7#SO_INCOMING_CPU
[4] https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.html

5 months agoMerge pull request #31951 from bluca/resolve_reload
Yu Watanabe [Tue, 26 Mar 2024 17:37:52 +0000 (02:37 +0900)] 
Merge pull request #31951 from bluca/resolve_reload

resolved: support reloading configuration at runtime

5 months agoMerge pull request #31959 from YHNdnzj/execute-pass-fds
Yu Watanabe [Tue, 26 Mar 2024 17:37:23 +0000 (02:37 +0900)] 
Merge pull request #31959 from YHNdnzj/execute-pass-fds

core/execute: check if EXEC_PASS_FDS is set if got exec_params.fds

5 months agoMerge pull request #31960 from YHNdnzj/capsule-followup
Yu Watanabe [Tue, 26 Mar 2024 17:34:43 +0000 (02:34 +0900)] 
Merge pull request #31960 from YHNdnzj/capsule-followup

Some follow-ups for capsule

5 months agodissect: fix memory leak
Antonio Alvarez Feijoo [Tue, 26 Mar 2024 13:53:44 +0000 (14:53 +0100)] 
dissect: fix memory leak

5 months agoefi: skip check-alignment-* tests if pefile is not installed
Antonio Alvarez Feijoo [Tue, 26 Mar 2024 15:08:57 +0000 (16:08 +0100)] 
efi: skip check-alignment-* tests if pefile is not installed

Otherwise, when building with ukify disabled, no one else requires pefile, and
if it is not installed, those tests fail:

```
================================== 12/1212 ===================================
test:         systemd:efi / check-alignment-systemd-bootx64.efi
start time:   14:21:54
duration:     0.08s
result:       exit status 1
command:      /mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py /mnt/work/systemd/upstream-fork/main/build/src/boot/efi/systemd-bootx64.efi
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
  File "/mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py", line 7, in <module>
    import pefile
ModuleNotFoundError: No module named 'pefile'
==============================================================================

================================== 13/1212 ===================================
test:         systemd:efi / check-alignment-linuxx64.efi.stub
start time:   14:21:54
duration:     0.08s
result:       exit status 1
command:      /mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py /mnt/work/systemd/upstream-fork/main/build/src/boot/efi/linuxx64.efi.stub
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
  File "/mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py", line 7, in <module>
    import pefile
ModuleNotFoundError: No module named 'pefile'
==============================================================================

================================== 14/1212 ===================================
test:         systemd:efi / check-alignment-addonx64.efi.stub
start time:   14:21:54
duration:     0.07s
result:       exit status 1
command:      /mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py /mnt/work/systemd/upstream-fork/main/build/src/boot/efi/addonx64.efi.stub
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
  File "/mnt/work/systemd/upstream-fork/main/tools/check-efi-alignment.py", line 7, in <module>
    import pefile
ModuleNotFoundError: No module named 'pefile'
==============================================================================
```

Follow-up for 7ff3b88396f440bff60328b4bff7627a34d45e4a

5 months agohwdb: fix Asus T300FA rotation matrix (#31973)
Luxiter [Tue, 26 Mar 2024 17:32:03 +0000 (18:32 +0100)] 
hwdb: fix Asus T300FA rotation matrix (#31973)

Closes #31972.

5 months agologs-show: read the current boot ID if nothing specified for add_match_boot_id() 31965/head
Yu Watanabe [Fri, 22 Mar 2024 08:40:37 +0000 (17:40 +0900)] 
logs-show: read the current boot ID if nothing specified for add_match_boot_id()

No functional change, just refactoring.