1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-25 23:21:33 +03:00
Commit Graph

60066 Commits

Author SHA1 Message Date
Yu Watanabe
a80ce209b9 udev: use sd_device_get_sysattr_value()
No functional changes, just refactoring.
2022-09-19 18:04:13 +09:00
Yu Watanabe
c42033e7be udev: use faccessat()
No functional changes, just refactoring.
2022-09-19 18:04:13 +09:00
Yu Watanabe
4bc9d8165b sd-device: re-implement device_sysattrs_read_all() without recursion 2022-09-19 18:04:13 +09:00
Yu Watanabe
5b304c7052 sd-device: use faccessat()
No functional changes, just refactoring.
2022-09-19 18:04:13 +09:00
Yu Watanabe
65c0f14bc1 sd-device: use fstatat()
No functional changes, just refactoring.
2022-09-19 18:04:13 +09:00
Yu Watanabe
bc5e8ebbfb sd-device: use path_hash_ops to store sysattrs
As the stored values are actually path. Just for safety.

This also drops unnecessary duplication of path.
2022-09-19 18:04:12 +09:00
Jörg Thalheim
e7f64b8962 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
2022-09-19 10:36:25 +02:00
Yu Watanabe
d64b44be52 test: add testcase for link priority 2022-09-19 06:08:58 +09:00
Yu Watanabe
5b4671ec47
Merge pull request #24646 from yuwata/udev-node-symlink_atomic
udev: introduce symlink_atomic_full() and use it
2022-09-19 05:25:58 +09:00
Yu Watanabe
3afe230d4a
Merge pull request #24725 from yuwata/blockdev-util-introduce-block_device_get_whole_disk
blockdev-util: introduce block_device_get_whole_disk()
2022-09-19 05:25:09 +09:00
Yu Watanabe
626f15a4c1
Merge pull request #24730 from yuwata/dissect-image-drop-reference-to-decrypted-image
dissect-image: introduce dissected_image_relinquish()
2022-09-19 05:24:35 +09:00
BerndAdameit
a3e03a3f18 man/systemd-run: Refer to man-pages project (man7.org) when citing bash(1) 2022-09-19 00:32:34 +09:00
Yu Watanabe
28f9bcd65a path-util: add examples for path_make_relative() and path_make_relative_parent()
Addresses https://github.com/systemd/systemd/pull/24646#discussion_r973691797.
2022-09-19 00:30:29 +09:00
Yu Watanabe
e330f97a89 tree-wide: drop unused reference to DecryptedImage 2022-09-18 23:47:20 +09:00
Yu Watanabe
3044d343dd tree-wide: use dissected_image_relinquish() 2022-09-18 23:47:20 +09:00
Yu Watanabe
f906075a15 dissect-image: introduce dissected_image_relinquish() 2022-09-18 23:47:20 +09:00
Yu Watanabe
d50c55bd43 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.
2022-09-18 23:32:24 +09:00
Yu Watanabe
8f71534e06 udev: use block_device_get_whole_disk()
This should not change anything effectively.
2022-09-18 23:30:21 +09:00
Yu Watanabe
6d42138593 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.
2022-09-18 23:23:23 +09:00
Daan De Meyer
c72aed4c20
Merge pull request #24720 from yuwata/dissect-image-take-reference
dissect-image: make DissectedImage object take reference to DecryptedImage and LoopDevice
2022-09-18 16:08:13 +02:00
Yu Watanabe
5a27af52c7 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().
2022-09-18 22:54:20 +09:00
Yu Watanabe
55a437f8b2 blockdev-util: introduce block_device_get_whole_disk() 2022-09-18 22:54:20 +09:00
Yu Watanabe
c07186ec03 blockdev-util: split-out block_device_is_whole_disk()
No functional changes, just preparation for later commits.
2022-09-18 22:54:20 +09:00
Yu Watanabe
8b6a70f699
Merge pull request #24719 from yuwata/dissect-image-dissected-image-new
dissect-image: introduce dissected_image_new()
2022-09-18 22:41:49 +09:00
Yu Watanabe
23d3dfc369 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.
2022-09-18 15:35:56 +02:00
Daan De Meyer
4f0d1cd011
Merge pull request #24691 from yuwata/udev-node-check-existence
udev: check existence of device node
2022-09-18 11:38:56 +02:00
Daan De Meyer
a36b572166
Merge pull request #24710 from yuwata/test-50-dissect-cleanups
TEST-50-DISSECT: cleanups
2022-09-18 11:21:30 +02:00
Yu Watanabe
0f75b0c589 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).
2022-09-18 11:19:33 +02:00
Yu Watanabe
a1c3628b19 udev: downgrade log level when device node is already removed
Follow-up for 790da548b0.
2022-09-18 10:51:25 +02:00
Yu Watanabe
babd5b08b5 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.
2022-09-18 17:26:22 +09:00
Yu Watanabe
00e295055b dissect-image: split out dissected_image_new()
To make dissect_image() shorter.
No functional changes, just refactoring.
2022-09-18 17:26:22 +09:00
Yu Watanabe
1e63dc4f1c 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.
2022-09-18 07:56:32 +09:00
Yu Watanabe
36d5eb0bff loop-util: introduce reference counter for LoopDevice 2022-09-18 07:56:32 +09:00
Yu Watanabe
ac1e1b5fd7 dissect-image: take reference of DecryptedImage into DissectedImage
No functional changes. Preparation for later commits.
2022-09-18 07:56:32 +09:00
Yu Watanabe
9321ad5118 dissect-image: introduce reference counter for DecryptedImage 2022-09-18 07:56:32 +09:00
Yu Watanabe
ea16d7f48e dissect-image: lazily deactivate decrypted DM volumes
The DM block device may be still used by other processes.
2022-09-18 07:27:22 +09:00
Lennart Poettering
f578c659c4 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.
2022-09-18 07:27:00 +09:00
Yu Watanabe
cf610e1d87 cryptsetup-util: introduce crypt_free_and_replace() 2022-09-18 04:57:10 +09:00
Lennart Poettering
0ea720ca7e
Merge pull request #24622 from yuwata/udev-open-with-noctty
udev: open with O_NOCTTY
2022-09-17 19:03:15 +02:00
Zbigniew Jędrzejewski-Szmek
eb5b6b7310
Merge pull request #24708 from keszybz/not-available-in-tables
various: use "-" instead of "n/a" in tables
2022-09-17 18:16:42 +02:00
Yu Watanabe
d3fcb73678 test-50-dissect: do not fail test on cleanup
These paths are read-only mount points. Hence, we cannot remove the
contents.
2022-09-17 21:36:18 +09:00
Yu Watanabe
759b4b4a2a test-50-dissect: check mount destination instead of mount source
And rebreak long lines.

