]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 months agoMerge pull request #29529 from yuwata/core-namespace-check-priv
Luca Boccassi [Thu, 26 Oct 2023 13:27:56 +0000 (14:27 +0100)] 
Merge pull request #29529 from yuwata/core-namespace-check-priv

core/namespace: check if we have enough privilege

7 months agovarlink: make sure 'incomplete' bool is nullable
Lennart Poettering [Thu, 26 Oct 2023 07:19:45 +0000 (09:19 +0200)] 
varlink: make sure 'incomplete' bool is nullable

This field is optional, it only makes sense for user records that
actually have a privileged part to set.

7 months agotest: add a simple test for PrivateNetwork= 29529/head
Yu Watanabe [Wed, 11 Oct 2023 04:02:14 +0000 (13:02 +0900)] 
test: add a simple test for PrivateNetwork=

7 months agocore/namespace: check if we have enough privilege to mount sysfs or procfs
Yu Watanabe [Wed, 11 Oct 2023 05:58:38 +0000 (14:58 +0900)] 
core/namespace: check if we have enough privilege to mount sysfs or procfs

If we do not have enough privilege to mount a new instance of sysfs or
procfs, units e.g. with PrivateNetwork=yes may fail.

Let's first try to mount sysfs or procfs anyway to check if we have enough
privilege.

Fixes #29526.

7 months agocore/namespace: unify logic of mounting /proc and /sys
Yu Watanabe [Wed, 11 Oct 2023 05:57:54 +0000 (14:57 +0900)] 
core/namespace: unify logic of mounting /proc and /sys

No functional change, just refactoring.

7 months agoMerge pull request #29718 from yuwata/networkd-update-state-file-after-dhcp6-informat...
Frantisek Sumsal [Thu, 26 Oct 2023 08:16:57 +0000 (08:16 +0000)] 
Merge pull request #29718 from yuwata/networkd-update-state-file-after-dhcp6-information-request

network: update state file when DHCPv6 reply for INFORMATION-REQUEST is received

7 months agocore/cgroup: ignore NFT sets for other sources
Topi Miettinen [Wed, 25 Oct 2023 18:32:35 +0000 (21:32 +0300)] 
core/cgroup: ignore NFT sets for other sources

Partially fixes: #29678

7 months agocore: do not reset tty if there's no tty configured
Luca Boccassi [Wed, 25 Oct 2023 14:15:02 +0000 (15:15 +0100)] 
core: do not reset tty if there's no tty configured

Otherwise a lock is taken, which can be taken by multiple units at the
same time, depending on each other, causing a deadlock.

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

7 months agoinotify-util: drop to use pointer outside of the buffer
Yu Watanabe [Tue, 24 Oct 2023 18:56:10 +0000 (03:56 +0900)] 
inotify-util: drop to use pointer outside of the buffer

Hopefully fixes many Coverity issues.

7 months agotree-wide: fix typo
Yu Watanabe [Thu, 26 Oct 2023 03:42:49 +0000 (12:42 +0900)] 
tree-wide: fix typo

7 months agotest-network: suppress too much outputs of state file 29718/head
Yu Watanabe [Thu, 26 Oct 2023 03:26:15 +0000 (12:26 +0900)] 
test-network: suppress too much outputs of state file

Follow-up for 0f9efffaeb84964a3ab0f32271fba38f3bee2394.

7 months agonetwork: update state file when DHCPv6 reply for INFORMATION-REQUEST is received
Yu Watanabe [Thu, 26 Oct 2023 03:19:40 +0000 (12:19 +0900)] 
network: update state file when DHCPv6 reply for INFORMATION-REQUEST is received

Otherwise, received information, e.g. DNS servers, may not be saved in
the state file, and will not be propagated to clients like resolved.

Fixes the first issue of #29678.

7 months agodissect: insert missing space
Yu Watanabe [Tue, 24 Oct 2023 10:32:04 +0000 (19:32 +0900)] 
dissect: insert missing space

7 months agoMerge pull request #29708 from DaanDeMeyer/bootctl-always
Daan De Meyer [Wed, 25 Oct 2023 20:59:59 +0000 (22:59 +0200)] 
Merge pull request #29708 from DaanDeMeyer/bootctl-always

Always build bootctl

