]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agotest: add more test cases for mkdir_p_safe() and mkdir_p_root() 24744/head
Yu Watanabe [Thu, 25 Aug 2022 22:19:59 +0000 (07:19 +0900)] 
test: add more test cases for mkdir_p_safe() and mkdir_p_root()

3 years agomkdir: chase_symlinks_and_stat() does not return 0
Yu Watanabe [Thu, 25 Aug 2022 22:50:32 +0000 (07:50 +0900)] 
mkdir: chase_symlinks_and_stat() does not return 0

This reverts commits e22916e61d1fdb7b46918b605ebf783d9017f9d8 and
1e146d738232acbe7f72903e9c5e4d1166ea67f5.

3 years agoMerge pull request #24742 from keszybz/hwdb-252
Yu Watanabe [Mon, 19 Sep 2022 13:51:13 +0000 (22:51 +0900)] 
Merge pull request #24742 from keszybz/hwdb-252

hwdb update for v252-rc1

3 years agotpm2-util: make tpm2_pcr_bank_from_string() case-insensitive
Lennart Poettering [Fri, 16 Sep 2022 21:42:05 +0000 (23:42 +0200)] 
tpm2-util: make tpm2_pcr_bank_from_string() case-insensitive

This way we can use it directly in measure.c, and thus remove a bit of
redundant code.

OpenSSL prefers uppercasing the MD names, others don't hence let's be
lenient here.

3 years agohwdb: run "update-hwdb-autosuspend" 24742/head
Zbigniew Jędrzejewski-Szmek [Thu, 18 Aug 2022 08:47:36 +0000 (10:47 +0200)] 
hwdb: run "update-hwdb-autosuspend"

3 years agohwdb: run "update-hwdb"
Zbigniew Jędrzejewski-Szmek [Mon, 19 Sep 2022 10:26:33 +0000 (12:26 +0200)] 
hwdb: run "update-hwdb"

As usual, it seems to be mostly additions and corrections. Sadly, it seems a
bit of mojibake has crept in in various places. But it's hard to correct, in
particular because it's hard to detect all cases automatically. I think we can
ignore this for now.

When I run this a few weeks ago, ma-large.txt was gutted and 20-OUI.hwdb was
siginificantly smaller. For whatever reasons, it's back to normal now.

3 years agoalso provide credentials in ExecStartPre
Jörg Thalheim [Fri, 16 Sep 2022 12:41:58 +0000 (14:41 +0200)] 
also provide credentials in ExecStartPre

Systemd's credential interface is not yet natively supported by all
programs yet. Hence it's often required to run scripts to massage
secrets in the way the programs expect it.

This commit allows the ExecStartPre commands to access credentials.

Fixes https://github.com/systemd/systemd/issues/19604

3 years agotest: add testcase for link priority
Yu Watanabe [Fri, 15 Apr 2022 02:13:29 +0000 (11:13 +0900)] 
test: add testcase for link priority

3 years agoMerge pull request #24646 from yuwata/udev-node-symlink_atomic
Yu Watanabe [Sun, 18 Sep 2022 20:25:58 +0000 (05:25 +0900)] 
Merge pull request #24646 from yuwata/udev-node-symlink_atomic

udev: introduce symlink_atomic_full() and use it

3 years agoMerge pull request #24725 from yuwata/blockdev-util-introduce-block_device_get_whole_disk
Yu Watanabe [Sun, 18 Sep 2022 20:25:09 +0000 (05:25 +0900)] 
Merge pull request #24725 from yuwata/blockdev-util-introduce-block_device_get_whole_disk

blockdev-util: introduce block_device_get_whole_disk()

3 years agoMerge pull request #24730 from yuwata/dissect-image-drop-reference-to-decrypted-image
Yu Watanabe [Sun, 18 Sep 2022 20:24:35 +0000 (05:24 +0900)] 
Merge pull request #24730 from yuwata/dissect-image-drop-reference-to-decrypted-image

dissect-image: introduce dissected_image_relinquish()

