]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
13 months agomeson: tweak meson conditionalization for ssh{d,}_config drop-ins 34297/head
Lennart Poettering [Mon, 9 Sep 2024 11:59:10 +0000 (13:59 +0200)] 
meson: tweak meson conditionalization for ssh{d,}_config drop-ins

Let's make sure "no" is an acceptable setting for these paths.

13 months agoshell: define three system credentials we can propagate into shell prompts and welcom...
Lennart Poettering [Fri, 6 Sep 2024 14:30:54 +0000 (16:30 +0200)] 
shell: define three system credentials we can propagate into shell prompts and welcome messages

13 months agomachinectl: suppress redirection notice if --quiet is specified
Lennart Poettering [Fri, 31 May 2024 10:12:24 +0000 (12:12 +0200)] 
machinectl: suppress redirection notice if --quiet is specified

13 months agocore: Add support for PrivateUsers=identity
Daan De Meyer [Mon, 9 Sep 2024 10:25:28 +0000 (12:25 +0200)] 
core: Add support for PrivateUsers=identity

This configures an indentity mapping similar to
systemd-nspawn --private-users=identity.

13 months agoupdate keyboard hwdb to add acer Predator PHN16-72
Yanqing Jing [Mon, 9 Sep 2024 12:18:40 +0000 (20:18 +0800)] 
update keyboard hwdb to add acer Predator PHN16-72

13 months agoMerge pull request #34258 from yuwata/nspawn-volatile-u
Lennart Poettering [Mon, 9 Sep 2024 15:11:11 +0000 (17:11 +0200)] 
Merge pull request #34258 from yuwata/nspawn-volatile-u

nspawn: make --volatile work with -U

13 months agosysupdate: Add --transfer-source=
Daan De Meyer [Sun, 8 Sep 2024 14:09:19 +0000 (16:09 +0200)] 
sysupdate: Add --transfer-source=

In mkosi, I want to add a sysupdate verb to wrap systemd-sysupdate.
The definitions will be picked up from mkosi.sysupdate/ and passed
to systemd-sysupdate. I want users to be able to write transfer
definitions that are independent of the output directory used by
mkosi. To make this possible, it should be possible to specify the
directory that transfer sources should be looked up in on the sysupdate
command line. Let's allow this via a new --transfer-source= option.

Additionally, transfer sources that want to take advantage of this
feature should specify PathRelativeTo=directory to indicate the configured
Path= is interpreted relative to the tranfer source directory specified
on the CLI.

This allows for the following transfer definition to be put in
mkosi.sysupdate:

"""
[Transfer]
ProtectVersion=%A

[Source]
Type=regular-file
Path=/
PathRelativeTo=directory
MatchPattern=ParticleOS_@v.usr-%a.@u.raw

[Target]
Type=partition
Path=auto
MatchPattern=ParticleOS_@v
MatchPartitionType=usr
PartitionFlags=0
ReadOnly=1
"""

13 months agoMerge pull request #33833 from YHNdnzj/manager-reload-assert
Mike Yuan [Mon, 9 Sep 2024 12:21:57 +0000 (14:21 +0200)] 
Merge pull request #33833 from YHNdnzj/manager-reload-assert

core/manager: do not re-init Manager.lookup_paths when manager_reload(), minor assorted cleanups

13 months agorepart: Initialize split_name_format in copy_from_one()
Daan De Meyer [Sun, 8 Sep 2024 08:27:55 +0000 (10:27 +0200)] 
repart: Initialize split_name_format in copy_from_one()

Let's allow splitting the partitions from an existing disk image
by initializing split_name_format when using --copy-from=.

13 months agoMerge pull request #34307 from yuwata/linux-more-network-headers
Yu Watanabe [Mon, 9 Sep 2024 10:33:14 +0000 (19:33 +0900)] 
Merge pull request #34307 from yuwata/linux-more-network-headers

linux: import more network headers

13 months agoMerge pull request #34067 from LukeShu/lukeshu/nspawn-fuse
Yu Watanabe [Mon, 9 Sep 2024 10:32:16 +0000 (19:32 +0900)] 
Merge pull request #34067 from LukeShu/lukeshu/nspawn-fuse

nspawn: enable FUSE in containers

13 months agomissing_socket: drop unnecessary definitions 34307/head
Yu Watanabe [Sat, 7 Sep 2024 15:15:38 +0000 (00:15 +0900)] 
missing_socket: drop unnecessary definitions

Now, we have copy of vm_sockets.h, hence these definitions are not
necessary anymore.

13 months agomissing_network: drop unnecessary definition
Yu Watanabe [Sat, 7 Sep 2024 15:19:20 +0000 (00:19 +0900)] 
missing_network: drop unnecessary definition

