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
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
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
Yu Watanabe
cf610e1d87
cryptsetup-util: introduce crypt_free_and_replace()
2022-09-18 04:57:10 +09: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
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
Yu Watanabe
54ee1cd69d
Merge pull request #24692 from yuwata/dissect-image-fix-memleak
...
dissect-image: fix memleak
2022-09-17 01:31:32 +09:00
Yu Watanabe
ab8e6464b5
Merge pull request #24664 from yuwata/watchdog
...
watchdog: open /dev/watchdog0 only if it exists
2022-09-17 00:18:53 +09:00
Yu Watanabe
5bf5013fc9
dissect-image: handle all non-negative return values as success
...
No functional changes, just coding syle update.
2022-09-16 23:11:09 +09:00
Yu Watanabe
041e2edac8
dissect-image: fix memleak on failure
2022-09-16 23:11:09 +09:00
Yu Watanabe
a6b7ebaafa
watchdog: use /dev/watchdog0 only if it exists
...
Fixes #24661 .
2022-09-16 22:34:37 +09:00
Yu Watanabe
3e911a0d0e
pid1: drop redundant DBus properties
...
Follow-up for 10f3f4ed01 .
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.
2022-09-16 21:53:28 +09:00
Yu Watanabe
9341f41801
watchdog: explicitly initialize global variable
...
No functional change, as they were implicitly initialized with zero.
2022-09-16 21:48:39 +09:00
Yu Watanabe
a900274915
test-seccomp: support systems that sched_setscheduler() is already limited
...
Fixes #17078 .
2022-09-15 13:47:17 +01:00
Yu Watanabe
af3d387365
tree-wide: fix typo
2022-09-15 06:03:57 +09:00
Yu Watanabe
10f3f4ed01
pid1: introduce dbus properties WatchdogDevice and friends
...
Closes #24665 .
2022-09-14 13:13:59 +01:00
Yu Watanabe
590d81002b
fs-util,label: introduce symlink_atomic_full() and symlink_atomic_full_label()
...
These new functions optionally create symlink of relative path.
2022-09-14 06:22:09 +09:00
Yu Watanabe
6f2d367e49
Merge pull request #24272 from dtardon/asserts
...
Use ASSERT_PTR more
2022-09-13 21:08:10 +09:00
Yu Watanabe
e51bea3433
Merge pull request #24651 from yuwata/openssl-util
...
openssl-util: trivial cleanups
2022-09-13 21:05:42 +09:00
Yu Watanabe
35aefda35f
creds-util: fix NULL pointer dereference
...
Fixes CID#1497840.
2022-09-13 21:05:16 +09:00
Yu Watanabe
2e64df07b8
openssl-util: use assert() if no side effect
2022-09-13 17:03:34 +09:00
Yu Watanabe
d39929d96d
openssl-util: drop meaningless assertion
...
As the type of 'msz' is int.
Fixes CID#1497842.
2022-09-13 17:03:18 +09:00
David Tardon
c9958c4fc5
tree-wide: check parameter before dereferencing
2022-09-13 08:13:42 +02:00
David Tardon
995340074e
tree-wide: use ASSERT_PTR more
2022-09-13 08:13:27 +02:00
Ansgar Burchardt
4167e2135e
base-filesystem.c: add trailing zero byte for s390x entry
2022-09-12 23:35:09 +09:00
Lennart Poettering
251d2ea269
tpm2-util: avoid trial
...
Let's avoid trial mode for putting together policies if we can, and use
the real policy whenever we can pull it off.
Fixes : #24401
2022-09-10 20:58:41 +02:00
Yu Watanabe
86f9b69a6a
blockdev-util: split out blockdev_reread_partition_table()
...
No functional changes, just refactoring.
2022-09-10 01:19:41 +09:00
Yu Watanabe
9409174ee7
udevd: use partition enumerator at one more place
...
No functional changes, just refactoring.
2022-09-10 00:48:34 +09:00
Yu Watanabe
9cce72ee5d
Merge pull request #24611 from yuwata/loop-util-refactoring
...
loop-util: several cleanups
2022-09-09 23:31:19 +09:00
Yu Watanabe
e0993236d3
blockdevi-util: also check sysname when enumerating partitions
2022-09-09 22:30:19 +09:00
Yu Watanabe
833106b876
loop-util: do not try to enumerate partitions twice
2022-09-09 05:16:41 +09:00
Yu Watanabe
53274fdb59
loop-util: always check if backing file is not attached yet
...
An image file without partition table may be attached.
2022-09-09 05:16:01 +09:00
Yu Watanabe
da4fd28871
loop-util: open loopback block device in loop_configure()
...
And make it return LoopDevice object on success.
No functional changes, just refactoring.
2022-09-09 04:31:10 +09:00
Yu Watanabe
bb273a5145
loop-util: save the flag about if LOOP_CONFIGURE ioctl works or not in loop_configure()
...
When LOOP_CONFIGURE fail, then it is not necessary to call it on any
later call of loop_configure(). Let's save the flag in a static variable
in the function.
2022-09-09 04:31:10 +09:00
Yu Watanabe
54ba7daf23
loop-util: split out several functions fron loop_configure() and loop_device_make_internal()
...
The two functions were quite long, and hard to understand its logic.
No functional change, just refactoring.
2022-09-09 04:31:10 +09:00
Frantisek Sumsal
8432b0cd20
Merge pull request #24351 from poettering/pcr-sign
...
support for signed TPM2 PCR policies in cryptsetup/cryptenrolls/credentials
2022-09-08 19:07:04 +00:00
Lennart Poettering
75a9681ec0
cryptsetup: hook up TPM2 token code with policies based on PCR signatures, too
2022-09-08 16:34:27 +02:00
Lennart Poettering
4d5cc0d453
tpm2-util: add helper for formatting PCR masks as string
2022-09-08 16:34:27 +02:00
Lennart Poettering
fdf6c27cba
tpm2-util: add common parser for the LUKS2 TPM2 JSON structure
...
This splits out the JSON parser used by the systemd-cryptsetup code.
This is preparation for later work to reuse it in the tpm2 cryptsetup
token module, which currently uses a separate but very similar parser
for the same data.
No change in behaviour.
2022-09-08 16:34:27 +02:00
Lennart Poettering
f0f4fcaeb7
cryptenroll: hook up new TPM2 signed policies with cryptenroll
2022-09-08 16:34:27 +02:00