3 years agoman/systemd-run: Refer to man-pages project (man7.org) when citing bash(1)
BerndAdameit [Sun, 18 Sep 2022 10:20:32 +0000 (12:20 +0200)] 
man/systemd-run: Refer to man-pages project (man7.org) when citing bash(1)

3 years agopath-util: add examples for path_make_relative() and path_make_relative_parent()
Yu Watanabe [Sun, 18 Sep 2022 14:19:13 +0000 (23:19 +0900)] 
path-util: add examples for path_make_relative() and path_make_relative_parent()

Addresses https://github.com/systemd/systemd/pull/24646#discussion_r973691797.

3 years agotree-wide: drop unused reference to DecryptedImage 24730/head
Yu Watanabe [Sun, 11 Sep 2022 15:07:17 +0000 (00:07 +0900)] 
tree-wide: drop unused reference to DecryptedImage

3 years agotree-wide: use dissected_image_relinquish()
Yu Watanabe [Sun, 11 Sep 2022 14:42:01 +0000 (23:42 +0900)] 
tree-wide: use dissected_image_relinquish()

3 years agodissect-image: introduce dissected_image_relinquish()
Yu Watanabe [Sun, 11 Sep 2022 14:23:22 +0000 (23:23 +0900)] 
dissect-image: introduce dissected_image_relinquish()

3 years agoudev: do not ignore -ENOENT from sd_device_get_devname() for block device 24725/head
Yu Watanabe [Sun, 18 Sep 2022 14:32:21 +0000 (23:32 +0900)] 
udev: do not ignore -ENOENT from sd_device_get_devname() for block device

We already checked that the sd_device object 'dev' is for a whole block
device. So, -ENOENT should not be triggeered here, and if it is, there
exists something spurious. Hence we should not ignore the failure.

3 years agoudev: use block_device_get_whole_disk()
Yu Watanabe [Sun, 18 Sep 2022 04:24:12 +0000 (13:24 +0900)] 
udev: use block_device_get_whole_disk()

This should not change anything effectively.

3 years agoudev-node: use symlink_atomic_full_label() to create devlink 24646/head
Yu Watanabe [Mon, 11 Apr 2022 03:18:13 +0000 (12:18 +0900)] 
udev-node: use symlink_atomic_full_label() to create devlink

If the filename of a device symlink is too long, then the temporary
filename may become invalid, and we fail to create symlink.

The function `tempfn_random()` used in symlink_atomic_full() generates
a safe temporary filename.

Note that, thanks to the PR #23043, now only one worker can handle
the same symlink simultaneously. Hence, the device ID based temporary
filename is not necessary.

3 years agoMerge pull request #24720 from yuwata/dissect-image-take-reference
Daan De Meyer [Sun, 18 Sep 2022 14:08:13 +0000 (16:08 +0200)] 
Merge pull request #24720 from yuwata/dissect-image-take-reference

dissect-image: make DissectedImage object take reference to DecryptedImage and LoopDevice

3 years agoblockdev-util: change return value when a partition device is passed to partition_enu...
Yu Watanabe [Sun, 18 Sep 2022 13:48:53 +0000 (22:48 +0900)] 
blockdev-util: change return value when a partition device is passed to partition_enumerator_new()

To make it consistent what returned by block_device_get_whole_disk().

3 years agoblockdev-util: introduce block_device_get_whole_disk()
Yu Watanabe [Sun, 18 Sep 2022 07:25:40 +0000 (16:25 +0900)] 
blockdev-util: introduce block_device_get_whole_disk()

3 years agoblockdev-util: split-out block_device_is_whole_disk()
Yu Watanabe [Sun, 18 Sep 2022 07:18:53 +0000 (16:18 +0900)] 
blockdev-util: split-out block_device_is_whole_disk()

No functional changes, just preparation for later commits.

3 years agoMerge pull request #24719 from yuwata/dissect-image-dissected-image-new
Yu Watanabe [Sun, 18 Sep 2022 13:41:49 +0000 (22:41 +0900)] 
Merge pull request #24719 from yuwata/dissect-image-dissected-image-new

dissect-image: introduce dissected_image_new()

3 years agosd-device: refuse block device without subsystem
Yu Watanabe [Sun, 18 Sep 2022 00:03:05 +0000 (09:03 +0900)] 
sd-device: refuse block device without subsystem