Now we have ipv6.h, hence the definition is not necessary anymore.

13 months agoarphrd-list: use imported linux/if_arp.h
Yu Watanabe [Sat, 7 Sep 2024 14:36:06 +0000 (23:36 +0900)] 
arphrd-list: use imported linux/if_arp.h

13 months agolinux: import more network related headers from v6.11-rc6
Yu Watanabe [Sat, 7 Sep 2024 14:25:41 +0000 (23:25 +0900)] 
linux: import more network related headers from v6.11-rc6

Hopefully, no effective change.

13 months agoterminal-util: correct fd validity check
Mike Yuan [Sat, 7 Sep 2024 19:27:20 +0000 (21:27 +0200)] 
terminal-util: correct fd validity check

Follow-up for 14f594b995bbaea85456a4c26e5c07446a4c446e

13 months agoFix typo in escape.c
samuelvw01 [Sun, 8 Sep 2024 08:46:30 +0000 (10:46 +0200)] 
Fix typo in escape.c

13 months agoTODO: fix typo
Erik Sjölund [Sun, 8 Sep 2024 06:40:23 +0000 (08:40 +0200)] 
TODO: fix typo

13 months agoFix grammar in udevadm settle timeout message
marginaldev [Sun, 8 Sep 2024 02:35:11 +0000 (22:35 -0400)] 
Fix grammar in udevadm settle timeout message

14 months agonspawn: enable FUSE in containers 34067/head
Luke T. Shumaker [Wed, 21 Aug 2024 23:29:10 +0000 (17:29 -0600)] 
nspawn: enable FUSE in containers