7 months agoMerge pull request #29710 from mrc0mmand/test-pcrextend
Luca Boccassi [Wed, 25 Oct 2023 20:13:56 +0000 (21:13 +0100)] 
Merge pull request #29710 from mrc0mmand/test-pcrextend

test: TEST-70-TPM2 shenagians

7 months agorandom-seed: terminate the option array
Frantisek Sumsal [Wed, 25 Oct 2023 17:25:38 +0000 (19:25 +0200)] 
random-seed: terminate the option array

So we don't crash on invalid options:

$ build/systemd-random-seed --foo
Segmentation fault (core dumped)

7 months agoman/systemd.unit: add PropagatesStopTo= to reverse property table
Mike Yuan [Wed, 25 Oct 2023 12:54:49 +0000 (20:54 +0800)] 
man/systemd.unit: add PropagatesStopTo= to reverse property table

7 months agotest: slightly extend systemd-tpm2-setup's coverage 29710/head
Frantisek Sumsal [Wed, 25 Oct 2023 15:57:08 +0000 (17:57 +0200)] 
test: slightly extend systemd-tpm2-setup's coverage

7 months agotpm2-setup: drop the COMMAND placeholder from the help
Frantisek Sumsal [Wed, 25 Oct 2023 16:04:26 +0000 (18:04 +0200)] 
tpm2-setup: drop the COMMAND placeholder from the help

Since systemd-tpm2-setup doesn't expect any arguments.

7 months agotpm2-setup: terminate the option array
Frantisek Sumsal [Wed, 25 Oct 2023 15:52:19 +0000 (17:52 +0200)] 
tpm2-setup: terminate the option array

Otherwise bad things happen:

$ build/systemd-tpm2-setup --foo
Segmentation fault (core dumped)

7 months agotest: add a couple more tests for systemd-pcrextend
Frantisek Sumsal [Wed, 25 Oct 2023 15:42:07 +0000 (17:42 +0200)] 
test: add a couple more tests for systemd-pcrextend

7 months agotest: make the TPM event log checking a bit more robust
Frantisek Sumsal [Wed, 25 Oct 2023 15:40:05 +0000 (17:40 +0200)] 
test: make the TPM event log checking a bit more robust

Don't hardcode the event number, so the test works correctly even if
someone wrote to the event log before us. Also, explicitly pick the
sha256 bank when checking digests, as the indexing may vary depending on
current TPM's capabilities.

7 months agomeson: Always build systemd-measure 29708/head
Daan De Meyer [Wed, 25 Oct 2023 14:48:35 +0000 (16:48 +0200)] 
meson: Always build systemd-measure

Same idea as with bootctl, we might be doing image builds from a
system that doesn't boot with UEFI but we still might want to measure
stuff for the image we're building so let's not gate this behind
ENABLE_BOOTLOADER.

7 months agomeson: Always build bootctl
Daan De Meyer [Wed, 25 Oct 2023 14:45:06 +0000 (16:45 +0200)] 
meson: Always build bootctl

bootctl is rather useful to have, even if on a system without UEFI,
as it has a number of verbs that are unrelated to UEFI (e.g kernel-identify),
and more importantly, it supports --root to operate on directory trees
(which could be intended to be deployed on UEFI) so let's make sure we
always build it.

7 months agonspawn: allow user-specified MAC address on container side
Raul Cheleguini [Wed, 4 Oct 2023 02:06:38 +0000 (23:06 -0300)] 
nspawn: allow user-specified MAC address on container side

Introduce the environment variable SYSTEMD_NSPAWN_NETWORK_MAC to allow
user-specified MAC address on container side.

7 months agotest: split TEST-70-TPM2 into subtests
Frantisek Sumsal [Wed, 25 Oct 2023 12:48:30 +0000 (14:48 +0200)] 
test: split TEST-70-TPM2 into subtests

7 months agoMerge pull request #29704 from mrc0mmand/cocci
Luca Boccassi [Wed, 25 Oct 2023 12:42:21 +0000 (13:42 +0100)] 
Merge pull request #29704 from mrc0mmand/cocci

Another round of Coccinelle tweaks

7 months agoMerge pull request #29695 from poettering/repart-reduce-global-vars
Luca Boccassi [Wed, 25 Oct 2023 12:18:38 +0000 (13:18 +0100)] 
Merge pull request #29695 from poettering/repart-reduce-global-vars