Previously, even if sd_device_get_subsystem() returns -ENOENT for block
device, we accepted that. This makes the check slightly stricter.

3 years agoMerge pull request #24691 from yuwata/udev-node-check-existence
Daan De Meyer [Sun, 18 Sep 2022 09:38:56 +0000 (11:38 +0200)] 
Merge pull request #24691 from yuwata/udev-node-check-existence

udev: check existence of device node

3 years agoMerge pull request #24710 from yuwata/test-50-dissect-cleanups
Daan De Meyer [Sun, 18 Sep 2022 09:21:30 +0000 (11:21 +0200)] 
Merge pull request #24710 from yuwata/test-50-dissect-cleanups

TEST-50-DISSECT: cleanups

3 years agodissect-image: free crypt_device object before trying to activate with unique name
Yu Watanabe [Sat, 17 Sep 2022 00:01:46 +0000 (09:01 +0900)] 
dissect-image: free crypt_device object before trying to activate with unique name

Otherwise we get error from libcryptsetup like the following:
systemd[1234]: Cannot use device /dev/loop5 which is in use (already mapped or mounted).

3 years agoudev: downgrade log level when device node is already removed
Yu Watanabe [Sat, 17 Sep 2022 21:03:14 +0000 (06:03 +0900)] 
udev: downgrade log level when device node is already removed

Follow-up for 790da548b0c37af60aed2f46867ba3885ea78718.

3 years agodissect-image: introduce DISSECTED_PARTITION_NULL 24719/head
Yu Watanabe [Fri, 9 Sep 2022 22:05:12 +0000 (07:05 +0900)] 
dissect-image: introduce DISSECTED_PARTITION_NULL

Currently, it is not necessary to set partno or architecture in
dissect_image_new(), but just for safety.
Preparation for later commits.

3 years agodissect-image: split out dissected_image_new()
Yu Watanabe [Fri, 9 Sep 2022 20:41:09 +0000 (05:41 +0900)] 
dissect-image: split out dissected_image_new()

To make dissect_image() shorter.
No functional changes, just refactoring.

3 years agodissect-image: take a reference of LoopDevice into DissectedImage 24720/head
Yu Watanabe [Sun, 11 Sep 2022 13:46:39 +0000 (22:46 +0900)] 
dissect-image: take a reference of LoopDevice into DissectedImage

To make LoopDevice object freed after DissectedImage is freed.
At least currently, this should not change anything. Preparation for
later commits.

3 years agoloop-util: introduce reference counter for LoopDevice
Yu Watanabe [Sun, 11 Sep 2022 13:41:03 +0000 (22:41 +0900)] 
loop-util: introduce reference counter for LoopDevice

3 years agodissect-image: take reference of DecryptedImage into DissectedImage
Yu Watanabe [Sun, 11 Sep 2022 14:08:25 +0000 (23:08 +0900)] 
dissect-image: take reference of DecryptedImage into DissectedImage

No functional changes. Preparation for later commits.

3 years agodissect-image: introduce reference counter for DecryptedImage
Yu Watanabe [Sun, 11 Sep 2022 14:07:29 +0000 (23:07 +0900)] 
dissect-image: introduce reference counter for DecryptedImage

3 years agodissect-image: lazily deactivate decrypted DM volumes 24667/head
Yu Watanabe [Wed, 14 Sep 2022 02:48:16 +0000 (11:48 +0900)] 
dissect-image: lazily deactivate decrypted DM volumes

The DM block device may be still used by other processes.

3 years agomeasure: rename measure_pcr() to measure_kernel()
Lennart Poettering [Sat, 17 Sep 2022 13:20:32 +0000 (15:20 +0200)] 
measure: rename measure_pcr() to measure_kernel()

Let's say what we actually measure, not what into (which is obvious
anyway).

This is generally more descriptive, but also good for later work that
allows measuring the boot phase too.

3 years agocryptsetup-util: introduce crypt_free_and_replace()
Yu Watanabe [Fri, 16 Sep 2022 18:24:26 +0000 (03:24 +0900)] 
cryptsetup-util: introduce crypt_free_and_replace()

