Commit graph

71128 commits

Author SHA1 Message Date
Adrian Vovk 25c89b8977 homectl: Add flags to edit blob directories
This makes it possible to edit blob directories using homectl. The
following syntax is available:

* `--blob-directory=/path/somewhere`: Replaces the entire blob directory
with the contents of /path/somewhere

* `--blob-directory=foobar=/path/somewhere`: Replaces just the file
foobar in the blob directory with the contents of /path/somewhere

* `--blob-directory=foobar=`: Deletes the file foobar from the blob
directory

* `--blob-directory=`: Resets all previous flags

* `--avatar=`, etc: Shortcuts for `--blob-directory=FILENAME=` for the
known files in the blob directory
2024-02-19 11:18:11 +00:00
Adrian Vovk a4d72746c7 homework: Handle Update & Create w/ blob dir
Introduces new extended variants of the various incarnations of
Create and Update, which take a map of filenames to FDs. This map is
then used to populate the bulk directory.

FDs are used to prevent the client from abusing homed's blob directory
permissions (everything is made world-readable by homed) to open files
that they normally aren't allowed to open. Passing along an FD ensures
that the client has read access to the file it wants homed to make
world-readable.

Internally, homework uses the map to overwrite the system blob dir.
Later, homework's existing blob dir reconciliation logic will propagate
the new contents from the system blob dir into the embedded blob
dir
2024-02-19 11:18:11 +00:00
Adrian Vovk 17ac40e4cd homework: Reconcile blob directories
Whenever the host & embedded records are reconciled, the host & embedded
blob directories are now reconciled too in the same direction.
Reconciling the blob directories serves exactly the same purpose as
reconciling the user records, and thus should behave in the same way.
2024-02-19 11:18:11 +00:00
Adrian Vovk c3d50255fc homed: Create & advertise blob directory
This ensures that a user-specific blob directory exists in
/var/cache/systemd/homed for as long as the user exists, and gets
deleted if the user gets deleted.

It also advertises this blob directory via the user record, so that
clients can find and use it.
2024-02-19 11:18:11 +00:00
Adrian Vovk 1b466c0940 user-record: Add blobDirectory and blobManifest
These fields are used to connect a JSON user record to its blob
directory, and to include the directory's contents in the record's
signature
2024-02-19 11:18:11 +00:00
Adrian Vovk 4006b98da6 Document blob directory behavior
We're documenting the behavior of blob directories here. These docs
refer to things that aren't yet implemented at the time of the commit, but will be later in the same PR.
2024-02-19 11:18:11 +00:00
Adrian Vovk 85f660d46b fd-util: Expose helper to pack fds into 3,4,5,...
This is useful for situations where an array of FDs is to be passed into
a child process (i.e. by passing it through safe_fork). This function
can be called in the child (before calling exec) to pack the FDs to all
be next to each-other starting from SD_LISTEN_FDS_START (i.e. 3)
2024-02-19 11:18:11 +00:00
Luca Boccassi 034569150f
Merge pull request #31364 from bluca/vpick_ext
core: add support for vpick for ExtensionImages=/ExtensionDirectories=
2024-02-19 11:15:54 +00:00
Yu Watanabe ac63c8df30 sd-radv: fix potential buffer overflow
Fixes a bug in 1925f829ab and
6a6d27bc5b (v255).
2024-02-19 10:16:36 +00:00
Yu Watanabe b5b2510800 pam-util: include cache ID of bus connection in the log message
To make it easier to debug issues like #31375.
2024-02-19 10:15:33 +00:00
Yu Watanabe d42b81f93f core/exec: do not crash with UtmpMode=user without User= setting
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2264404.

Replaces #31356.
2024-02-19 10:51:00 +01:00
Franck Bui 190ff0d0a8 vconsole-setup: don't fail if the only found vc is already used by plymouth
During the boot process, systemd-vconsole-setup can be started when the only
allocated VC is already taken by plymouth.

