]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoloop-util: do not try to enumerate partitions twice 24611/head
Yu Watanabe [Thu, 8 Sep 2022 20:12:07 +0000 (05:12 +0900)] 
loop-util: do not try to enumerate partitions twice

3 years agoloop-util: always check if backing file is not attached yet
Yu Watanabe [Thu, 8 Sep 2022 20:04:08 +0000 (05:04 +0900)] 
loop-util: always check if backing file is not attached yet

An image file without partition table may be attached.

3 years agoloop-util: open loopback block device in loop_configure()
Yu Watanabe [Thu, 8 Sep 2022 08:18:49 +0000 (17:18 +0900)] 
loop-util: open loopback block device in loop_configure()

And make it return LoopDevice object on success.
No functional changes, just refactoring.

3 years agoloop-util: save the flag about if LOOP_CONFIGURE ioctl works or not in loop_configure()
Yu Watanabe [Thu, 8 Sep 2022 08:01:45 +0000 (17:01 +0900)] 
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.

3 years agoloop-util: split out several functions fron loop_configure() and loop_device_make_int...
Yu Watanabe [Thu, 8 Sep 2022 07:44:40 +0000 (16:44 +0900)] 
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.

3 years agoMerge pull request #24601 from yuwata/sd-device-enumerator-drop-recursion
Yu Watanabe [Thu, 8 Sep 2022 19:30:42 +0000 (04:30 +0900)] 
Merge pull request #24601 from yuwata/sd-device-enumerator-drop-recursion

sd-device-enumerator: do not recursively find child devices

3 years agoMerge pull request #24351 from poettering/pcr-sign
Frantisek Sumsal [Thu, 8 Sep 2022 19:07:04 +0000 (19:07 +0000)] 
Merge pull request #24351 from poettering/pcr-sign

support for signed TPM2 PCR policies in cryptsetup/cryptenrolls/credentials

3 years agomeasure: print a helpful message if TPM2 PCR sysfs attributes are missing
Lennart Poettering [Thu, 8 Sep 2022 10:57:23 +0000 (12:57 +0200)] 
measure: print a helpful message if TPM2 PCR sysfs attributes are missing

Prompted by:

https://github.com/systemd/systemd/pull/24351#pullrequestreview-1100418585

3 years agobasic/missing_loop.h: fix missing lo_flags LO_FLAGS_DIRECT_IO
Guillaume W. Bres [Thu, 8 Sep 2022 13:54:57 +0000 (15:54 +0200)] 
basic/missing_loop.h: fix missing lo_flags LO_FLAGS_DIRECT_IO

3 years agoMerge pull request #24608 from bluca/example
Luca Boccassi [Thu, 8 Sep 2022 16:42:07 +0000 (17:42 +0100)] 
Merge pull request #24608 from bluca/example

docs: mention tmpfiles.d in CREDENTIALS.md and add example for ssh provisioning (to manpage too)

3 years agoMerge pull request #24600 from poettering/bootspec-chase-symlinks
Lennart Poettering [Thu, 8 Sep 2022 16:40:10 +0000 (18:40 +0200)] 
Merge pull request #24600 from poettering/bootspec-chase-symlinks

bootspec: more chase_symlinks()

3 years agodocs: mention tmpfiles.d in CREDENTIALS.md and add example 24608/head
Luca Boccassi [Thu, 8 Sep 2022 15:33:24 +0000 (16:33 +0100)] 
docs: mention tmpfiles.d in CREDENTIALS.md and add example

3 years agoman: add example with one-liner for ssh provisioning via tmpfiles.d + Creds
Luca Boccassi [Thu, 8 Sep 2022 15:27:52 +0000 (16:27 +0100)] 
man: add example with one-liner for ssh provisioning via tmpfiles.d + Creds

3 years agotest: check the numa-test.service status directly
Frantisek Sumsal [Thu, 8 Sep 2022 10:27:46 +0000 (12:27 +0200)] 
test: check the numa-test.service status directly

In a couple of recent CI runs I noticed TEST-36 failing due to a missed
service exit notification and a subsequent fail of the `grep` command:

```
[  257.112153] H systemd[1]: Started numa-test.service.
[  257.114343] H systemd[899]: numa-test.service: Failed to set NUMA memory policy: Invalid argument
[  257.118270] H systemd[899]: numa-test.service: Failed at step NUMA_POLICY spawning /bin/sleep: Invalid argument
[  257.126170] H systemd[1]: Bus private-bus-connection: changing state RUNNING → CLOSING
[  257.130290] H systemd[1]: numa-test.service: Failed to send unit change signal for numa-test.service: Connection reset by peer
[  257.131567] H systemd[1]: Received SIGCHLD from PID 899 ((sleep)).
[  257.132870] H systemd[1]: Got disconnect on private connection.
[  257.134299] H systemd[1]: systemd-journald.service: Got notification message from PID 498 (FDSTORE=1)
[  257.135611] H systemd[1]: systemd-journald.service: Added fd 38 (n/a) to fd store.
[  257.136999] H systemd[1]: systemd-journald.service: Received EPOLLHUP on stored fd 38 (stored), closing.
[  257.366996] H testsuite-36.sh[536]: + stopJournalctl
[  257.366996] H testsuite-36.sh[536]: + local unit=init.scope
[  257.366996] H testsuite-36.sh[536]: + echo 'Force journald to write all queued messages'
[  257.366996] H testsuite-36.sh[536]: Force journald to write all queued messages
[  257.366996] H testsuite-36.sh[536]: + journalctl --sync
[  257.488642] H systemd-journald[498]: Received client request to rotate journal.
[  257.520821] H testsuite-36.sh[536]: + journalctl -u init.scope --cursor-file=jounalCursorFile
[  257.981399] H testsuite-36.sh[536]: + pid1StopUnit numa-test.service
[  257.984533] H testsuite-36.sh[536]: + systemctl stop numa-test.service
[  258.173656] H systemd[1]: Bus private-bus-connection: changing state AUTHENTICATING → RUNNING
[  258.180710] H systemd[1]: numa-test.service: Trying to enqueue job numa-test.service/stop/replace
[  258.182424] H systemd[1]: Added job numa-test.service/stop to transaction.
[  258.185234] H systemd[1]: numa-test.service: Installed new job numa-test.service/stop as 738
[  258.187017] H systemd[1]: numa-test.service: Enqueued job numa-test.service/stop as 738
[  258.239930] H testsuite-36.sh[536]: + grep 'numa-test.service: Main process exited, code=exited, status=242/NUMA' journal.log
```

Let's mitigate this by checking the test service exit status directly
instead of relying on the notification.

3 years agoTEST-70-TPM2: add test for new signed TPM2 PCR policies 24351/head
Lennart Poettering [Fri, 19 Aug 2022 09:26:49 +0000 (11:26 +0200)] 
TEST-70-TPM2: add test for new signed TPM2 PCR policies

3 years agocryptsetup: hook up TPM2 token code with policies based on PCR signatures, too
Lennart Poettering [Fri, 19 Aug 2022 20:18:40 +0000 (22:18 +0200)] 
cryptsetup: hook up TPM2 token code with policies based on PCR signatures, too

3 years agotpm2-util: add helper for formatting PCR masks as string
Lennart Poettering [Fri, 19 Aug 2022 20:18:31 +0000 (22:18 +0200)] 
tpm2-util: add helper for formatting PCR masks as string

3 years agotpm2-util: add common parser for the LUKS2 TPM2 JSON structure
Lennart Poettering [Fri, 19 Aug 2022 20:15:12 +0000 (22:15 +0200)] 
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.

3 years agocryptsetup: hook up signed PCR policies
Lennart Poettering [Thu, 18 Aug 2022 09:10:30 +0000 (11:10 +0200)] 
cryptsetup: hook up signed PCR policies

3 years agorepart: hook up new TPM2 signed policies with repart
Lennart Poettering [Wed, 17 Aug 2022 15:30:11 +0000 (17:30 +0200)] 
repart: hook up new TPM2 signed policies with repart

3 years agocryptenroll: hook up new TPM2 signed policies with cryptenroll
Lennart Poettering [Wed, 17 Aug 2022 15:29:44 +0000 (17:29 +0200)] 
cryptenroll: hook up new TPM2 signed policies with cryptenroll

3 years agocreds-tool: expose new signed PCR policies in creds tool, too
Lennart Poettering [Wed, 17 Aug 2022 15:28:49 +0000 (17:28 +0200)] 
creds-tool: expose new signed PCR policies in creds tool, too

3 years agocreds-util: hook up new signed PCR policies
Lennart Poettering [Wed, 17 Aug 2022 15:28:05 +0000 (17:28 +0200)] 
creds-util: hook up new signed PCR policies

3 years agotpm2-util: extend TPM2 policies to optionally check PCR values against signed values
Lennart Poettering [Wed, 17 Aug 2022 15:21:57 +0000 (17:21 +0200)] 
tpm2-util: extend TPM2 policies to optionally check PCR values against signed values

Traditionally, TPM2 PCR policies are bound against literal PCR values,
which makes them hard to work with when updating software that is
measured into PCRs: each update will change the PCR values, and thus
break TPM2 policies of existing objects.