3 years agoMerge pull request #24622 from yuwata/udev-open-with-noctty
Lennart Poettering [Sat, 17 Sep 2022 17:03:15 +0000 (19:03 +0200)] 
Merge pull request #24622 from yuwata/udev-open-with-noctty

udev: open with O_NOCTTY

3 years agoMerge pull request #24708 from keszybz/not-available-in-tables
Zbigniew Jędrzejewski-Szmek [Sat, 17 Sep 2022 16:16:42 +0000 (18:16 +0200)] 
Merge pull request #24708 from keszybz/not-available-in-tables

various: use "-" instead of "n/a" in tables

3 years agotest-50-dissect: do not fail test on cleanup 24710/head
Yu Watanabe [Sat, 17 Sep 2022 12:27:31 +0000 (21:27 +0900)] 
test-50-dissect: do not fail test on cleanup

These paths are read-only mount points. Hence, we cannot remove the
contents.

3 years agotest-50-dissect: check mount destination instead of mount source
Yu Watanabe [Sun, 11 Sep 2022 15:37:01 +0000 (00:37 +0900)] 
test-50-dissect: check mount destination instead of mount source

And rebreak long lines.

This should take no effective change, just refactoring.

3 years agoMerge pull request #24670 from keszybz/early-boot-ordering
Zbigniew Jędrzejewski-Szmek [Sat, 17 Sep 2022 11:26:51 +0000 (13:26 +0200)] 
Merge pull request #24670 from keszybz/early-boot-ordering

Early boot ordering

3 years agocoredumpctl: rename table entry 24708/head
Zbigniew Jędrzejewski-Szmek [Sat, 17 Sep 2022 10:20:33 +0000 (12:20 +0200)] 
coredumpctl: rename table entry

"Disk Size" could be mistaken for "Size of the Disk".

3 years agovarious: use "-" instead of "n/a" in tables
Zbigniew Jędrzejewski-Szmek [Sat, 17 Sep 2022 09:06:39 +0000 (11:06 +0200)] 
various: use "-" instead of "n/a" in tables

In the context of a table, both would be generally understood to have the same
meaning. "n/a" is a strange beast. It was useful when tables were produced on
the typewriter with "---------" used to separate rows. It is visually more
pleasing to use "-", and there is no risk of it being mistaken for a row
separator.

3 years agoMerge pull request #24703 from yuwata/dissect-image-verity-partition-make-fail
Daan De Meyer [Sat, 17 Sep 2022 07:57:20 +0000 (09:57 +0200)] 
Merge pull request #24703 from yuwata/dissect-image-verity-partition-make-fail

dissect-image: make verity_partition() actually fail when all attempts of activation failed

3 years agofd-util: rename CLOSE_AND_REPLACE() -> close_and_replace()
Yu Watanabe [Fri, 16 Sep 2022 16:57:04 +0000 (01:57 +0900)] 
fd-util: rename CLOSE_AND_REPLACE() -> close_and_replace()

We have free_and_replace() and friends, they are all named with lower
letters, even they are macros, not functions.
For consistency, let's rename CLOSE_AND_REPLACE() with lower letters.

This also mekes the macro used more places.

3 years agodissect-image: make verity_partition() actually fail when all attempts of activation... 24703/head
Yu Watanabe [Fri, 16 Sep 2022 20:11:43 +0000 (05:11 +0900)] 
dissect-image: make verity_partition() actually fail when all attempts of activation failed

3 years agodissect-image: split out verity_timeout()
Yu Watanabe [Fri, 16 Sep 2022 18:24:57 +0000 (03:24 +0900)] 
dissect-image: split out verity_timeout()

To make verity_partition() shorten. No functional changes, just
refactoring.

3 years agoman: explicitly document that "reboot -f" is different from "systemctl reboot -f"
Yu Watanabe [Fri, 16 Sep 2022 16:25:44 +0000 (01:25 +0900)] 
man: explicitly document that "reboot -f" is different from "systemctl reboot -f"

Closes #24696.