This case is expected when a boot splash is displayed hence
systemd-vconsole-setup.service should not fail if it happens.

However rather than doing nothing, the sysfs utf8 flag is set before exiting
early.
2024-02-19 09:25:14 +01:00
Frantisek Sumsal 78bbc7d5d4 test: make testcase_owneridmap() compatible with coverage runs
Follow-up for 614d09a.
2024-02-18 13:44:24 +00:00
Luca Boccassi 8d2a38ef6c man: fix typo in uid0.xml
Follow-up for 72eb3081b2
2024-02-18 13:01:21 +00:00
Yu Watanabe ff509772f1 TODO: fix typo
Follow-up for 10e3f15ac1.
2024-02-18 07:15:01 +09:00
Yu Watanabe 20fedbe32b
Merge pull request #31318 from mrc0mmand/test-switch-to-btrfs
test: use btrfs by default on Arch as well
2024-02-18 04:55:56 +09:00
Yu Watanabe 9736839d0c
Merge pull request #31362 from yuwata/network-fix-dhcp-pd-ready
network: do not request DHCP addresses configured on checking prefix delegation
2024-02-18 04:55:13 +09:00
Frantisek Sumsal 7e2bf4c5ee test: "modernize" TEST-55-OOMD's init 2024-02-17 12:49:44 +01:00
Frantisek Sumsal bce0fa7da1 test: don't abbreviate log messages when dumping the test journal
To make debugging test fails easier.
2024-02-17 12:49:44 +01:00
Frantisek Sumsal 1b0cf03668 test: use btrfs' mkswapfile on btrfs
So it's created automagically with proper attributes.
2024-02-17 12:49:44 +01:00
Frantisek Sumsal e073c1d8ed test: make TEST-08-INITRD slightly less annoying to debug
Forward journal to console, since we won't have any journal from initrd
and shutdown/exit initrd phases. Also, mention
systemd.journald.max_level_console=debug that is very handy for
debugging initrd shenanigans, but don't use it by default since it
sends a _lot_ of stuff to the serial console, which slows down the test
a lot.
2024-02-17 12:49:44 +01:00
Frantisek Sumsal adafa3b2f8 test: always try to install the ext4 module
So the tests work even if the base image filesystem is not ext4.
2024-02-17 12:49:44 +01:00
Frantisek Sumsal 7eb7e3ec4f test: use btrfs by default on Arch as well 2024-02-17 12:49:44 +01:00
Yu Watanabe 3b677c6f94 test-network: add one more test case for DHCP prefix delegation
For issue #31349.
2024-02-17 11:48:25 +00:00
Yu Watanabe ab06b74fd3 test-network: split test_dhcp6pd() into small pieces 2024-02-17 11:48:25 +00:00
Yu Watanabe b4054aff24 network: do not request DHCP addresses configured on checking prefix delegation
This does not change anything for DHCPv4, as a DHCPv4 address is always
requested anyway. However for DHCPv6, the client may not request IA_NA
addresses by UseAddress=no, or even if it is requested, the server may
not provide any IA_NA addresses. Even in such cases, here the check is
for delegated prefixes, hence it is not necessary to check if DHCPv6
IA_NA addresses are configured.

Fixes a bug introduced by 195b83edf8.

Fixes #31349.
2024-02-17 11:48:25 +00:00
Yu Watanabe 43a752669e network/dhcp6: deem DHCPv6 configuration to be finished even if no IA_NA is provided
Follow-up for fc4aa64c2d.

Otherwise, even if we request no address, Link.dhcp6_configured stuck on
false.
2024-02-17 11:48:25 +00:00
Luca Boccassi 622efc544d core: add support for vpick for ExtensionDirectories= 2024-02-17 11:20:00 +00:00
Luca Boccassi 5e79dd96a8 core: add support for vpick for ExtensionImages= 2024-02-17 11:20:00 +00:00
Luca Boccassi 7fa428cf44 man: create reusable snippet for 'vpick' entries 2024-02-17 11:20:00 +00:00
Luca Boccassi 70247b103a
Merge pull request #31367 from yuwata/cgroup-runtime-fix
core/cgroup: several follow-up about CGroupRuntime
2024-02-17 10:24:06 +00:00
Yu Watanabe 160d636ff4 resolve: name field may be NULL
Follow-up for e1634bb832.