Let's improve the situation: let's allow signed PCR policies. Secrets
and other TPM2 objects can be associated with a public key that signs a
PCR policy. Thus, if the signed policy and the public key is presented,
access to the TPM2 object can be granted. This allows a less brittle
handling of updates: for example, whenever a kernel image is updated a
new signed PCR policy can be shipped along with it, signed by a private
key owned by the kernel vendor (ideally: same private key that is used
to sign the kernel image itself). TPM2 objects can then be bound to the
associated public key, thus allowing objects that can only be unlocked
by kernels of the same vendor. This makes it very easy to update kernels
without affecting locked secrets.

This does not hook up any of the consuming code (just passes NULL/0
everywhere). This is for later commits.

3 years agomeasure: add 'sign' verb
Lennart Poettering [Wed, 17 Aug 2022 16:40:42 +0000 (18:40 +0200)] 
measure: add 'sign' verb

3 years agoopenssl-util: add helper for calculating fingerprint of a DER public key
Lennart Poettering [Wed, 17 Aug 2022 08:02:02 +0000 (10:02 +0200)] 
openssl-util: add helper for calculating fingerprint of a DER public key

3 years agotpm2-util: allow external code to create tpm2 contexts
Lennart Poettering [Fri, 12 Aug 2022 13:36:14 +0000 (15:36 +0200)] 
tpm2-util: allow external code to create tpm2 contexts

3 years agotpm2-util: pick up 4 more symbols of tpm2-tss
Lennart Poettering [Fri, 12 Aug 2022 13:12:29 +0000 (15:12 +0200)] 
tpm2-util: pick up 4 more symbols of tpm2-tss

3 years agoCODING_STYLE: fix header level
Lennart Poettering [Thu, 8 Sep 2022 14:12:57 +0000 (16:12 +0200)] 
CODING_STYLE: fix header level

3 years agobootctl: don't start "bootctl list" output with a title line 24600/head
Lennart Poettering [Wed, 7 Sep 2022 16:23:36 +0000 (18:23 +0200)] 
bootctl: don't start "bootctl list" output with a title line

Let's not output a title line given that we don't output multiple
different things here anyway, and the "bootctl list" command is about
listing boot entries anyway and it's documented that way.

Having titles for sections if we have mutliple sections of output
definitely makes sense, but if there's only one kind of information we
list it's redundant clutter.

3 years agobootspec: don't follow symlinks when opening type1/type2 files
Lennart Poettering [Wed, 7 Sep 2022 16:22:11 +0000 (18:22 +0200)] 
bootspec: don't follow symlinks when opening type1/type2 files

let's not follow symlinks when going from enumeraiton dir to enumerated
file either.

3 years agobootspec: use chase_symlinks() where appropriate
Lennart Poettering [Wed, 7 Sep 2022 16:19:46 +0000 (18:19 +0200)] 
bootspec: use chase_symlinks() where appropriate

Let's better be safe than sorry, and follow symlinks in ESP + XBOOTLDR
via chase_symlinks() relative to the root of these files systems. This is
not a big issue given that ESP/XBOOTLDR are supposed to be VFAT where
symlinks don't exist, but the specs don't strictly require this, and by
loading efifs drivers in uefi it would be possible to support symlinks,
but we'd rather not have that here.

No real change in behaviour, just stricter rules to make me sleep better
at night.

3 years agoupdate TODO
Lennart Poettering [Wed, 7 Sep 2022 16:17:33 +0000 (18:17 +0200)] 
update TODO

3 years agoMerge pull request #24572 from DaanDeMeyer/repart-verity
Lennart Poettering [Thu, 8 Sep 2022 10:02:27 +0000 (12:02 +0200)] 
Merge pull request #24572 from DaanDeMeyer/repart-verity

repart: Add support for formatting verity partitions

3 years agoMerge pull request #24434 from medhefgo/boot-fixes
Lennart Poettering [Thu, 8 Sep 2022 09:17:12 +0000 (11:17 +0200)] 
Merge pull request #24434 from medhefgo/boot-fixes

boot: Small fixes

3 years agotpm2: add bind key
William Roberts [Wed, 7 Sep 2022 12:52:16 +0000 (07:52 -0500)] 
tpm2: add bind key

Currently, the tpm2 support will use encrypted sessions by creating a
primary key that is used to encrypt traffic. This creates a problem as
the key created for encrypting the traffic could be faked by an active
interposer on the bus. In cases when a pin is used, we can introduce the
bind key. The pin is used as the auth value for the seal key, aka the
disk encryption key, and that auth value can be used in the session
establishment. An attacker would need the pin value to create the secure
session and thus an active interposer without the pin could not
interpose on TPM traffic.