repart,cryptenroll: three smaller tweaks

7 months agocryptsetup: remove redundant check
Lennart Poettering [Tue, 24 Oct 2023 16:15:36 +0000 (18:15 +0200)] 
cryptsetup: remove redundant check

The immediately preceeding check already covered that.

This removes and addition made back in aae6eb96117acd54ce5ac572aac6a11b34c4ad99.

cc @williamcroberts

7 months agoMerge pull request #29698 from poettering/tpm2-no-best-pcr
Luca Boccassi [Wed, 25 Oct 2023 12:18:03 +0000 (13:18 +0100)] 
Merge pull request #29698 from poettering/tpm2-no-best-pcr

tpm2: minor tweaks

7 months agoudev: strdupa() → strdupa_safe() 29704/head
Frantisek Sumsal [Wed, 25 Oct 2023 09:29:20 +0000 (11:29 +0200)] 
udev: strdupa() → strdupa_safe()

7 months agonetwork: use timestamp_is_set() in one more place
Frantisek Sumsal [Wed, 25 Oct 2023 09:28:12 +0000 (11:28 +0200)] 
network: use timestamp_is_set() in one more place

7 months agonetwork: ENOTSUP → EOPNOTSUPP
Frantisek Sumsal [Wed, 25 Oct 2023 09:26:19 +0000 (11:26 +0200)] 
network: ENOTSUP → EOPNOTSUPP

7 months agocore,journal: drop unnecessary !! casts
Frantisek Sumsal [Wed, 25 Oct 2023 09:21:40 +0000 (11:21 +0200)] 
core,journal: drop unnecessary !! casts

7 months agococcinelle: don't run iovec-make on iovec_done{,_erase}
Frantisek Sumsal [Wed, 25 Oct 2023 09:16:37 +0000 (11:16 +0200)] 
coccinelle: don't run iovec-make on iovec_done{,_erase}

As the result is a bit funky (but still valid), i.e.:

 static inline void iovec_done_erase(struct iovec *iovec) {
         assert(iovec);

-        iovec->iov_base = erase_and_free(iovec->iov_base);
-        iovec->iov_len = 0;
+        *iovec = IOVEC_MAKE(erase_and_free(iovec->iov_base), 0);
 }

7 months agoMerge pull request #29553 from keszybz/analyze-cat-config-tldr
Luca Boccassi [Wed, 25 Oct 2023 08:53:19 +0000 (09:53 +0100)] 
Merge pull request #29553 from keszybz/analyze-cat-config-tldr

analyze/cat-config: add switch to print only "interesting" parts of conffiles

7 months agotpm2-util: add line breaks in compound struct init, like we usually do
Lennart Poettering [Tue, 24 Oct 2023 21:14:23 +0000 (23:14 +0200)] 
tpm2-util: add line breaks in compound struct init, like we usually do

7 months agoMerge pull request #29687 from yuwata/network-state-file-sync
Frantisek Sumsal [Wed, 25 Oct 2023 08:29:58 +0000 (08:29 +0000)] 
Merge pull request #29687 from yuwata/network-state-file-sync

network: several fixlets for state file

7 months agocryptenroll: validate positional arguments before looking at detail parameters 29695/head
Lennart Poettering [Tue, 24 Oct 2023 20:54:39 +0000 (22:54 +0200)] 
cryptenroll: validate positional arguments before looking at detail parameters

Let's switch the order in which we process positional arguments and
analyze/tweak detail parameters. Let's look at the positional arguments
first (i.e. the "big picture") and then look at the switches (i.e.
"little details").

THis doesn't matter much, but makes for better error messages I think.
At least I was very confused that a completely borked cmdline I passed
to cryptenrolled complained about some detail and let the major fuckup
pass...

7 months agocryptenroll: add section headers to --help text
Lennart Poettering [Tue, 24 Oct 2023 20:41:26 +0000 (22:41 +0200)] 
cryptenroll: add section headers to --help text

7 months agocryptenroll: add addition asserts
Lennart Poettering [Tue, 24 Oct 2023 20:41:57 +0000 (22:41 +0200)] 
cryptenroll: add addition asserts