Fixes #31361.
2024-02-17 10:22:53 +00:00
Yu Watanabe ad48cc6f81 core/unit: fix superficial NULL-pointer dereference
Though, when unit_prepare_exec() is called, the unit should always
have the cgroup runtime context 'crt'. So, I think we can insert assert().
But, for consistency with other places that call unit_get_cgroup_runtime(),
here use the simple non-NULL check for 'crt' instead of using assert().

Follow-up for 9cc545447e.

Fixes CID#1534667.
2024-02-17 16:50:46 +09:00
Yu Watanabe e7cf5c82da core/cgroup: drop duplicated free()s
Follow-up for 9cc545447e.

Fixes CID#1534665 and CID#1534666.
2024-02-17 16:46:19 +09:00
Luca Boccassi 67065a7fa1
Merge pull request #31127 from poettering/cgroup-runtime2
core: split out cgroup specific state fields from Unit → CGroupRuntime
2024-02-16 23:38:53 +00:00
Yu Watanabe e21dd22040
Merge pull request #31338 from ssahani/network-bond-missed
network: netdev - bond add support for ARP missed max
2024-02-17 06:16:42 +09:00
Vishal Chillara Srinivas e1634bb832 resolve: provide service resolve over varlink
ported the d-bus implementation of service resolve to varlink
extended TEST-75-RESOLVED to cover this use-case
2024-02-16 16:24:08 +01:00
Luca Boccassi 92d1419eb8
Merge pull request #31218 from CodethinkLabs/vmspawn/journal_forwarding
vmspawn: support journal forwarding
2024-02-16 12:09:52 +00:00
Tomáš Pecka 9f78da68ac varlink: fix varlink_collect_full not resetting state
The varlink_collect_full function did not set varlink client's state
when the reply was an error. The state was stuck in "collecting-reply".

I discovered that while hacking on network varlink interface (adding a
new varlink method). The debug logs shows the process of performing the
first query which replies with an error:

  varlink: Setting state idle-client
  network: Sending message: {"method":"io.systemd.Network.LLDPNeighbors","parameters":{"ifindex":1},"more":true}
  network: Changing state idle-client → collecting
  network: Received message: {"error":"org.varlink.service.MethodNotFound","parameters":{"method":"io.systemd.Network.LLDPNeighbors"}}
  network: Changing state collecting → collecting-reply

Now another varlink_collect call is being made, but

  network: Connection busy.
  Failed to execute varlink call: Device or resource busy

This was not caught by the tests because there were no varlink_collect
calls that resulted in error reply.
2024-02-16 12:08:31 +00:00
Luca Boccassi 5ea0da03d4
Merge pull request #31311 from yuwata/journal-user-corruption
journal: fix user journal corruption on rotation
2024-02-16 12:07:50 +00:00
Colin Geniet bd083fc2eb hwdb: Remove version check in CH Pro Pedals rule
CH Pedals are incorrectly reported as an accelerometer [1], because they
have no button.  This is fixed by a rule in 60-input-id.hwdb [2], but
the rule checks id/version="0100", while my pedals report id/version="0111".

So there are several versions of the pedals, presumably all affected
by the bug. Remove the version check in the rule to fix them all.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=81889
[2] commit: 230ed4c4ba (hwdb: CH Pro Pedals not classified correctly due to no buttons, 2022-01-19)
    PR: https://github.com/systemd/systemd/pull/22184