Related-to: #22637
Signed-off-by: William Roberts <william.c.roberts@intel.com>
3 years agotest: add test for sd_device_enumerator_add_match_parent() 24601/head
Yu Watanabe [Thu, 8 Sep 2022 06:21:21 +0000 (15:21 +0900)] 
test: add test for sd_device_enumerator_add_match_parent()

3 years agosd-device-enumerator: rewrite child enumeration without recursion
Yu Watanabe [Thu, 8 Sep 2022 05:57:41 +0000 (14:57 +0900)] 
sd-device-enumerator: rewrite child enumeration without recursion

3 years agosd-device-enumerator: do not fail when a directory vanishes on enumerate
Yu Watanabe [Thu, 8 Sep 2022 05:54:54 +0000 (14:54 +0900)] 
sd-device-enumerator: do not fail when a directory vanishes on enumerate

3 years agosd-device-enumerator: use test_matches() more
Yu Watanabe [Thu, 8 Sep 2022 06:55:23 +0000 (15:55 +0900)] 
sd-device-enumerator: use test_matches() more

3 years agoupdate TODO 24572/head
Daan De Meyer [Thu, 8 Sep 2022 06:43:50 +0000 (08:43 +0200)] 
update TODO

3 years agorepart: Add support for formatting verity partitions
Daan De Meyer [Mon, 5 Sep 2022 22:45:32 +0000 (00:45 +0200)] 
repart: Add support for formatting verity partitions

This commit adds a new Verity= setting to repart definition files
with two possible values: "data" and "hash".

If Verity= is set to "data", repart works as before, and populates
the partition with the content from CopyBlocks= or CopyFiles=.

If Verity= is set to "hash", repart will try to find a matching
data partition with Verity=data and equal values for CopyBlocks=
or CopyFiles=, Format= and MakeDirectories=. If a matching data
partition is found, repart will generate verity hashes for that
data partition in the verity partition. The UUID of the data
partition is set to the first 128 bits of the verity root hash. The
UUID of the hashes partition is set to the final 128 bits of the
verity root hash.

Fixes #24559

3 years agoMerge pull request #24587 from yuwata/sd-device-monitor-running-user-ns
Yu Watanabe [Thu, 8 Sep 2022 05:27:21 +0000 (14:27 +0900)] 
Merge pull request #24587 from yuwata/sd-device-monitor-running-user-ns

sd-device-monitor: relax sender uid check when running in user namespace

3 years agosd-device-monitor: relax sender uid check when running in user namespace 24587/head
Yu Watanabe [Tue, 6 Sep 2022 19:43:18 +0000 (04:43 +0900)] 
sd-device-monitor: relax sender uid check when running in user namespace

If sd-device-monitor is running in a user namespace, the sender uid is
not zero. Let's relax the verification in that case.

3 years agouid-range: move to src/basic/
Yu Watanabe [Wed, 7 Sep 2022 10:08:26 +0000 (19:08 +0900)] 
uid-range: move to src/basic/

To make the functions defined in the files usable by libsystemd library.

3 years agouid-range: error code tweak for uid_range_load_userns()
Lennart Poettering [Wed, 7 Sep 2022 16:25:37 +0000 (18:25 +0200)] 
uid-range: error code tweak for uid_range_load_userns()

Let's return ENOSYS if /proc/ is not mounted (as that's what we usually
return in that case in various helpers that operate on /proc/). Return
EOPNOTSUPP if the kernel simply doesn't support userns.

3 years agoMerge pull request #24571 from yuwata/dissect-loop-image-use-backing-file
Yu Watanabe [Wed, 7 Sep 2022 14:45:29 +0000 (23:45 +0900)] 
Merge pull request #24571 from yuwata/dissect-loop-image-use-backing-file

dissect: save image path to LoopDevice and use it when dissect loop device

3 years agorepart: Invert no_dropin_files boolean
Daan De Meyer [Tue, 6 Sep 2022 12:26:57 +0000 (14:26 +0200)] 
repart: Invert no_dropin_files boolean

3 years agorepart: Extract context dump into a separate function
Daan De Meyer [Mon, 5 Sep 2022 20:37:20 +0000 (22:37 +0200)] 
repart: Extract context dump into a separate function

3 years agodissect-image: drop unnecessary duplication of partition device node 24571/head
Yu Watanabe [Tue, 6 Sep 2022 01:50:19 +0000 (10:50 +0900)] 
dissect-image: drop unnecessary duplication of partition device node