3 years agonspawn: fix two error strings
Lennart Poettering [Fri, 16 Sep 2022 16:08:19 +0000 (18:08 +0200)] 
nspawn: fix two error strings

3 years agoadd CAP_LINUX_IMMUTABLE to systemd-machined, so it can handle machinectl read-only...
Dan Streetman [Fri, 16 Sep 2022 14:50:59 +0000 (10:50 -0400)] 
add CAP_LINUX_IMMUTABLE to systemd-machined, so it can handle machinectl read-only requests

Without this, the 'machinectl read-only ...' command always fails.

3 years agosd-netlink: unexport sd-netlink
Yu Watanabe [Fri, 16 Sep 2022 14:20:46 +0000 (23:20 +0900)] 
sd-netlink: unexport sd-netlink

This effectively reverts 84e1001541151da71bae2137e2a1c254b5a3b89f.

The sd-netlink library has several issues, and we should not export it
without solving them. See issues #24258 and #24124.

3 years agoMerge pull request #24692 from yuwata/dissect-image-fix-memleak
Yu Watanabe [Fri, 16 Sep 2022 16:31:32 +0000 (01:31 +0900)] 
Merge pull request #24692 from yuwata/dissect-image-fix-memleak

dissect-image: fix memleak

3 years agoupdate TODO
Lennart Poettering [Fri, 16 Sep 2022 15:24:08 +0000 (16:24 +0100)] 
update TODO

Seeding RNG via SMBIOS is bad idea, since often measurement of SMBIOS
tables is used for TPM policies, under the assumption SMBIOS remains
static after a certain point.

3 years agotmpfiles: let's suffix path to dirs with '/' also in log messages
Lennart Poettering [Fri, 16 Sep 2022 12:53:35 +0000 (13:53 +0100)] 
tmpfiles: let's suffix path to dirs with '/' also in log messages

3 years agotmpfiles: drop redundant forward declarations
Lennart Poettering [Sun, 11 Sep 2022 10:16:17 +0000 (12:16 +0200)] 
tmpfiles: drop redundant forward declarations

3 years agoMerge pull request #24664 from yuwata/watchdog
Yu Watanabe [Fri, 16 Sep 2022 15:18:53 +0000 (00:18 +0900)] 
Merge pull request #24664 from yuwata/watchdog

watchdog: open /dev/watchdog0 only if it exists

3 years agoMerge pull request #24688 from yuwata/watchdog-dbus-properties-follow-ups
Yu Watanabe [Fri, 16 Sep 2022 15:18:05 +0000 (00:18 +0900)] 
Merge pull request #24688 from yuwata/watchdog-dbus-properties-follow-ups

pid1: follow-ups for watchdog DBus properties

3 years agojournalctl: respect --quiet flag during file concistency verification
Daniel Braunwarth [Fri, 16 Sep 2022 09:15:06 +0000 (11:15 +0200)] 
journalctl: respect --quiet flag during file concistency verification

Fixes #24563.

3 years agoMerge pull request #24685 from yuwata/uid-range
Yu Watanabe [Fri, 16 Sep 2022 15:16:07 +0000 (00:16 +0900)] 
Merge pull request #24685 from yuwata/uid-range

uid-range: several cleanups

3 years agodissect-image: handle all non-negative return values as success 24692/head
Yu Watanabe [Wed, 14 Sep 2022 03:25:08 +0000 (12:25 +0900)] 
dissect-image: handle all non-negative return values as success

No functional changes, just coding syle update.

3 years agodissect-image: fix memleak on failure
Yu Watanabe [Wed, 14 Sep 2022 03:21:56 +0000 (12:21 +0900)] 
dissect-image: fix memleak on failure

3 years agoudev-node: do not create symlink to a non-existing device node 24691/head
Yu Watanabe [Tue, 13 Sep 2022 21:07:09 +0000 (06:07 +0900)] 
udev-node: do not create symlink to a non-existing device node

Previously, the stack directory contains empty regular files named with
device ID, and we create sd_device object from the device name.
Hence, we implicitly checked the existence of the device node.

However, now the files in the stack directory are symlink, and we
retrieve the path to the device node and its priority from the symlink.
Hence, the existence of the device node is not checked.
Let's check if the device node is still exist.