2024-02-16 12:07:17 +00:00
Sam Leonard ec3d2f2e9d vmspawn: fix possible NULL dereference in discover_boot_entry 2024-02-16 12:45:08 +01:00
Lennart Poettering f03e8f19b7
Merge pull request #30263 from msizanoen1/fix-onboot-rotate-2
journal: Reset runtime seqnum data when flushing to system journal
2024-02-16 12:02:09 +01:00
Frantisek Sumsal 7bd41e63f7 test: properly preserve journal from sd-bsod tests
I (incorrectly) assumed that --relinquish-var does everything --flush
does, including moving already existing stuff from /var/log/journal/ to
/run/log/journal/, but that's not the case. To actually do that we need
to shuffle things manually, so let's do just that.

This should make issues like #31334 easier to debug, since with this
patch we now have a coredump in the test journal as well:

~# make -C test/TEST-04-JOURNAL/ clean setup run TEST_MATCH_SUBTEST=bsod BUILD_DIR=$PWD/build TEST_NO_NSPAWN=1
...
[   12.176089] testsuite-04.sh[712]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-04.bsod.sh failed'
[   12.176089] testsuite-04.sh[712]: Subtest /usr/lib/systemd/tests/testdata/units/testsuite-04.bsod.sh failed
[   12.176089] testsuite-04.sh[712]: + return 1
[   12.177347] systemd[1]: testsuite-04.service: Failed with result 'exit-code'.
[   12.220580] systemd[1]: Failed to start testsuite-04.service.
Spawning getter /home/mrc0mmand/repos/@systemd/systemd/build/journalctl -o export -D /var/tmp/systemd-tests/systemd-test.Qtqmmr/root/var/log/journal...
Finishing after writing 7649 entries
TEST-04-JOURNAL: (failed; see logs)
-rw-r----- 1 root root 16777216 Feb 15 21:13 /var/tmp/systemd-tests/systemd-test.Qtqmmr/system.journal
...

~# coredumpctl --file /var/tmp/systemd-tests/systemd-test.Qtqmmr/system.journal
TIME                        PID UID GID SIG     COREFILE EXE                           SIZE
Thu 2024-02-15 21:13:38 CET 812   0   0 SIGABRT journal  /usr/lib/systemd/systemd-bsod    -
2024-02-16 10:37:37 +01:00
Susant Sahani d2d0a8d45d test-network: Add test for bond arp_missed_max option 2024-02-16 15:03:58 +05:30
Lennart Poettering 10e3f15ac1 update TODO 2024-02-16 10:17:57 +01:00
Lennart Poettering 9cc545447e core: split out cgroup specific state fields from Unit → CGroupRuntime
This refactors the Unit structure a bit: all cgroup-related state fields
are moved to a new structure CGroupRuntime, which is only allocated as
we realize a cgroup.

This is both a nice cleanup and should make unit structures considerably
smaller that have no cgroup associated, because never realized or
because they belong to a unit type that doesn#t have cgroups anyway.

This makes things nicely symmetric:

        ExecContext → static user configuration about execution
        ExecRuntime → dynamic user state of execution
        CGroupContext → static user configuration about cgroups
        CGroupRuntime → dynamic user state of cgroups

And each time the XyzContext is part of the unit type structures such as
Service or Slice that need it, but the runtime object is only allocated
when a unit is started.
2024-02-16 10:17:40 +01:00
Lennart Poettering 3f236f24ba cgroup: normalize parameter order in format_cgroup_memory_comparison()
We usually put the return parameter last. Do so here too.
2024-02-16 10:17:16 +01:00
Susant Sahani b33bba0434 network: netdev - bond add support for ARP missed max
Allows to configure bond arp_missed_max is the maximum number of arp_interval monitor cycle
for missed ARP replies. If this number is exceeded, link is reported as
down.
2024-02-16 14:44:51 +05:30
mooo 7ad0a7b2b6 po: Translated using Weblate (Lithuanian)
Currently translated at 69.6% (158 of 227 strings)

Co-authored-by: mooo <hazap@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/lt/
Translation: systemd/main
2024-02-16 09:29:40 +01:00