3 years agodissect-image: reuse LoopDevice.node in dissect_image()
Yu Watanabe [Tue, 6 Sep 2022 13:43:47 +0000 (22:43 +0900)] 
dissect-image: reuse LoopDevice.node in dissect_image()

Currently, dissect_image() is only called through dissect_loop_device(),
and the LoopDevice object has device name. Hence, it is not necessary to
get device name in dissect_image().

3 years agodissect-image: drop currently unused arguments
Yu Watanabe [Tue, 6 Sep 2022 13:39:31 +0000 (22:39 +0900)] 
dissect-image: drop currently unused arguments

3 years agodissect-image: drop currently unused code
Yu Watanabe [Tue, 6 Sep 2022 13:50:33 +0000 (22:50 +0900)] 
dissect-image: drop currently unused code

Currently, dissect_image() is called only through dissect_loop_device(),
and image_path is always specified. Let's drop it.

3 years agodissect-image: use loop backing file or device node as name of the image
Yu Watanabe [Tue, 6 Sep 2022 01:58:26 +0000 (10:58 +0900)] 
dissect-image: use loop backing file or device node as name of the image

Note, currently, for each call of dissect_loop_device_and_warn(), the
specified name is equivalent to the path passed to loop_device_make_by_path().
Hence, this should not change the current behavios.

3 years agogpt-auto: use LoopDevice object to manage whole block disk
Yu Watanabe [Tue, 6 Sep 2022 01:25:56 +0000 (10:25 +0900)] 
gpt-auto: use LoopDevice object to manage whole block disk

3 years agodissect-image: use backing_file stored in LoopDevice object to generate image name
Yu Watanabe [Mon, 5 Sep 2022 20:37:13 +0000 (05:37 +0900)] 
dissect-image: use backing_file stored in LoopDevice object to generate image name