3 years agoudev-node: split out stack_directory_read_one()
Yu Watanabe [Mon, 12 Sep 2022 19:42:38 +0000 (04:42 +0900)] 
udev-node: split out stack_directory_read_one()

No functional changes, just refactoring.

3 years agowatchdog: use /dev/watchdog0 only if it exists 24664/head
Yu Watanabe [Tue, 13 Sep 2022 19:55:35 +0000 (04:55 +0900)] 
watchdog: use /dev/watchdog0 only if it exists

Fixes #24661.

3 years agoupdate TODO
Lennart Poettering [Thu, 15 Sep 2022 18:22:35 +0000 (19:22 +0100)] 
update TODO

3 years agopid1: drop redundant DBus properties 24688/head
Yu Watanabe [Fri, 16 Sep 2022 12:50:58 +0000 (21:50 +0900)] 
pid1: drop redundant DBus properties

Follow-up for 10f3f4ed016b9fe92ca3d093fcfaed8278e69220.

We already have RuntimeWatchdogUSec or friends. Let's not introduce
redundant properties.

Also, drop the const qualifier for WatchdogLastPingTimestamp, as they
are actually not constant.

3 years agowatchdog: explicitly initialize global variable
Yu Watanabe [Fri, 16 Sep 2022 12:48:39 +0000 (21:48 +0900)] 
watchdog: explicitly initialize global variable

No functional change, as they were implicitly initialized with zero.

3 years agotest: add tests for uid_range_coalesce() 24685/head
Yu Watanabe [Fri, 16 Sep 2022 12:11:19 +0000 (21:11 +0900)] 
test: add tests for uid_range_coalesce()

3 years agouid-range: tie up number and array of uid range entries
Yu Watanabe [Fri, 16 Sep 2022 01:52:00 +0000 (10:52 +0900)] 
uid-range: tie up number and array of uid range entries

This renames UidRange -> UidRangeEntry, and reintroduces UidRange which
contains the array of UidRangeEntry and its size.
No fucntional changes, just refactoring.

3 years agouid-range: make uid_range_intersect() take two UidRange objects
Yu Watanabe [Fri, 16 Sep 2022 01:51:36 +0000 (10:51 +0900)] 
uid-range: make uid_range_intersect() take two UidRange objects

No functional changes, just refactoring.

3 years agouid-range: optimize to load uid_map file
Yu Watanabe [Fri, 16 Sep 2022 01:40:14 +0000 (10:40 +0900)] 
uid-range: optimize to load uid_map file

If uid_map contains many lines, then the previous logic takes O(n^2 log n),
This makes O(n log n).

3 years agouid-range: escape from loop earlier
Yu Watanabe [Fri, 16 Sep 2022 01:29:56 +0000 (10:29 +0900)] 
uid-range: escape from loop earlier

The array of uid range entries are already sorted. Hence, if x and y are
does not have intersection, then the remaining entries neither have
intersection with x.

3 years agouid-range: sort uid range entries in uid_range_coalesce()
Yu Watanabe [Fri, 16 Sep 2022 01:20:55 +0000 (10:20 +0900)] 
uid-range: sort uid range entries in uid_range_coalesce()

As the logic in uid_range_coalesce() assumes the array of entries are
already sorted.
No functional changes, just refactoring.

3 years agouid-range: use parse_uid_range()
Yu Watanabe [Fri, 16 Sep 2022 01:23:43 +0000 (10:23 +0900)] 
uid-range: use parse_uid_range()

3 years agouserdbctl: fix arrow direction
Yu Watanabe [Fri, 16 Sep 2022 02:57:45 +0000 (11:57 +0900)] 
userdbctl: fix arrow direction

3 years agouserdbctl: do not show meaningless boundaries when no uid range available
Yu Watanabe [Fri, 16 Sep 2022 02:54:55 +0000 (11:54 +0900)] 
userdbctl: do not show meaningless boundaries when no uid range available

3 years agosd-device-monitor: do not trigger assertion when uid_map is not empty
Yu Watanabe [Fri, 16 Sep 2022 00:26:07 +0000 (09:26 +0900)] 
sd-device-monitor: do not trigger assertion when uid_map is not empty