Linux kernel v4.18 (2018-08-12) added user-namespace support to FUSE, and
bumped the FUSE version to 7.27 (see: da315f6e0398 (Merge tag
'fuse-update-4.18' of
git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse, Linus Torvalds,
2018-06-07).  This means that on such kernels it is safe to enable FUSE in
nspawn containers.

In outer_child(), before calling copy_devnodes(), check the FUSE version to
decide whether enable (>=7.27) or disable (<7.27) FUSE in the container.  We
look at the FUSE version instead of the kernel version in order to enable FUSE
support on older-versioned kernels that may have the mentioned patchset
backported ([as requested by @poettering][1]).  However, I am not sure that
this is safe; user-namespace support is not a documented part of the FUSE
protocol, which is what FUSE_KERNEL_VERSION/FUSE_KERNEL_MINOR_VERSION are meant
to capture.  While the same patchset
 - added FUSE_ABORT_ERROR (which is all that the 7.27 version bump
   is documented as including),
 - bumped FUSE_KERNEL_MINOR_VERSION from 26 to 27, and
 - added user-namespace support
these 3 things are not inseparable; it is conceivable to me that a backport
could include the first 2 of those things and exclude the 3rd; perhaps it would
be safer to check the kernel version.

Do note that our get_fuse_version() function uses the fsopen() family of
syscalls, which were not added until Linux kernel v5.2 (2019-07-07); so if
nothing has been backported, then the minimum kernel version for FUSE-in-nspawn
is actually v5.2, not v4.18.

Pass whether or not to enable FUSE to copy_devnodes(); have copy_devnodes()
copy in /dev/fuse if enabled.

Pass whether or not to enable FUSE back over fd_outer_socket to run_container()
so that it can pass that to append_machine_properties() (via either
register_machine() or allocate_scope()); have append_machine_properties()
append "DeviceAllow=/dev/fuse rw" if enabled.

For testing, simply check that /dev/fuse can be opened for reading and writing,
but that actually reading from it fails with EPERM.  The test assumes that if
FUSE is supported (/dev/fuse exists), then the testsuite is running on a kernel
with FUSE >= 7.27; I am unsure how to go about writing a test that validates
that the version check disables FUSE on old kernels.

[1]: https://github.com/systemd/systemd/issues/17607#issuecomment-745418835

Closes #17607

14 months agoNEWS: fix typo
Yu Watanabe [Sat, 7 Sep 2024 13:26:21 +0000 (22:26 +0900)] 
NEWS: fix typo

Follow-up for 7a3a49386cc49d3971531ea24efb84232c05cc86.

14 months agoman/varlinkctl: fix typo
Yu Watanabe [Sat, 7 Sep 2024 13:23:38 +0000 (22:23 +0900)] 
man/varlinkctl: fix typo

Follow-up for 39ce86d19c7c3ac46b4afb546879ca8dcad1bdb2.

14 months agonetwork/route: fix typo
Yu Watanabe [Sat, 7 Sep 2024 13:22:41 +0000 (22:22 +0900)] 
network/route: fix typo

Follow-up for 195bb6f97ebc5cd5e9932c62aa80df5427c30d67.

14 months agocore/manager: do not re-init Manager.lookup_paths when manager_reload() 33833/head
Mike Yuan [Wed, 24 Jul 2024 19:24:13 +0000 (21:24 +0200)] 
core/manager: do not re-init Manager.lookup_paths when manager_reload()

Follow-up for 99aad9a2b9e2c06023a2043976fd9395332ff097

The commit changed lookup_paths_init_or_warn() call to
be fatal to manager_reload(), but invoke_main_loop()
assumes that manager_reload() would only return
recoverable error, and put the manager back to
MANAGER_OK in that case, which is spurious.

Looking at it more, it appears to be utterly unnecessary
to reinitialize LookupPaths here, given that nothing during
the reload process would change the search dirs. Let's drop
the path altogether hence.

14 months agocore/manager: rename NOTIFY_RCVBUF_SIZE to MANAGER_SOCKET_RCVBUF_SIZE
Mike Yuan [Thu, 5 Sep 2024 18:23:17 +0000 (20:23 +0200)] 
core/manager: rename NOTIFY_RCVBUF_SIZE to MANAGER_SOCKET_RCVBUF_SIZE

This is used for all our sockets, hence rename as so.

14 months agovarlinkctl: downgrade ignored error msg to LOG_WARNING
Mike Yuan [Sat, 7 Sep 2024 00:28:41 +0000 (02:28 +0200)] 
varlinkctl: downgrade ignored error msg to LOG_WARNING

Follow-up for 39ce86d19c7c3ac46b4afb546879ca8dcad1bdb2

14 months agochattr-util: use BIT_FOREACH where appropriate
Mike Yuan [Sat, 7 Sep 2024 00:44:24 +0000 (02:44 +0200)] 
chattr-util: use BIT_FOREACH where appropriate

14 months agochattr-util: set O_NOCTTY when reopening O_PATH fd
Mike Yuan [Sat, 7 Sep 2024 00:32:01 +0000 (02:32 +0200)] 
chattr-util: set O_NOCTTY when reopening O_PATH fd

Follow-up for 07862c9fc2becdc4bbe112b023591d2ab2dd032b

14 months agomkosi: Drop _fixperms workaround
Daan De Meyer [Sat, 7 Sep 2024 10:13:58 +0000 (12:13 +0200)] 
mkosi: Drop _fixperms workaround

This was added to deal with a bug in the rpm 4.20 rc in Rawhide
but since that's been fixed, let's drop the workaround.

14 months agodocs: use actual docs/HACKING.md URL
Michal Sekletar [Sat, 7 Sep 2024 10:05:09 +0000 (12:05 +0200)] 
docs: use actual docs/HACKING.md URL

14 months agonspawn: register_machine() and allocate_scope() bools to flags
Luke T. Shumaker [Thu, 29 Aug 2024 17:00:18 +0000 (11:00 -0600)] 
nspawn: register_machine() and allocate_scope() bools to flags

14 months agonspawn: re-flow comments that are wrapped weird
Luke T. Shumaker [Fri, 6 Sep 2024 07:15:35 +0000 (01:15 -0600)] 
nspawn: re-flow comments that are wrapped weird

14 months agotest: add a testcase for unprivileged nspawn
Luke T. Shumaker [Wed, 21 Aug 2024 23:29:10 +0000 (17:29 -0600)] 
test: add a testcase for unprivileged nspawn

Right now it mostly duplicates a test that already exists in
TEST-50-DISSECT.mountfsd.sh, but it serves as a template for more unprivileged
nspawn tests.

14 months agonspawn: convert copy_devnodes():devnodes from nulstr to strv
Luke T. Shumaker [Wed, 21 Aug 2024 23:17:02 +0000 (17:17 -0600)] 
nspawn: convert copy_devnodes():devnodes from nulstr to strv

14 months agonspawn: fix the comment about which namespaces outer_child is in
Luke T. Shumaker [Thu, 22 Aug 2024 04:50:16 +0000 (22:50 -0600)] 
nspawn: fix the comment about which namespaces outer_child is in

The comment says that it is still in the host's CLONE_NEWUSER namespace,
which is not true if !arg_privileged.  Also, it says that the CLONE_NEWNS
namespace was created by clone(), but if !arg_privileged then it was
actually created by nsresource_allocate_userns() and switched into by
setns().  Fix those inaccuracies.

When trying to word it clearly, there are enough commas and nested clauses
that I think it's clearer to break it into a list/table.

14 months agoMerge pull request #34295 from poettering/uki-with-many-ukify
Yu Watanabe [Fri, 6 Sep 2024 23:08:48 +0000 (08:08 +0900)] 
Merge pull request #34295 from poettering/uki-with-many-ukify

ukify: add multi-profile UKI support

14 months agovarlinkctl: add --timeout= switch to tweak time-out behaviour
Lennart Poettering [Fri, 6 Sep 2024 19:44:51 +0000 (21:44 +0200)] 
varlinkctl: add --timeout= switch to tweak time-out behaviour

Fixes: #33772
14 months agodm-util: get rid of flex array in middle of structure
Lennart Poettering [Fri, 6 Sep 2024 20:03:01 +0000 (22:03 +0200)] 
dm-util: get rid of flex array in middle of structure

Fixes: #33936
14 months agoman: CAP_SYS_ADMIN does NOT grant any permission for dbus API
Takeo Kondo [Fri, 6 Sep 2024 15:21:46 +0000 (00:21 +0900)] 
man: CAP_SYS_ADMIN does NOT grant any permission for dbus API

14 months agoMerge pull request #34298 from poettering/pcrlock-cred-fix
Lennart Poettering [Fri, 6 Sep 2024 19:16:37 +0000 (21:16 +0200)] 
Merge pull request #34298 from poettering/pcrlock-cred-fix

pcrlock: be more careful when preparing credential name for pcrlock p…

14 months agopcrlock: be more careful when preparing credential name for pcrlock policy 34298/head
Lennart Poettering [Fri, 6 Sep 2024 16:32:17 +0000 (18:32 +0200)] 
pcrlock: be more careful when preparing credential name for pcrlock policy

The .cred suffix is stripped from a credential as it is imported from
the ESP, hence it should not be included in the credential name embedded
in the credential.

Fixes: #33497
14 months agoMerge pull request #34177 from poettering/pcrlock-and-signed
Lennart Poettering [Fri, 6 Sep 2024 16:11:22 +0000 (18:11 +0200)] 
Merge pull request #34177 from poettering/pcrlock-and-signed

cryptenroll/cryptsetup: support combined signed PCR + pcrlock policies

14 months agoukify: introduce new --measure-base= switch 34295/head
Lennart Poettering [Tue, 2 Jul 2024 10:36:21 +0000 (12:36 +0200)] 
ukify: introduce new --measure-base= switch

14 months agoukify: add new --extend= switch for importing an existing UKI's sections to later...
Lennart Poettering [Tue, 2 Jul 2024 08:23:07 +0000 (10:23 +0200)] 
ukify: add new --extend= switch for importing an existing UKI's sections to later extend

This options is pretty simple, it allows specifying an UKI whose
sections to import first, and place at the beginning of the new UKI.

This is useful for generating multi-profile UKIs piecemeal: generate the
base UKI first, then append a profile, and another one and another one.

The sections imported this way are not included in any PCR signature,
the assumption is that that already happened before in the imported UKI.

14 months agoukify: add basic .profile support
Lennart Poettering [Tue, 2 Jul 2024 07:38:53 +0000 (09:38 +0200)] 
ukify: add basic .profile support

This just allows including .profile sections, but doesn't try to be
smart about it. This alone won't help you much to create valid
multi-profile UKIs.

14 months agojournald: mention the access mode we tried to open /dev/kmsg in
Lennart Poettering [Fri, 6 Sep 2024 12:19:59 +0000 (14:19 +0200)] 
journald: mention the access mode we tried to open /dev/kmsg in

Let's make clearer what we are going to use /dev/kmsg for: read/write or just
writing. This hopefully should avoid confusion, such as the one #33975
is result of.

(Also while we are at it, add one extra debug message).

Fixes: #33975
14 months agoNEWS: extend the userdb sshd_config NEWS entry a bit
Lennart Poettering [Fri, 6 Sep 2024 12:39:15 +0000 (14:39 +0200)] 
NEWS: extend the userdb sshd_config NEWS entry a bit

14 months agotpm2-util: introduce tpm2b_sensitive_data_erase_and_esys_freep() destructor 34177/head
Lennart Poettering [Thu, 5 Sep 2024 16:29:26 +0000 (18:29 +0200)] 
tpm2-util: introduce tpm2b_sensitive_data_erase_and_esys_freep() destructor

Let's make sure we erase TPM2B_SENSITIVE_DATA structures reliably in all
code paths.

14 months agocryptenroll/cryptsetup: allow combined signed TPM2 PCR policy + pcrlock policy
Lennart Poettering [Thu, 29 Aug 2024 14:16:10 +0000 (16:16 +0200)] 
cryptenroll/cryptsetup: allow combined signed TPM2 PCR policy + pcrlock policy

So far you had to pick:

1. Use a signed PCR TPM2 policy to lock your disk to (i.e. UKI vendor
   blesses your setup via signature)
or
2. Use a pcrlock policy (i.e. local system blesses your setup via
   dynamic local policy stored in NV index)

It was not possible combine these two, because TPM2 access policies do
not allow the combination of PolicyAuthorize (used to implement #1
above) and PolicyAuthorizeNV (used to implement #2) in a single policy,
unless one is "further upstream" (and can simply remove the other from
the policy freely).

This is quite limiting of course, since we actually do want to enforce
on each TPM object that both the OS vendor policy and the local policy
must be fulfilled, without the chance for the vendor or the local system
to disable the other.

This patch addresses this: instead of trying to find a way to come up
with some adventurous scheme to combine both policy into one TPM2
policy, we simply shard the symmetric LUKS decryption key: one half we
protect via the signed PCR policy, and the other we protect via the
pcrlock policy. Only if both halves can be acquired the disk can be
decrypted.

This means:

1. we simply double the unlock key in length in case both policies shall
   be used.
2. We store two resulting TPM policy hashes in the LUKS token JSON, one
   for each policy
3. We store two sealed TPM policy key blobs in the LUKS token JSON, for
   both halves of the LUKS unlock key.

This patch keeps the "sharding" logic relatively generic (i.e. the low
level logic is actually fine with more than 2 shards), because I figure
sooner or later we might have to encode more shards, for example if we
add further TPM2-based access policies, for example when combining FIDO2
with TPM2, or implementing TOTP for this.

14 months agoiovec-util: add iovec_append() for appending to an existing iovec
Lennart Poettering [Thu, 29 Aug 2024 09:46:07 +0000 (11:46 +0200)] 
iovec-util: add iovec_append() for appending to an existing iovec

14 months agoMerge pull request #34291 from poettering/utmpx-all-the-way
Lennart Poettering [Fri, 6 Sep 2024 13:22:52 +0000 (15:22 +0200)] 
Merge pull request #34291 from poettering/utmpx-all-the-way

tree-wide: complete the switch to utmpx

14 months agoman: document that sd_bus_message_read_strv() happily spits out empty arrays as NULL
Lennart Poettering [Fri, 6 Sep 2024 09:30:23 +0000 (11:30 +0200)] 
man: document that sd_bus_message_read_strv() happily spits out empty arrays as NULL

Fixes: #34163
14 months agotree-wide: use UTMPX_FILE rather than _PATH_UTMPX 34291/head
Lennart Poettering [Fri, 6 Sep 2024 11:51:51 +0000 (13:51 +0200)] 
tree-wide: use UTMPX_FILE rather than _PATH_UTMPX

Apparently _PATH_UTMPX is a glibc'ism. UTMPX_FILE is the same thing and
what everyone else uses. Since they are otherwise equivalent, let's just
switch.

14 months agotest-utmp: replace UT_LINESIZE/UT_NAMESIZE/UT_HOSTSIZE with sizeof_field()
Lennart Poettering [Fri, 6 Sep 2024 11:22:32 +0000 (13:22 +0200)] 
test-utmp: replace UT_LINESIZE/UT_NAMESIZE/UT_HOSTSIZE with sizeof_field()

utmpx doesn't know these defines, hence fix them.

14 months agotree-wide: drop unnecessary utmp includes
Lennart Poettering [Fri, 6 Sep 2024 11:22:06 +0000 (13:22 +0200)] 
tree-wide: drop unnecessary utmp includes

14 months agouser-util: switch from utmp to utmpx
Lennart Poettering [Fri, 6 Sep 2024 11:20:11 +0000 (13:20 +0200)] 
user-util: switch from utmp to utmpx

We generally use utmpx instead of utmp (both are actually identical on
Linux, but utmpx is POSIX, while utmp is not). Let's fix one left-over
case.

UT_NAMESIZE does not exist in utmpx world, it has no direct counterpart,
hence let's just sizeof_field() to determine the size of the actual
field. (which comes to the same result of course: 32).

14 months agocoredump: set ProtectHome to read-only
Etienne Cordonnier [Fri, 6 Sep 2024 08:36:28 +0000 (10:36 +0200)] 
coredump: set ProtectHome to read-only

In https://github.com/systemd/systemd/pull/5283/commits/924453c22599cc246746a0233b2f52a27ade0819
ProtectHome was set to true for systemd-coredump in order to reduce risk, since an attacker could craft a malicious binary in order to compromise systemd-coredump.
At that point the object analysis was done in the main systemd-coredump process.
Because of this systemd-coredump is unable to product symbolicated call-stacks for binaries running under /home ("n/a" is shown instead of function names).

However, later in https://github.com/systemd/systemd/commit/61aea456c12c54f49c4a76259af130e576130ce9 systemd-coredump was changed to do the object analysis in a forked process,
covering those security concerns.

Let's set ProtectHome to read-only so that systemd-coredump produces symbolicated call-stacks for processes running under /home.

14 months agoMerge pull request #34279 from yuwata/ask-password
Lennart Poettering [Fri, 6 Sep 2024 11:30:15 +0000 (13:30 +0200)] 
Merge pull request #34279 from yuwata/ask-password

ask-password: refuse empty password strv

14 months agoMerge pull request #34285 from poettering/boot-measure-profile
Lennart Poettering [Fri, 6 Sep 2024 11:06:58 +0000 (13:06 +0200)] 
Merge pull request #34285 from poettering/boot-measure-profile

measure: introduce support for a new ".profile" section

14 months agopo: Translated using Weblate (French)
Léane GRASSER [Fri, 6 Sep 2024 09:38:46 +0000 (11:38 +0200)] 
po: Translated using Weblate (French)

Currently translated at 100.0% (253 of 253 strings)

Co-authored-by: Léane GRASSER <leane.grasser@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fr/
Translation: systemd/main

14 months agomeasure: introduce support for a new ".profile" section 34285/head
Lennart Poettering [Fri, 28 Jun 2024 17:48:32 +0000 (19:48 +0200)] 
measure: introduce support for a new ".profile" section

This introduces the concept, and makes sure systemd-measure covers it.
See a later commit for details on the new section.

14 months agouki: add new ".profile" PE section type
Lennart Poettering [Fri, 6 Sep 2024 09:12:35 +0000 (11:12 +0200)] 
uki: add new ".profile" PE section type

This is the most basic preparatory work for supporting multi-profile
UKIs.

(This temporarily drops an assert_cc() check which we'll address in the
next commit)

14 months agonetwork/route: ignore EEXIST reply when the corresponding request is already detached
Yu Watanabe [Thu, 5 Sep 2024 23:58:18 +0000 (08:58 +0900)] 
network/route: ignore EEXIST reply when the corresponding request is already detached

Follow-ups for db8dc7c1dd7f4620e14fbc4c1560a68a1fc9b85b.
Fixes #34275.

14 months agoMerge pull request #34278 from yuwata/timesync-log
Daan De Meyer [Fri, 6 Sep 2024 06:09:56 +0000 (08:09 +0200)] 
Merge pull request #34278 from yuwata/timesync-log

timesync: downgrade log level for several messages

14 months agoMerge pull request #34280 from yuwata/cleanups
Daan De Meyer [Fri, 6 Sep 2024 06:08:56 +0000 (08:08 +0200)] 
Merge pull request #34280 from yuwata/cleanups

tree-wide: trivial cleanups

14 months agotree-wide: check if non-empty password is acquired 34279/head
Yu Watanabe [Fri, 6 Sep 2024 06:00:32 +0000 (15:00 +0900)] 
tree-wide: check if non-empty password is acquired

14 months agoask-password: refuse empty password strv
Yu Watanabe [Fri, 6 Sep 2024 02:19:39 +0000 (11:19 +0900)] 
ask-password: refuse empty password strv

Fixes #34270.

14 months agosd-netlink: fix typo
Yu Watanabe [Fri, 6 Sep 2024 00:16:58 +0000 (09:16 +0900)] 
sd-netlink: fix typo

Fixes #34273.

14 months agonspawn: refuse to bind mount device node from host when --private-users= is specified
Yu Watanabe [Thu, 5 Sep 2024 06:05:32 +0000 (15:05 +0900)] 
nspawn: refuse to bind mount device node from host when --private-users= is specified

Also do not chown if a device node is bind-mounted.

Fixes #34243.

14 months agotest: add test cases for --volatile= with -U 34258/head
Yu Watanabe [Thu, 5 Sep 2024 05:12:20 +0000 (14:12 +0900)] 
test: add test cases for --volatile= with -U

For issue #34254.

14 months agonspawn: only remount /usr/ with idmap when --volatile=yes
Yu Watanabe [Fri, 6 Sep 2024 04:18:59 +0000 (13:18 +0900)] 
nspawn: only remount /usr/ with idmap when --volatile=yes

The root directory is already mounted with a picked UID shift, hence
it is not necessary to remount with idmap. However, /usr/ is a bind-mount,
hence it must be remounted with idmap.

With this change, now '-U --volatile=yes' works fine.

Fixes #34254.

14 months agonspawn: mount /var/ after remount_idmap() when --volatile=state
Yu Watanabe [Fri, 6 Sep 2024 04:14:14 +0000 (13:14 +0900)] 
nspawn: mount /var/ after remount_idmap() when --volatile=state

Previously, remount_idmap() failed as /var/ was already mounted, thus
remounting (strictly speaking, unmounting old root directory) failed
with -EBUSY.

As tmpfs /var/ is mounted with picked UID shift, it should not be
remounted with idmap, but needs to be mounted after the root directory
being remounted.

This makes '-U --volatile=state' work as expected.

14 months agonspawn: use strv_extend() and friends to build directories passed to remount_idmap()
Yu Watanabe [Thu, 5 Sep 2024 04:56:33 +0000 (13:56 +0900)] 
nspawn: use strv_extend() and friends to build directories passed to remount_idmap()

No functional change, just refactoring and preparation for later change.

14 months agotest: fix copy-and-paste error in comment 34280/head
Yu Watanabe [Fri, 6 Sep 2024 03:39:58 +0000 (12:39 +0900)] 
test: fix copy-and-paste error in comment

14 months agonspawn: fix indentation
Yu Watanabe [Fri, 6 Sep 2024 04:10:04 +0000 (13:10 +0900)] 
nspawn: fix indentation

14 months agobase-filesystem: use FOREACH_ELEMENT()
Yu Watanabe [Thu, 5 Sep 2024 10:37:52 +0000 (19:37 +0900)] 
base-filesystem: use FOREACH_ELEMENT()

14 months agomount-util: wrap long line
Yu Watanabe [Thu, 5 Sep 2024 04:54:31 +0000 (13:54 +0900)] 
mount-util: wrap long line

14 months agoMerge pull request #34203 from yuwata/network-conf-parser
Yu Watanabe [Fri, 6 Sep 2024 04:07:39 +0000 (13:07 +0900)] 
Merge pull request #34203 from yuwata/network-conf-parser

network: several cleanups for conf parser

14 months agoMerge pull request #34267 from DaanDeMeyer/script
Yu Watanabe [Fri, 6 Sep 2024 01:43:04 +0000 (10:43 +0900)] 
Merge pull request #34267 from DaanDeMeyer/script

mkosi: Install util-linux-script on Rawhide

14 months agonetwork/address: use log_section_warning() 34203/head
Yu Watanabe [Sun, 1 Sep 2024 12:08:57 +0000 (21:08 +0900)] 
network/address: use log_section_warning()

14 months agonetwork/address: use generic section parser more
Yu Watanabe [Fri, 6 Sep 2024 01:38:15 +0000 (10:38 +0900)] 
network/address: use generic section parser more

This also
- rename variable n -> address,
- use log_syntax_parse_error() where applicable,
- add one more assertion for lvalue in config_parse_address().

14 months agonetwork/address: introduce generic config parser for [Address] section
Yu Watanabe [Wed, 28 Aug 2024 05:01:36 +0000 (14:01 +0900)] 
network/address: introduce generic config parser for [Address] section

Then, use generic conf parsers defined in conf-parser.[ch].

14 months agofirewall-util: several cleanups for config_parse_nft_set()
Yu Watanabe [Sun, 1 Sep 2024 12:37:33 +0000 (21:37 +0900)] 
firewall-util: several cleanups for config_parse_nft_set()

- use log_syntax_parse_error(),
- return 1 on success,
- drop unnecessary or redundant assertions,
- add missing log_oom().

14 months agoconf-parser: introduce config_parse_uint32_invert_flag()
Yu Watanabe [Wed, 28 Aug 2024 04:11:43 +0000 (13:11 +0900)] 
conf-parser: introduce config_parse_uint32_invert_flag()

It is similar to config_parse_uint32_flag(), but drops the specified flag
when true.

14 months agonetwork: align table in network-gperf
Yu Watanabe [Sat, 31 Aug 2024 05:45:22 +0000 (14:45 +0900)] 
network: align table in network-gperf

14 months agonetwork/address-label: use log_section_warning_errno()
Yu Watanabe [Sun, 1 Sep 2024 12:01:40 +0000 (21:01 +0900)] 
network/address-label: use log_section_warning_errno()

14 months agonetwork/address-label: introduce generic conf parser for [IPv6AddressLabel] section
Yu Watanabe [Wed, 28 Aug 2024 04:57:05 +0000 (13:57 +0900)] 
network/address-label: introduce generic conf parser for [IPv6AddressLabel] section

This also
- renames n -> label,
- use log_syntax_parse_error().

No functional change, just refactoring.

14 months agoconf-parser: introduce config section parser wrapper
Yu Watanabe [Wed, 28 Aug 2024 02:57:34 +0000 (11:57 +0900)] 
conf-parser: introduce config section parser wrapper

It will be used later.

14 months agohwdb: Mark Apple Wireless keyboards as not having NumLock LED
Bastien Nocera [Thu, 5 Sep 2024 13:09:58 +0000 (15:09 +0200)] 
hwdb: Mark Apple Wireless keyboards as not having NumLock LED

Mark those Apple Wireless keyboards as not having a NumLock key:
https://en.wikipedia.org/wiki/Apple_Wireless_Keyboard

You can see that they don't have a NumLock LED because they didn't even
have a NumLock in the first place:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0fea6fe7d5ef1b5fa5f78048d4729f85181c04ca

14 months agotimesync: make manager_is_connected() static 34278/head
Yu Watanabe [Fri, 6 Sep 2024 01:20:21 +0000 (10:20 +0900)] 
timesync: make manager_is_connected() static

14 months agotimesync: downgrade log level about network configuration change
Yu Watanabe [Thu, 5 Sep 2024 11:08:24 +0000 (20:08 +0900)] 
timesync: downgrade log level about network configuration change

These message may be unnecessarily shown multiple times when e.g.
networkd is restarted, system is wakeup from suspend, and so on.

Closes #34262.

14 months agoMerge pull request #34155 from poettering/gmtime-safe
Yu Watanabe [Fri, 6 Sep 2024 00:07:48 +0000 (09:07 +0900)] 
Merge pull request #34155 from poettering/gmtime-safe

handle gmtime_r() errors more robustly

14 months agobasic: Include <sys/file.h> for LOCK_* constants
A. Wilcox [Wed, 21 Aug 2024 12:21:46 +0000 (07:21 -0500)] 
basic: Include <sys/file.h> for LOCK_* constants

This is needed to ensure LOCK_{EX,SH} are defined in certain
environments, including uclibc-ng and musl libc.

14 months agoMerge pull request #34261 from yuwata/repart-seed-random
Yu Watanabe [Thu, 5 Sep 2024 23:30:12 +0000 (08:30 +0900)] 
Merge pull request #34261 from yuwata/repart-seed-random

repart: initialize seed earlier

14 months agoedit-util: EditFileContext: avoid reserved 'stdin'
A. Wilcox [Wed, 21 Aug 2024 13:51:08 +0000 (08:51 -0500)] 
edit-util: EditFileContext: avoid reserved 'stdin'

The identifier 'stdin' is reserved in C.  It can be #defined to any
statement that evaluates to a FILE*.  We do not want that for our field,
so change to a more descriptive name.

14 months agoudev: allow persistent storage rules for rbd devices
Peter Rajnoha [Thu, 5 Sep 2024 10:31:20 +0000 (12:31 +0200)] 
udev: allow persistent storage rules for rbd devices

The RADOS Block Device (rbd) can be used as any other block device with
further layers on top of it, hence allow the common persistent storage
rules to apply, including watching for changes.

14 months agomkosi: Remove rpm workaround 34267/head
Daan De Meyer [Thu, 5 Sep 2024 16:45:52 +0000 (18:45 +0200)] 
mkosi: Remove rpm workaround

rpm 4.19.93 (4.20 rc) is in rawhide so let's drop the workaround.

14 months agomkosi: Install util-linux-script on Rawhide
Daan De Meyer [Thu, 5 Sep 2024 16:38:33 +0000 (18:38 +0200)] 
mkosi: Install util-linux-script on Rawhide

It's now subpackaged so we can build images without pulling in
libutempter but we use script in the testsuite so let's install the
subpackage.

14 months agoMerge pull request #34266 from DaanDeMeyer/fix
Daan De Meyer [Thu, 5 Sep 2024 16:36:44 +0000 (18:36 +0200)] 
Merge pull request #34266 from DaanDeMeyer/fix

mkfs-util: Make sure we pass non option arguments last

14 months agotime-util: rework localtime_or_gmtime() into localtime_or_gmtime_usec() 34155/head
Lennart Poettering [Wed, 28 Aug 2024 12:10:01 +0000 (14:10 +0200)] 
time-util: rework localtime_or_gmtime() into localtime_or_gmtime_usec()

We typically want to deal in usec_t, hence let's change the prototype
accordingly, and do proper range checks. Also, make sure are not
confused by negative times.

Do something similar for mktime_or_timegm().

This is a more comprehensive alternative to #34065

Replaces: #34065