This should take no effective change, just refactoring.
2022-09-17 21:36:18 +09:00
Zbigniew Jędrzejewski-Szmek
15b3f7e309
Merge pull request #24670 from keszybz/early-boot-ordering
Early boot ordering
2022-09-17 13:26:51 +02:00
Zbigniew Jędrzejewski-Szmek
7f8afa6dc1 coredumpctl: rename table entry
"Disk Size" could be mistaken for "Size of the Disk".
2022-09-17 13:12:49 +02:00
Zbigniew Jędrzejewski-Szmek
483bf5643a man: add missing subject in sentence 2022-09-17 13:12:22 +02:00
Zbigniew Jędrzejewski-Szmek
8a9651088f 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.
2022-09-17 13:05:51 +02:00
Daan De Meyer
9bf36477bf
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
2022-09-17 09:57:20 +02:00
Yu Watanabe
ee3455cf11 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.
2022-09-17 09:54:41 +02:00
Yu Watanabe
9972e6d6ed dissect-image: make verity_partition() actually fail when all attempts of activation failed 2022-09-17 05:18:25 +09:00
Yu Watanabe
ad361a50fb dissect-image: split out verity_timeout()
To make verity_partition() shorten. No functional changes, just
refactoring.
2022-09-17 05:18:25 +09:00