Follow-up for c0aa23cf1ed4b3cbbcaf8b19d47e6e29dc28c9a0.

3 years agoFix Positivo DUO k116 key toggle touchpad
drosdeck [Thu, 15 Sep 2022 19:41:01 +0000 (15:41 -0400)] 
Fix Positivo DUO k116 key toggle touchpad

3 years agoupdate TODO
Yu Watanabe [Thu, 15 Sep 2022 19:18:58 +0000 (04:18 +0900)] 
update TODO

3 years agoxdg-autostart-service: expand tilde in Exec lines
David Edmundson [Wed, 14 Sep 2022 18:21:00 +0000 (19:21 +0100)] 
xdg-autostart-service: expand tilde in Exec lines

In typical desktop file parsing it is expected that "~" expands to a
home directory.

Users may write an autostart file with "Exec=myCoolService
~/.someSpecialConfig" which worked before the systemd migration.

3 years agounit: drop ProtectClock=yes from systemd-udevd.service
Yu Watanabe [Wed, 14 Sep 2022 21:07:22 +0000 (06:07 +0900)] 
unit: drop ProtectClock=yes from systemd-udevd.service

This partially reverts cabc1c6d7adae658a2966a4b02a6faabb803e92b.

The setting ProtectClock= implies DeviceAllow=, which is not suitable
for udevd. Although we are slowly removing cgropsv1 support, but
DeviceAllow= with cgroupsv1 is necessarily racy, and reloading PID1
during the early boot process may cause issues like #24668.

Let's disable ProtectClock= for udevd. And, if necessary, let's
explicitly drop CAP_SYS_TIME and CAP_WAKE_ALARM (and possibly others)
by using CapabilityBoundingSet= later.

Fixes #24668.

3 years agofix typo in log
j00512545 [Thu, 15 Sep 2022 14:10:33 +0000 (22:10 +0800)] 
fix typo in log

3 years agounits: drop path to executable in $PATH 24670/head
Zbigniew Jędrzejewski-Szmek [Wed, 14 Sep 2022 12:05:25 +0000 (13:05 +0100)] 
units: drop path to executable in $PATH

We don't have it other places, so let's make things a bit simpler.

3 years agounits: make sure that initrd-switch-root.service pulls in .target
Zbigniew Jędrzejewski-Szmek [Wed, 14 Sep 2022 12:00:43 +0000 (13:00 +0100)] 
units: make sure that initrd-switch-root.service pulls in .target

Normally we queue initrd-switch-root.target/isolate, which pulls in the
service via Wants= in the .target unit file. But if the service is instead
started directly, there may be nothing pulling in the target. Let's make
sure that the reference exists.

3 years agounits: add dependency ordering for emergency.service conflicts
Zbigniew Jędrzejewski-Szmek [Thu, 15 Sep 2022 12:58:25 +0000 (14:58 +0200)] 
units: add dependency ordering for emergency.service conflicts

If we want to stop those services which would compete for access to
the console, we need to have an ordering so that they are actually
stopped before the other things starts, not asynchronously.

3 years agounits: add ordering dependencies on initrd-switch-root.target
Zbigniew Jędrzejewski-Szmek [Wed, 14 Sep 2022 11:39:10 +0000 (12:39 +0100)] 
units: add ordering dependencies on initrd-switch-root.target

For shutdown, we queue shutdown.target/start, so in every unit which should be
stopped *before* shutdown, we need both Conflicts and an ordering dependency
with shutdown.target (either Before= or After= would work, because stop jobs
are always ordered before start jobs).

For initrd transition, we queue initrd-switch-root.service/isolate. This
automatically creates a /stop job for every running unit without
IgnoreOnIsolate. But no ordering dependency is created, unless the unit has a
(possibly transitive) ordering dependency on initrd-switch-root.service.
Since most units must stop before the transition, we should add the ordering
dependency. It is nicer to use Before=initrd-switch-root.target for this.
initrd-switch-root.target is ordered before initrd-switch-root.service, so
the effect it the same when both are in a transaction.