7 months agorepart: reduce scope of two variables
Lennart Poettering [Tue, 24 Oct 2023 20:42:21 +0000 (22:42 +0200)] 
repart: reduce scope of two variables

This replicates what 475c473d328c12f5e9fd43cee959154a0d0c78a4 did for
cryptenroll for repart, which has very similar code for this.

7 months agotpm2-util: add line breaks in compound struct init, like we usually do 29698/head
Lennart Poettering [Tue, 24 Oct 2023 21:14:23 +0000 (23:14 +0200)] 
tpm2-util: add line breaks in compound struct init, like we usually do

7 months agotpm2-util: dont't find best PCR bank if no PCRs are selected whatsoever
Lennart Poettering [Tue, 24 Oct 2023 20:19:48 +0000 (22:19 +0200)] 
tpm2-util: dont't find best PCR bank if no PCRs are selected whatsoever

This will otherwise just yield weird log message, complaining that PCRs
were not initialized. But which PCRs if we have none selected?

7 months agoexecute: log about failures when opening a terminal to reset
Lennart Poettering [Tue, 24 Oct 2023 14:45:32 +0000 (16:45 +0200)] 
execute: log about failures when opening a terminal to reset

7 months agomount-util: add one more const
Lennart Poettering [Tue, 24 Oct 2023 16:18:18 +0000 (18:18 +0200)] 
mount-util: add one more const

7 months agoupdate TODO
Lennart Poettering [Tue, 24 Oct 2023 14:45:06 +0000 (16:45 +0200)] 
update TODO

7 months agoMerge pull request #29689 from mrc0mmand/test-shutdown
Luca Boccassi [Tue, 24 Oct 2023 19:39:34 +0000 (20:39 +0100)] 
Merge pull request #29689 from mrc0mmand/test-shutdown

test: shorten service stop/abort timeouts for TEST-69-SHUTDOWN

7 months agoMerge pull request #29677 from keszybz/rewinddir-alternative-fix
Luca Boccassi [Tue, 24 Oct 2023 18:41:02 +0000 (19:41 +0100)] 
Merge pull request #29677 from keszybz/rewinddir-alternative-fix

Rewind dir fd before using it for cleanup

7 months agosleep-config: make hybrid sleep always use 'suspend' disk mode
Mike Yuan [Tue, 24 Oct 2023 10:10:21 +0000 (18:10 +0800)] 
sleep-config: make hybrid sleep always use 'suspend' disk mode

If user requests hybrid sleep, we should always use 'suspend'
disk mode. If that's not supported, let's correctly report it
so they can choose plain hibernation instead. HybridSleepMode=
serves no purpose in this case and should be removed.

Addresses https://github.com/systemd/systemd/pull/29681#discussion_r1369812785

7 months agoshared/pretty-print: skip redundant section headers with --tldr 29553/head
Zbigniew Jędrzejewski-Szmek [Tue, 17 Oct 2023 17:11:44 +0000 (19:11 +0200)] 
shared/pretty-print: skip redundant section headers with --tldr

If the same section appears consecutively in a given file, subsequent
occurenced are not printed.

[Slice]
Foo=bar
[Slice]   # this is not printed
Bar=bar

Requested in
https://github.com/systemd/systemd/pull/29553#pullrequestreview-1677310352.

7 months agobinfmt: add --tldr
Zbigniew Jędrzejewski-Szmek [Sun, 15 Oct 2023 16:34:54 +0000 (18:34 +0200)] 
binfmt: add --tldr

7 months agosysctl: add --tldr
Zbigniew Jędrzejewski-Szmek [Sun, 15 Oct 2023 16:34:38 +0000 (18:34 +0200)] 
sysctl: add --tldr

7 months agosysusers: add --tldr
Zbigniew Jędrzejewski-Szmek [Sun, 15 Oct 2023 16:34:05 +0000 (18:34 +0200)] 
sysusers: add --tldr

7 months agotmpfiles: add --tldr
Zbigniew Jędrzejewski-Szmek [Sun, 15 Oct 2023 16:33:10 +0000 (18:33 +0200)] 
tmpfiles: add --tldr

This is like --cat-config, but omits the comments and empty lines.
The name is incoungrous with --cat-config, but I don't see a nice way to
call it that wouldn't be annoyingly long.

pager_open() is moved to cat_config() to remove some lines from run().