Follow-up for e374439f4b8def786031ddbbd7dfdae3a335d4d2 (#24322).

This also simplify the logic of generating image name from image path.

3 years agoloop-util: save backing file of loopback block device
Yu Watanabe [Mon, 5 Sep 2022 20:19:46 +0000 (05:19 +0900)] 
loop-util: save backing file of loopback block device

It will be used in later commits.

3 years agoloop-util: move device_has_block_children() to blockdev-util.c
Yu Watanabe [Mon, 5 Sep 2022 20:01:34 +0000 (05:01 +0900)] 
loop-util: move device_has_block_children() to blockdev-util.c

As the function is not only for loopback block device.

No actual code changes, just refactoring.

3 years agoblockdev-util: check if provided sd_device is for a whole block device
Yu Watanabe [Mon, 5 Sep 2022 20:00:49 +0000 (05:00 +0900)] 
blockdev-util: check if provided sd_device is for a whole block device

And split out partition_generator_new(), to make it usable in other
functions.

3 years agoblockdev-util: make block_device_remove_all_partitions() take sd_device object
Yu Watanabe [Mon, 5 Sep 2022 19:46:04 +0000 (04:46 +0900)] 
blockdev-util: make block_device_remove_all_partitions() take sd_device object

Then, it is not necessary to recreate sd_device object when we already
have.

3 years agoboot: Avoid magic values in timeout EFI vars 24434/head
Jan Janssen [Tue, 6 Sep 2022 08:46:27 +0000 (10:46 +0200)] 
boot: Avoid magic values in timeout EFI vars

3 years agoboot: Use proper scan codes
Jan Janssen [Mon, 29 Aug 2022 08:43:27 +0000 (10:43 +0200)] 
boot: Use proper scan codes

This arg expects scan codes and it can be very confusing to find a key
conflict when trying to add a F3 button when there are no F3 keycodes
seemingly in use. CHAR_CARRIAGE_RETURN and SCAN_F3 use the same value,
so no changes in behavior.

3 years agoboot: Accept Ctrl+Del for deleting words
Jan Janssen [Mon, 29 Aug 2022 08:39:49 +0000 (10:39 +0200)] 
boot: Accept Ctrl+Del for deleting words

3 years agoboot: Correctly handle shift keys
Jan Janssen [Wed, 24 Aug 2022 09:01:02 +0000 (11:01 +0200)] 
boot: Correctly handle shift keys

3 years agoboot: Refuse GPT with invalid entry size
Jan Janssen [Mon, 29 Aug 2022 08:09:01 +0000 (10:09 +0200)] 
boot: Refuse GPT with invalid entry size

SizeOfPartitionEntry must be a multiple of 128 * 2^n.

3 years agoboot: Fix device path unaligned access
Jan Janssen [Wed, 24 Aug 2022 08:31:25 +0000 (10:31 +0200)] 
boot: Fix device path unaligned access

3 years agoboot: Use mempcpy
Jan Janssen [Tue, 6 Sep 2022 08:14:25 +0000 (10:14 +0200)] 
boot: Use mempcpy

3 years agoboot: Add mempcpy
Jan Janssen [Tue, 6 Sep 2022 08:13:50 +0000 (10:13 +0200)] 
boot: Add mempcpy

3 years agoREADME: we don't use crypto API in kernel anymore
Lennart Poettering [Wed, 7 Sep 2022 09:35:47 +0000 (11:35 +0200)] 
README: we don't use crypto API in kernel anymore

This effectively reverts 9c7f7d86f86322b76fc903ca8a06b87c4be4bd4a.

We dropped kernel crypto API use with
1fc8d0c9dd6a21de81e49cfa01af4a4d9a3ed37d, hence catch up in README.

3 years agoREADME: make section title less confusing
Lennart Poettering [Wed, 7 Sep 2022 09:30:21 +0000 (11:30 +0200)] 
README: make section title less confusing

This is about glibc NSS, not about the TLS implementation library NSS.

3 years agoREADME: drop some spurious empty lines, we otherwise don't place after section titles
Lennart Poettering [Wed, 7 Sep 2022 09:29:14 +0000 (11:29 +0200)] 
README: drop some spurious empty lines, we otherwise don't place after section titles

3 years agoMerge pull request #24592 from poettering/coding-style-more2
Lennart Poettering [Wed, 7 Sep 2022 09:27:12 +0000 (11:27 +0200)] 
Merge pull request #24592 from poettering/coding-style-more2

more coding style documentation additions

3 years agoREADME: use right emoji UTF-8 sequences for stop/warning sign 24592/head
Lennart Poettering [Wed, 7 Sep 2022 08:16:04 +0000 (10:16 +0200)] 
README: use right emoji UTF-8 sequences for stop/warning sign

3 years agodocs: Some CODING_STYLE additions
Lennart Poettering [Wed, 7 Sep 2022 08:05:46 +0000 (10:05 +0200)] 
docs: Some CODING_STYLE additions

3 years agoloop-util: fix leak of file descriptor on failure
Yu Watanabe [Tue, 6 Sep 2022 20:36:26 +0000 (05:36 +0900)] 
loop-util: fix leak of file descriptor on failure

3 years agoMerge pull request #15833 from AsamK/busctl_introspect_method_signature
Luca Boccassi [Tue, 6 Sep 2022 21:21:39 +0000 (22:21 +0100)] 
Merge pull request #15833 from AsamK/busctl_introspect_method_signature

busctl: Add introspect support for methods with same name but different signature

3 years agoREADME: clarify baseline situation a bit (add emojis!)
Lennart Poettering [Tue, 6 Sep 2022 14:58:17 +0000 (16:58 +0200)] 
README: clarify baseline situation a bit (add emojis!)

3 years agobusctl: Add introspect support for methods with same name but different signature 15833/head
Sebastian Scheibner [Sun, 17 May 2020 12:52:10 +0000 (14:52 +0200)] 
busctl: Add introspect support for methods with same name but different signature

D-Bus interfaces can have multiple methods with the same name, as long
as they have different arguments (signature). Currently busctl can call
those methods but when introspecting the interface it just displays
"Duplicate method"

This PR fixes the behavior, by also adding the signature to the hash for
the members set.

Before this patch:

$ busctl introspect org.asamk.Signal /org/asamk/Signal
Invalid introspection data: duplicate method 'sendMessage' on interface 'org.asamk.Signal'.

After this patch:

$ busctl introspect org.asamk.Signal /org/asamk/Signal
NAME                                TYPE      SIGNATURE RESULT/VALUE FLAGS
org.asamk.Signal                    interface -         -            -
.sendMessage                        method    as        x            -
.sendMessage                        method    s         x            -

Calling the methods already works as expected, as the user must specify
the signature explicitely:
busctl --user call org.asamk.Signal /org/asamk/Signal org.asamk.Signal sendMessage "as" 2 foo bar
busctl --user call org.asamk.Signal /org/asamk/Signal org.asamk.Signal sendMessage "s" foo

$ busctl --xml introspect org.asamk.Signal /org/asamk/Signal
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/org/asamk/Signal">
 <interface name="org.asamk.Signal">
  <method name="sendMessage" >
   <arg type="as" direction="in"/>
   <arg type="x" direction="out"/>
  </method>
  <method name="sendMessage" >
   <arg type="s" direction="in"/>
   <arg type="x" direction="out"/>
  </method>
 <interface name="org.freedesktop.DBus.Introspectable">
  <method name="Introspect">
   <arg type="s" direction="out"/>
  </method>
 </interface>
 <interface name="org.freedesktop.DBus.Peer">
  <method name="Ping">
  </method>
 </interface>
</node>

3 years agobusctl: Fix warning about invaild introspection data
Sebastian Scheibner [Fri, 22 May 2020 08:37:43 +0000 (10:37 +0200)] 
busctl: Fix warning about invaild introspection data

The set_put function returns 0 if the element is already in the set and
not EEXIST, like e.g. hashmap does.

3 years agotest: don't fail if we don't need any external nss libs
Frantisek Sumsal [Tue, 6 Sep 2022 12:04:37 +0000 (14:04 +0200)] 
test: don't fail if we don't need any external nss libs

On certain systems the `install_libnss()` function might end up with an
empty list of libraries to install, which triggers an assertion in
`image_install()`:

```
I: Install libnss
..//test-functions: line 2721: 1: parameter null or not set
make: *** [Makefile:4: setup] Error 1
```

E.g.:
```
# LD_DEBUG=files getent passwd 2>&1 >/dev/null | sed -n '/calling init: .*libnss_/ {s!^.* /!/!; p}'
/lib64/libnss_sss.so.2
/lib64/libnss_systemd.so.2
# dnf -y remove sssd-client systemd-libs
# LD_DEBUG=files getent passwd 2>&1 >/dev/null | sed -n '/calling init: .*libnss_/ {s!^.* /!/!; p}'
<no output>
```

Let's handle this case gracefully.

3 years agoci(issue-labeler): Add missing policy for `coredump` label
Jan Macku [Tue, 6 Sep 2022 14:01:50 +0000 (16:01 +0200)] 
ci(issue-labeler): Add missing policy for `coredump` label

3 years agoMerge pull request #24425 from poettering/shutdown-lazily
Lennart Poettering [Tue, 6 Sep 2022 14:40:32 +0000 (16:40 +0200)] 
Merge pull request #24425 from poettering/shutdown-lazily

shutdown: lazily umount all API vfs

3 years agoloop-util: store sd_device object for the loop device
Yu Watanabe [Mon, 5 Sep 2022 19:35:54 +0000 (04:35 +0900)] 
loop-util: store sd_device object for the loop device

It will be used in later commits.

3 years agoMerge pull request #24520 from yuwata/udevadm-wait-listen-kernel-uevents
Yu Watanabe [Mon, 5 Sep 2022 23:33:27 +0000 (08:33 +0900)] 
Merge pull request #24520 from yuwata/udevadm-wait-listen-kernel-uevents

udevadm-wait: also listen kernel uevents

3 years agotest: kill plymouthd after initrd transition if it's still running
Frantisek Sumsal [Mon, 5 Sep 2022 19:02:25 +0000 (21:02 +0200)] 
test: kill plymouthd after initrd transition if it's still running

Until now using the INTERACTIVE_DEBUG=yes stuff together with sanitizers
was almost impossible, since the console kept eating up our inputs or
not responding at all. After a painful day of debugging I noticed that
if we use a shell script in the initrd -> root transition, we might end up
with a plymouthd still running, which kept screwing with the tty.

E.g. with initrd -> wrapper -> systemd transition, where the `wrapper`
is a simple script:

```
exec -- /usr/lib/systemd/systemd "$@"
```

we'd end up with a stray plymouthd process after the bootup:

```
 1     0     440       2  20   0      0     0 worker I    ?          0:00 [kworker/5:2-ata_sff]
 1     0     453       2  20   0      0     0 worker I    ?          0:00 [kworker/9:2-rcu_gp]
 5     0     456       1  20   0   7252  1960 do_epo S    ?          0:00 @usr/sbin/plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session
```

After killing it, the tty works finally as expected.

3 years agoudevadm-wait: shorten code a bit 24520/head
Yu Watanabe [Fri, 2 Sep 2022 17:09:06 +0000 (02:09 +0900)] 
udevadm-wait: shorten code a bit

3 years agoudevadm-wait: wait for two periodic timer triggered before exit
Yu Watanabe [Fri, 2 Sep 2022 17:05:30 +0000 (02:05 +0900)] 
udevadm-wait: wait for two periodic timer triggered before exit

3 years agoudevadm-wait: also listen kernel uevent stream if --initialized=no
Yu Watanabe [Wed, 31 Aug 2022 15:32:27 +0000 (00:32 +0900)] 
udevadm-wait: also listen kernel uevent stream if --initialized=no

Suggested at https://github.com/systemd/systemd/pull/24471#discussion_r959703103.

3 years agohwdb: Add accel orientation quirk for the Aya Neo Air
Maccraft123 [Tue, 30 Aug 2022 19:16:17 +0000 (21:16 +0200)] 
hwdb: Add accel orientation quirk for the Aya Neo Air

3 years agoUse original filename for extension name check
Kai Lueke [Mon, 15 Aug 2022 15:47:03 +0000 (17:47 +0200)] 
Use original filename for extension name check

The loading of an extension image from a symlink "NAME.raw" to
"NAME-VERSION.raw" failed because the release file name check worked
with the backing file of the loop device which already resolves the
symlink and thus the found name "NAME-VERSION" mismatched "NAME".
Pass the original filename and use it instead of the backing file
when available. This fixes the loading of "NAME.raw" extensions which
are a symlink to "NAME-VERSION.raw" as, e.g., may be the case when
systemd-sysupdate manages multiple versions.

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

3 years agoMerge pull request #24467 from qdeslandes/nspawn_rootidmap
Yu Watanabe [Mon, 5 Sep 2022 18:45:53 +0000 (03:45 +0900)] 
Merge pull request #24467 from qdeslandes/nspawn_rootidmap

nspawn: add rootidmap as --bind option

3 years agoMerge pull request #24568 from poettering/atou16-atou-rework
Yu Watanabe [Mon, 5 Sep 2022 18:38:41 +0000 (03:38 +0900)] 
Merge pull request #24568 from poettering/atou16-atou-rework

parse-util: simplify safe_atou8() + safe_atou16()

3 years agoudev/rules,hwdb: filter out mostly meaningless default strings
Yu Watanabe [Thu, 25 Aug 2022 19:13:26 +0000 (04:13 +0900)] 
udev/rules,hwdb: filter out mostly meaningless default strings

The filter is generated based on the following results:
---
git clone git@github.com:linuxhw/DMI.git
cd DMI
git grep -h -A2 '^System Information$' | grep 'Manufacturer' | sort | uniq -c | sort -nr | less
git grep -h -A2 '^System Information$' | grep 'Product Name' | sort | uniq -c | sort -nr | less
---

Closes #24446.

3 years agoMerge pull request #24566 from mrc0mmand/TEST-75-fix
Frantisek Sumsal [Mon, 5 Sep 2022 17:48:24 +0000 (17:48 +0000)] 
Merge pull request #24566 from mrc0mmand/TEST-75-fix

test: mark knot.conf tmpfiles config as optional

3 years agoMerge pull request #24567 from poettering/homed-wait-timeout
Zbigniew Jędrzejewski-Szmek [Mon, 5 Sep 2022 16:30:26 +0000 (18:30 +0200)] 
Merge pull request #24567 from poettering/homed-wait-timeout

homed: don't wait for workers without time limit

3 years agonspawn: add support for rootidmap bind option 24467/head
Quentin Deslandes [Sun, 4 Sep 2022 18:30:58 +0000 (20:30 +0200)] 
nspawn: add support for rootidmap bind option

rootidmap bind option will map the root user from the container to the
owner of the mounted directory on the filesystem. This will ensure files
and directories created by the root user in the container will be owned
by the directory owner on the filesystem. All other user will remain
unmapped.

3 years agoparse-util: make safe_atou8() just a wrapper around safe_atou8_full() 24568/head
Lennart Poettering [Mon, 5 Sep 2022 16:08:16 +0000 (18:08 +0200)] 
parse-util: make safe_atou8() just a wrapper around safe_atou8_full()

As in the previous commit: it's just a wrapper around the same
strtoul(), hence let's just share some more code.

3 years agoparse-util: make safe_atou16_full() just a wrapper around safe_atou_full()
Lennart Poettering [Mon, 5 Sep 2022 15:59:52 +0000 (17:59 +0200)] 
parse-util: make safe_atou16_full() just a wrapper around safe_atou_full()

Both are fancy wrappers around strtoul() anyway, not more, hence let's
just make them a wrapper around each other, too, to simplify things a
lot.

3 years agotest: zone-set requires TTL for the first record in the rrset 24566/head
Frantisek Sumsal [Mon, 5 Sep 2022 15:28:04 +0000 (17:28 +0200)] 
test: zone-set requires TTL for the first record in the rrset

I'm not sure why this worked previously.

3 years agotest: mark knot.conf tmpfiles config as optional
Frantisek Sumsal [Mon, 5 Sep 2022 11:54:22 +0000 (13:54 +0200)] 
test: mark knot.conf tmpfiles config as optional

Since it got removed in the recent knot release.

See: https://github.com/CZ-NIC/knot/commit/a6971a4025133a77b29f6d2b381b40dc0499730c