Fixes #23745.

To also cover the case where somebody is emergency mode in the initrd and
queues initrd-switch-root.service/start (not isolate), also add
Conflicts=initrd-switch-root.target, so various units are stopped properly.
This extends 2525682565b372b9b83c848bfe89c025fed47a1d to cover all the other
services that are touched. It could be consider "operator error", but it's
easy to make and it's nicer if we can make this more foolproof.

3 years agounits/systemd-network-generator.service: add forgotten ordering for shutdown
Zbigniew Jędrzejewski-Szmek [Thu, 15 Sep 2022 10:22:42 +0000 (11:22 +0100)] 
units/systemd-network-generator.service: add forgotten ordering for shutdown

3 years agounits: reorder/split unit dependency blocks
Zbigniew Jędrzejewski-Szmek [Wed, 14 Sep 2022 11:39:10 +0000 (12:39 +0100)] 
units: reorder/split unit dependency blocks

The block is reordered and split to have:
  1. description + documentation
  2. (optionally) conditions
  3. all the dependencies
I think it's easier to read the units this way.
Also, the Conflicts+Before is seperated out to separate lines.
The ordering dependency is "fake", because it could just as well be
After=, we are adding it to force ordering wrt. shutdown.target, and
it plays a different role than the other Before=, which are about a
real ordering on boot.

3 years agotest-date: do not fail even on ~50 years later
Yu Watanabe [Sun, 11 Sep 2022 18:02:31 +0000 (03:02 +0900)] 
test-date: do not fail even on ~50 years later

Fixes #16181.

3 years agotest-seccomp: support systems that sched_setscheduler() is already limited
Yu Watanabe [Sun, 11 Sep 2022 20:13:30 +0000 (05:13 +0900)] 
test-seccomp: support systems that sched_setscheduler() is already limited

Fixes #17078.

3 years agomeson: add libatomic dependency
Heinrich Schuchardt [Mon, 12 Sep 2022 16:41:34 +0000 (18:41 +0200)] 
meson: add libatomic dependency

Building with GCC 12.2 and binutils 2.39 fails on riscv64 Ubuntu Kinetic
with:

FAILED: systemd-oomd
/usr/bin/ld: systemd-oomd.p/src_oom_oomd-util.c.o:
in function `oomd_cgroup_context_acquire':
build/../src/oom/oomd-util.c:415:
undefined reference to `__atomic_exchange_1'

We have to link with -latomic.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agobash-completion: add missing options to systemd-cryptenroll
Antonio Alvarez Feijoo [Thu, 15 Sep 2022 08:15:44 +0000 (10:15 +0200)] 
bash-completion: add missing options to systemd-cryptenroll

3 years agoMerge pull request #24671 from mrc0mmand/even-more-codeql
Yu Watanabe [Wed, 14 Sep 2022 21:22:36 +0000 (06:22 +0900)] 
Merge pull request #24671 from mrc0mmand/even-more-codeql

ci: enable a couple more possibly useful CodeQL queries

3 years agooom: include a header file instead of a source file
Frantisek Sumsal [Wed, 14 Sep 2022 18:36:40 +0000 (20:36 +0200)] 
oom: include a header file instead of a source file

3 years agotree-wide: fix typo
Yu Watanabe [Wed, 14 Sep 2022 21:03:57 +0000 (06:03 +0900)] 
tree-wide: fix typo

3 years agoci: fix a couple of typos 24671/head
Frantisek Sumsal [Wed, 14 Sep 2022 20:04:15 +0000 (22:04 +0200)] 
ci: fix a couple of typos

3 years agoci: enable a couple more possibly useful CodeQL queries
Frantisek Sumsal [Wed, 14 Sep 2022 19:32:33 +0000 (21:32 +0200)] 
ci: enable a couple more possibly useful CodeQL queries

3 years agoci: rename codeql-analysis.yml to codeql.yml
Frantisek Sumsal [Wed, 14 Sep 2022 17:13:10 +0000 (19:13 +0200)] 
ci: rename codeql-analysis.yml to codeql.yml

Just to be consistent with other repos under the systemd umbrella.