7 months agoshared/pretty-print: add highlighting
Zbigniew Jędrzejewski-Szmek [Sat, 14 Oct 2023 16:49:35 +0000 (18:49 +0200)] 
shared/pretty-print: add highlighting

7 months agotest-network: wait for the state file being updated 29687/head
Yu Watanabe [Tue, 24 Oct 2023 09:38:30 +0000 (18:38 +0900)] 
test-network: wait for the state file being updated

Also, sync state files before read.

Addresses the first issue in #29678.

7 months agoanalyze/cat-config: add switch to print only "interesting" parts of config files
Zbigniew Jędrzejewski-Szmek [Thu, 12 Oct 2023 14:33:01 +0000 (16:33 +0200)] 
analyze/cat-config: add switch to print only "interesting" parts of config files

When looking at configuration, often a user wants to suppress the comments and
just look at the parts that actually configure something, roughly equivalent to
  systemd-analyze cat-config … | rg -v '^(#|;|$)
This switch implements this natively, skipping lines that start with a comment
character or only contain whitespace.

For formats that have section headers, section headers are skipped, if only
followed by stuff that would be skipped. (The last section header is printed
when we're about to print some actual output.)

Note that the caller doesn't know if the format has headers or not. We do format
type detection in pretty-print.c. So the caller only specifies tldr=true|false, and
conf_files_cat() figures out if the format has headers and whether those should
be handled specially.

The comments that show the file name are always printed, even if all of the file
is suppressed.

This is a partial answer to the discussions in
https://github.com/systemd/systemd/pull/28919,
https://github.com/systemd/systemd/pull/29248. If the default config is shown in
config files, the user can conveniently use '--tldr' to show the relevant parts.

7 months agoshared/copy: rewind dir fd before using it for cleanup 29677/head
Zbigniew Jędrzejewski-Szmek [Mon, 23 Oct 2023 12:06:32 +0000 (14:06 +0200)] 
shared/copy: rewind dir fd before using it for cleanup

This seems to be the only place where rm_rf_children() is called with a
possibly used fd, which is then passed through to rm_rf_children_impl().

This also fixes #29606.
(Tested on Fedora rawhide with kernel 6.5.6-300.fc39.x86_64.)

7 months agoMerge pull request #29601 from yuwata/mmap-check-overflow
Luca Boccassi [Tue, 24 Oct 2023 11:20:04 +0000 (12:20 +0100)] 
Merge pull request #29601 from yuwata/mmap-check-overflow

mmap: check offset and size more carefully

7 months agotest: shorten service stop/abort timeouts for TEST-69-SHUTDOWN 29689/head
Frantisek Sumsal [Tue, 24 Oct 2023 10:41:54 +0000 (12:41 +0200)] 
test: shorten service stop/abort timeouts for TEST-69-SHUTDOWN

In several Ubuntu CI jobs I noticed timeouts in TEST-69, which are
apparently caused by a very stubborn bash/login process:

$ journalctl -o short-monotonic --no-hostname --file artifacts/TEST-69-SHUTDOWN.journal
[ 2011.698430] systemd[1]: shutdown.target: starting held back, waiting for: veritysetup.target
[ 2011.698473] systemd[1]: sysinit.target: stopping held back, waiting for: user@0.service
[ 2045.884982] systemd[1]: systemd-oomd.service: Got notification message from PID 54 (WATCHDOG=1)
[ 2071.576424] systemd[1]: Received SIGCHLD from PID 65 (bash).
[ 2071.576941] systemd[1]: Child 65 (bash) died (code=killed, status=1/HUP)
[ 2071.577026] systemd[1]: session-13.scope: Child 65 belongs to session-13.scope.
[ 2071.577100] systemd[1]: session-13.scope: cgroup is empty
[ 2071.577249] systemd[1]: session-13.scope: Deactivated successfully.

$ journalctl -o short-monotonic --no-hostname --file artifacts/TEST-69-SHUTDOWN.journal _PID=65
[ 3038.661488] login[65]: ROOT LOGIN  on '/dev/pts/0'

Since, in this case, we really care only about the actual shutdown,
let's shorten the service stop/abort timeouts to let systemd SIGKILL all
remaining processes in the 60s `expect` window.

7 months agotest: introduce $TEST_SKIP_SHUTDOWN
Frantisek Sumsal [Tue, 24 Oct 2023 10:35:03 +0000 (12:35 +0200)] 
test: introduce $TEST_SKIP_SHUTDOWN

To get rid of some boilerplate.

7 months agoMerge pull request #29685 from poettering/cryptenroll-reduce-scope
Luca Boccassi [Tue, 24 Oct 2023 09:49:37 +0000 (10:49 +0100)] 
Merge pull request #29685 from poettering/cryptenroll-reduce-scope

cryptenroll: two minor simplifications

7 months agonetwork: also synchronously update manager state file
Yu Watanabe [Tue, 24 Oct 2023 09:33:45 +0000 (18:33 +0900)] 
network: also synchronously update manager state file

7 months agonetwork: make link_save() static
Yu Watanabe [Tue, 24 Oct 2023 09:25:47 +0000 (18:25 +0900)] 
network: make link_save() static

7 months agonetwork: do not try to save link state file twice on boot
Yu Watanabe [Tue, 24 Oct 2023 09:13:08 +0000 (18:13 +0900)] 
network: do not try to save link state file twice on boot

On enumeration, (that is, before manager_start() is called), enumerated
links may already have the dirty flag. In that case, saving the state
file in manager_start() should clear the flag.

7 months agoMerge pull request #29681 from YHNdnzj/sleep-round-three
Mike Yuan [Tue, 24 Oct 2023 09:03:54 +0000 (17:03 +0800)] 
Merge pull request #29681 from YHNdnzj/sleep-round-three

sleep-config: cleanup round three

7 months agoMerge pull request #29679 from keszybz/drop-iovec-null
Yu Watanabe [Tue, 24 Oct 2023 08:05:45 +0000 (17:05 +0900)] 
Merge pull request #29679 from keszybz/drop-iovec-null

Drop IOVEC_NULL

7 months agobasic/iovec-util: use FOREACH_ARRAY in one more place 29679/head
Zbigniew Jędrzejewski-Szmek [Mon, 23 Oct 2023 20:30:28 +0000 (22:30 +0200)] 
basic/iovec-util: use FOREACH_ARRAY in one more place

7 months agobasic/iovec-util: drop TAKE_IOVEC
Zbigniew Jędrzejewski-Szmek [Mon, 23 Oct 2023 20:23:07 +0000 (22:23 +0200)] 
basic/iovec-util: drop TAKE_IOVEC

As suggested in
https://github.com/systemd/systemd/pull/29679#discussion_r1368678932.

7 months agocryptenroll: merge two if checks with same condition 29685/head
Lennart Poettering [Mon, 23 Oct 2023 20:17:46 +0000 (22:17 +0200)] 
cryptenroll: merge two if checks with same condition

This removes a duplicate condition check by adding a common surrounding
if block.

This also change a confusing if check: "(X && Y) && Z" to simply "X && Y && Z"

7 months agocryptenroll: reduce scope of two global variables
Lennart Poettering [Mon, 23 Oct 2023 20:12:46 +0000 (22:12 +0200)] 
cryptenroll: reduce scope of two global variables

No change in behaviour

7 months agosystemctl: fallback if logind doesn't support new flag
Luca Boccassi [Mon, 23 Oct 2023 15:43:33 +0000 (16:43 +0100)] 
systemctl: fallback if logind doesn't support new flag

Follow-up for 665a3d6d15c09428

7 months agoMerge pull request #29633 from yuwata/dhcp-ipv6-only-mode-follow-ups
Luca Boccassi [Mon, 23 Oct 2023 17:39:10 +0000 (18:39 +0100)] 
Merge pull request #29633 from yuwata/dhcp-ipv6-only-mode-follow-ups

dhcp: several follow-ups for IPv6 only mode

7 months agosleep-config: check sleep mode only when hibernation 29681/head
Mike Yuan [Mon, 23 Oct 2023 13:19:29 +0000 (21:19 +0800)] 
sleep-config: check sleep mode only when hibernation

With the previous change, this should only be used when
doing hibernation.

7 months agosleep-config: remove HibernateState= & HybridSleepState=, restrict
Mike Yuan [Fri, 20 Oct 2023 16:21:20 +0000 (00:21 +0800)] 
sleep-config: remove HibernateState= & HybridSleepState=, restrict
SuspendState= not to include "disk"

I don't know why these existed in the first place, but as I
justified in the comments, it's simply not sensible to allow
HibernateState= or HybridSleepState= to take values other than
'disk'. So let's just remove those options. Also, SuspendState=
should not contain 'disk'.

7 months agohibernate-util: add missing assertion
Mike Yuan [Sat, 21 Oct 2023 11:53:04 +0000 (19:53 +0800)] 
hibernate-util: add missing assertion

7 months agohibernate-resume: add missing static for arg_info
Mike Yuan [Mon, 23 Oct 2023 13:02:25 +0000 (21:02 +0800)] 
hibernate-resume: add missing static for arg_info

7 months agotimedatectl: add missing commands to the help output
Antonio Alvarez Feijoo [Mon, 23 Oct 2023 13:29:40 +0000 (15:29 +0200)] 
timedatectl: add missing commands to the help output

Follow up to 159a855b34c35484c28cf4b0178f93bc16447fac

7 months agobasic/iovec-util: drop IOVEC_NULL
Zbigniew Jędrzejewski-Szmek [Mon, 23 Oct 2023 12:59:17 +0000 (14:59 +0200)] 
basic/iovec-util: drop IOVEC_NULL

The macro isn't very useful, we can just use the direct setting to increase
readability.

7 months agobasic/iovec-util: always call the iovec "iovec"
Zbigniew Jędrzejewski-Szmek [Mon, 23 Oct 2023 12:51:43 +0000 (14:51 +0200)] 
basic/iovec-util: always call the iovec "iovec"

We were using "i", "iov", and "iovec" in variuos places. Let's be
consistent.

7 months agoRevert "rm-rf: Make sure we rewinddir() before readdir()"
Zbigniew Jędrzejewski-Szmek [Mon, 23 Oct 2023 11:56:38 +0000 (13:56 +0200)] 
Revert "rm-rf: Make sure we rewinddir() before readdir()"

This reverts commit 6bbb893b90e2dcb05fb310ba4608f9c9dc587845.

Let's try a different approach where we make sure that all callers only pass in
a fd that is "clean", i.e. at offset 0. The majority of callers of this function
(both direct and indirect) pass a freshly-opened fd, so the rewind call is not
needed.

7 months agoMerge pull request #29674 from poettering/unexport-marshal-blob
Luca Boccassi [Mon, 23 Oct 2023 10:43:15 +0000 (11:43 +0100)] 
Merge pull request #29674 from poettering/unexport-marshal-blob

tpm2-util: make tpm2_marshal_blob()/tpm2_unmarshal_blob() static

7 months agoglyph-util: add 'full block' glyph
Lennart Poettering [Wed, 12 Jul 2023 20:28:12 +0000 (22:28 +0200)] 
glyph-util: add 'full block' glyph

7 months agopcrextend: split out word to measure code into shared helper file
Lennart Poettering [Sun, 16 Jul 2023 09:09:30 +0000 (11:09 +0200)] 
pcrextend: split out word to measure code into shared helper file

Let's split out the logic that actually generates the word to measure to
PCRs into a new helper file pcrextend-util.[ch].

This we can later reuse to calculate PCR measurement predictions ahead
of time.

7 months agoefi-api: export UUID converter calls
Lennart Poettering [Mon, 14 Aug 2023 11:29:07 +0000 (13:29 +0200)] 
efi-api: export UUID converter calls

(while exporting, do some minor simplifications)

8 months agotpm2-util: make tpm2_read_public() static, as we use it only internally in tpm2-util.c 29674/head
Lennart Poettering [Sat, 21 Oct 2023 14:33:41 +0000 (16:33 +0200)] 
tpm2-util: make tpm2_read_public() static, as we use it only internally in tpm2-util.c

8 months agotpm2-util: make tpm2_marshal_blob()/tpm2_unmarshal_blob() static
Lennart Poettering [Mon, 23 Oct 2023 08:18:41 +0000 (10:18 +0200)] 
tpm2-util: make tpm2_marshal_blob()/tpm2_unmarshal_blob() static

These are not used outside of tpm2-util.[ch], and the way they merge
public/private key pair into one blob is kinda specific to our
implementation, hence better should be hidden away, and not used for new
code anyway.

8 months agocreds-utils: fix read_full_file_full call in read_credential_with_decryption
Julien Malka [Mon, 23 Oct 2023 00:37:40 +0000 (00:37 +0000)] 
creds-utils: fix read_full_file_full call in read_credential_with_decryption

data was passed as a null pointer when an address was expected.
As a result, the assert was always tripped.

8 months agodocs: correct parenthesis placement in 'man/tmpfiles.d.xml'
NAHO [Sun, 22 Oct 2023 16:34:24 +0000 (18:34 +0200)] 
docs: correct parenthesis placement in 'man/tmpfiles.d.xml'

Correct the parenthesis placement in 'man/tmpfiles.d.xml' to prevent the
following formatting:

> lock ( shared or exclusive) is

8 months agotpm2-util: rename tpm2_calculate_name() → tpm2_calculate_pubkey_name()
Lennart Poettering [Sat, 21 Oct 2023 14:17:39 +0000 (16:17 +0200)] 
tpm2-util: rename tpm2_calculate_name() → tpm2_calculate_pubkey_name()

We'll soon have a function for determining the name of an NV index,
hence let's rename the existing function for the same of a public key to
make clear it's about public keys only.

8 months agoMerge pull request #29382 from YHNdnzj/sleep-round-two
Luca Boccassi [Sat, 21 Oct 2023 10:51:09 +0000 (11:51 +0100)] 
Merge pull request #29382 from YHNdnzj/sleep-round-two

shared/sleep-config,hibernate-util: cleanup round two

8 months agounits: modprobe@.service: don't unescape instance name
Martin Wilck [Fri, 20 Oct 2023 14:25:15 +0000 (16:25 +0200)] 
units: modprobe@.service: don't unescape instance name

modprobe treats "-" and "_" interchangeably, thereby avoiding frequent
errors because some module names contain dashes and others underscores.

Because modprobe@.service unescapes the instance name, an attempt to
start "modprobe@dm-crypt.service" will run "modprobe -abq dm/crypt",
which is doomed to fail. "modprobe@dm_crypt.service" will work as
expected. Thus unescaping the instance name has surprising side effects.
Use "%i" instead.

8 months agotest: install af_packet kernel module on openSUSE
Franck Bui [Fri, 20 Oct 2023 17:54:53 +0000 (19:54 +0200)] 
test: install af_packet kernel module on openSUSE

Currently needed by test-dhcp-server unit test, af_packet is not built-in on
openSUSE distributions.

8 months agoMerge pull request #29652 from yuwata/dhcp-cleanup-headers
Luca Boccassi [Sat, 21 Oct 2023 10:38:23 +0000 (11:38 +0100)] 
Merge pull request #29652 from yuwata/dhcp-cleanup-headers

dhcp: cleanup headers

8 months agoMerge pull request #29650 from YHNdnzj/more-followup
Luca Boccassi [Sat, 21 Oct 2023 10:37:38 +0000 (11:37 +0100)] 
Merge pull request #29650 from YHNdnzj/more-followup

Some more follow-ups for recent PRs

8 months agoshared/mount-util: log correct errno 29650/head
Mike Yuan [Fri, 20 Oct 2023 04:09:06 +0000 (12:09 +0800)] 
shared/mount-util: log correct errno

Follow-up for 5f48198af82e5a6f40adf887291fdd47bcecf64c

8 months agoman,docs: suffix directories with /
Mike Yuan [Fri, 20 Oct 2023 14:52:12 +0000 (22:52 +0800)] 
man,docs: suffix directories with /

8 months agocore/execute: use FOREACH_ARRAY and free_many more
Mike Yuan [Fri, 20 Oct 2023 06:54:49 +0000 (14:54 +0800)] 
core/execute: use FOREACH_ARRAY and free_many more

8 months agonetwork,dhcp: restart client with 'networkctl renew' when delayed by IPv6 only mode 29633/head
Yu Watanabe [Thu, 19 Oct 2023 16:35:03 +0000 (01:35 +0900)] 
network,dhcp: restart client with 'networkctl renew' when delayed by IPv6 only mode

This is convenient when the server supports IPv6 only mode.
Otherwise, we cannot request a new address during the client is waiting an
IPv6 connectivity. Note, the minimal timespan is 5min, and a server may
send a quite large value.