]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
14 months agotest: Gracefully handle running within user namespace with single user 34026/head
Daan De Meyer [Sun, 18 Aug 2024 11:20:14 +0000 (13:20 +0200)] 
test: Gracefully handle running within user namespace with single user

Unprivileged users often make themselves root by unsharing a user namespace
and then mapping their current user to root which does not require privileges.
Let's make sure our tests don't fail in such an environment by adding checks
where required to see if we're not running in a user namespace with only a
single user.

14 months agotest-netlink: Gracefully handle the loopback interface being down
Daan De Meyer [Sun, 18 Aug 2024 11:19:30 +0000 (13:19 +0200)] 
test-netlink: Gracefully handle the loopback interface being down

14 months agonetwork: refuse files under API VFS specified in PrivateKeyFile= and friends
Yu Watanabe [Fri, 16 Aug 2024 17:01:51 +0000 (02:01 +0900)] 
network: refuse files under API VFS specified in PrivateKeyFile= and friends

Addresses https://github.com/systemd/systemd/pull/34013#discussion_r1719890231.

14 months agonetwork/wireguard: introduce [WireGuardPeer] PublicKeyFile=
Yu Watanabe [Fri, 16 Aug 2024 13:13:23 +0000 (22:13 +0900)] 
network/wireguard: introduce [WireGuardPeer] PublicKeyFile=

Similar to PresharedKeyFile=, but for public key.

Closes #34012.

14 months agokernel-install: discard comments in cmdline files
rindeal [Fri, 16 Aug 2024 00:16:57 +0000 (02:16 +0200)] 
kernel-install: discard comments in cmdline files

It was quite a surprise to find my comments in a booted kernel cmdline.

14 months agoAdd $SYSTEMD_IN_CHROOT to override chroot detection
Daan De Meyer [Wed, 14 Aug 2024 10:43:05 +0000 (12:43 +0200)] 
Add $SYSTEMD_IN_CHROOT to override chroot detection

When running unprivileged, checking /proc/1/root doesn't work because
it requires privileges. Instead, let's add an environment variable so
the process that chroot's can tell (systemd) subprocesses whether
they're running in a chroot or not.

14 months agotest: fix typo
Yu Watanabe [Fri, 16 Aug 2024 00:44:08 +0000 (09:44 +0900)] 
test: fix typo

Follow-up for 538766ddf47cfd457d9c69f108c035d4d97eaba1.

14 months agoshell-completion: zsh: fix incorrect unescaping
bryango [Thu, 15 Aug 2024 05:18:17 +0000 (13:18 +0800)] 
shell-completion: zsh: fix incorrect unescaping

Previously the `_filter_units_by_property` completion function
outputs with a [zsh parameter expansion flag] `g:o:`. This means
that the returned result is unescaped as the zsh builtin `echo`,
except that octal escapes don’t take a leading zero. This seemed to
have worked back in the days when it was first introduced:

  6c9414a700a040be1d3160bd2336baac58a1da3e

But it now leads to incorrect over-unescaping; for example,

  system-systemd\\x2djournald.slice (correct)

is incorrectly completed by zsh in commands such as
`systemctl kill`:

  system-systemd-journald.slice (incorrect)

This commit fixes such problems by removing the `g:o:` flag.

See:
[zsh parameter expansion flag]: https://zsh.sourceforge.io/Doc/Release/Expansion.html#Parameter-Expansion-Flags

14 months agoudev-builtin-net_id: add NAMING_DEVICETREE_PORT_ALIASES to check of_node of netdevs...
Matthias Schiffer [Wed, 7 Aug 2024 10:01:24 +0000 (12:01 +0200)] 
udev-builtin-net_id: add NAMING_DEVICETREE_PORT_ALIASES to check of_node of netdevs before their parents

The net_id builtin only checked the of_node of a netdev's parent device,
not that of the netdev itself. While it is common that netdevs don't have
an OF node assigned themselves, as they are derived from some parent
device, this is not always the case. In particular when a single
controller provides multiple ports that can be referenced indiviually in
the Device Tree (both for aliases/MAC address assignment and phandle
references), the correct of_node will be that of the netdev itself, not
that of the parent, so it needs to be checked, too.

A new naming scheme flag NAMING_DEVICETREE_PORT_ALIASES is added to
allow selecting the new behavior.

14 months agoMerge pull request #34000 from yuwata/test-remove-temporary-directories
Yu Watanabe [Thu, 15 Aug 2024 09:54:16 +0000 (18:54 +0900)] 
Merge pull request #34000 from yuwata/test-remove-temporary-directories

test: remove temporary directories

14 months agotest: sync journal after all invocations finished
Yu Watanabe [Thu, 15 Aug 2024 07:33:51 +0000 (16:33 +0900)] 
test: sync journal after all invocations finished

Otherwise, several messages for the last invocation have not been
stored to journal yet.

Hopefully fixes the following race:
===
[  603.037765] H systemd-run[10503]: Running as unit: invocation-id-test-26448.service; invocation ID: 1a49edeb05a641aaa2def72411134822
[  603.099587] H bash[10504]: invocation 10 1a49edeb05a641aaa2def72411134822
[  603.212069] H systemd[1]: invocation-id-test-26448.service: Deactivated successfully.
[  603.225092] H systemd-run[10503]: Finished with result: success
[  603.225163] H TEST-04-JOURNAL.sh[10506]: + journalctl --list-invocation -u invocation-id-test-26448.service
[  603.225318] H systemd-run[10503]: Main processes terminated with: code=exited, status=0/SUCCESS
[  603.225357] H TEST-04-JOURNAL.sh[10507]: + tee /tmp/tmp.UzSmYamXyg/10
[  603.225357] H TEST-04-JOURNAL.sh[10507]: IDX INVOCATION ID                    FIRST ENTRY                 LAST ENTRY
[  603.225357] H TEST-04-JOURNAL.sh[10507]:  -9 d6efabb546014027b6bd7ee3a78386d6 Wed 2024-08-14 22:12:16 UTC Wed 2024-08-14 22:12:17 UTC
[  603.225357] H TEST-04-JOURNAL.sh[10507]:  -8 3e402b81c28d4a8fa2c5e8e31dffd9ee Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.225357] H TEST-04-JOURNAL.sh[10507]:  -7 5ebd0ba07d4f4f52bc84275f55a3ee2e Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.225357] H TEST-04-JOURNAL.sh[10507]:  -6 bc53c49d6ce24bb7acd438c3e61cfb23 Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.225357] H TEST-04-JOURNAL.sh[10507]:  -5 24680907919e4839a75378117bb5a816 Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.225357] H TEST-04-JOURNAL.sh[10507]:  -4 ec364ed7673c4a1fa22929f95ce7047b Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.225357] H TEST-04-JOURNAL.sh[10507]:  -3 2e8a4dea43044d1a9faf922f7a2f3d42 Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.225357] H TEST-04-JOURNAL.sh[10507]:  -2 ac610b6e6c9c4a29bf8947890685478b Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.225357] H TEST-04-JOURNAL.sh[10507]:  -1 9b7d52c3620948f9831e323910f605f5 Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.225357] H TEST-04-JOURNAL.sh[10507]:   0 1a49edeb05a641aaa2def72411134822 Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.225823] H systemd-run[10503]: Service runtime: 174ms
[  603.225866] H TEST-04-JOURNAL.sh[10508]: + journalctl --list-invocation -u invocation-id-test-26448.service --reverse
[  603.226110] H systemd-run[10503]: CPU time consumed: 12ms
[  603.226142] H TEST-04-JOURNAL.sh[10509]: + tee /tmp/tmp.UzSmYamXyg/10-r
[  603.226378] H systemd-run[10503]: Memory peak: 1.4M (swap: 0B)
[  603.230161] H TEST-04-JOURNAL.sh[10509]: IDX INVOCATION ID                    FIRST ENTRY                 LAST ENTRY
[  603.230161] H TEST-04-JOURNAL.sh[10509]:   0 1a49edeb05a641aaa2def72411134822 Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:18 UTC
[  603.230161] H TEST-04-JOURNAL.sh[10509]:  -1 9b7d52c3620948f9831e323910f605f5 Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.230161] H TEST-04-JOURNAL.sh[10509]:  -2 ac610b6e6c9c4a29bf8947890685478b Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.230161] H TEST-04-JOURNAL.sh[10509]:  -3 2e8a4dea43044d1a9faf922f7a2f3d42 Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.230161] H TEST-04-JOURNAL.sh[10509]:  -4 ec364ed7673c4a1fa22929f95ce7047b Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.230161] H TEST-04-JOURNAL.sh[10509]:  -5 24680907919e4839a75378117bb5a816 Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.230161] H TEST-04-JOURNAL.sh[10509]:  -6 bc53c49d6ce24bb7acd438c3e61cfb23 Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.230161] H TEST-04-JOURNAL.sh[10509]:  -7 5ebd0ba07d4f4f52bc84275f55a3ee2e Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.230161] H TEST-04-JOURNAL.sh[10509]:  -8 3e402b81c28d4a8fa2c5e8e31dffd9ee Wed 2024-08-14 22:12:17 UTC Wed 2024-08-14 22:12:17 UTC
[  603.230161] H TEST-04-JOURNAL.sh[10509]:  -9 d6efabb546014027b6bd7ee3a78386d6 Wed 2024-08-14 22:12:16 UTC Wed 2024-08-14 22:12:17 UTC
===

14 months agotest: add TEST_SKIP to mkosi integration test wrapper
Luca Boccassi [Wed, 14 Aug 2024 21:49:10 +0000 (22:49 +0100)] 
test: add TEST_SKIP to mkosi integration test wrapper

Takes a space-separate list of test names, allows to skip one or more tests

14 months agounits: drop "-p" flag from agetty's login options
Ronan Pigott [Wed, 14 Aug 2024 18:42:03 +0000 (11:42 -0700)] 
units: drop "-p" flag from agetty's login options

This flag was added in db6aedab9292 with the justification that locale
environment variables should be preserved by the user session. However,
the companion patch to drop the UnsetEnvironment= directive blocking
these variables was never merged, so the intended change was never
effected.

While the patch was ineffective toward its stated goal, the "-p" option
does have material negative consequences for the user session in
systemd — environment variables to support the use of
credentials and memory pressure directives, such as
$CREDENTIALS_DIRECTORY and $MEMORY_PRESSURE_WATCH, which are now
directly used by agetty and login, get leaked into the user session
potentially breaking applications that rely on these values.

E.g. systemd-ask-password fails from the tty when $CREDENTIALS_DIRECTORY
has been leaked from agetty, because it expects to be able to access
credentials in $CREDENTIALS_DIRECTORY.

This effectively reverts db6aedab9292.

References: db6aedab9292 (units: Tell login to preserve environment (#6023), 2017-05-24)

14 months agotest: remove temporary directory for test-ukify on success 34000/head
Yu Watanabe [Thu, 15 Aug 2024 07:14:37 +0000 (16:14 +0900)] 
test: remove temporary directory for test-ukify on success

14 months agotest: remove temporary directory on success
Yu Watanabe [Thu, 15 Aug 2024 06:58:29 +0000 (15:58 +0900)] 
test: remove temporary directory on success

Also use mkdtemp_open() with specific template.

Follow-up for e7e52ff9b6d6bbfcdcc298ef3c156420b51d58b8.

14 months agomkosi: Fix debian/not-installed build logic
Daan De Meyer [Wed, 14 Aug 2024 14:51:11 +0000 (16:51 +0200)] 
mkosi: Fix debian/not-installed build logic

- Expand globs
- Filter out directories
- Append to the list of packaged files, not the list of installed files

Fixes the issue in https://github.com/systemd/systemd/pull/32363

14 months agoudev: Handle PTP device symlink properly on udev action 'change'
Chengen Du [Mon, 12 Aug 2024 03:41:52 +0000 (11:41 +0800)] 
udev: Handle PTP device symlink properly on udev action 'change'

PTP device symlink creation rules are currently executed only when the
udev action is 'add'. If a user reloads the rules and runs the udevadm
trigger command to reapply changes, the symlink may be deleted, which
can prevent the chronyd service from restarting properly.

Signed-off-by: Chengen Du <chengen.du@canonical.com>
14 months agoMerge pull request #33955 from yuwata/sd-journal-fix-sd_journal_seek_monotonic_usec
Yu Watanabe [Thu, 15 Aug 2024 06:38:19 +0000 (15:38 +0900)] 
Merge pull request #33955 from yuwata/sd-journal-fix-sd_journal_seek_monotonic_usec

sd-journal: fix sd_journal_seek_monotonic_usec()

14 months agorepart: Fix misleading typo in GPT partition flag
Thorsten Scherer [Wed, 14 Aug 2024 20:32:44 +0000 (22:32 +0200)] 
repart: Fix misleading typo in GPT partition flag

Bit 60 is the one corresponding to ReadOnly, not 50.  Fix this.

14 months agoMerge pull request #32067 from ssahani/bareudp1
Yu Watanabe [Wed, 14 Aug 2024 20:35:32 +0000 (05:35 +0900)] 
Merge pull request #32067 from ssahani/bareudp1

network: netdev - BareUDP Add support for srcportmin

14 months agosd-journal: rename offset -> ret_offset 33955/head
Yu Watanabe [Thu, 8 Aug 2024 14:38:41 +0000 (23:38 +0900)] 
sd-journal: rename offset -> ret_offset

14 months agosd-journal: swap condition to reduce indentation
Yu Watanabe [Wed, 7 Aug 2024 02:20:39 +0000 (11:20 +0900)] 
sd-journal: swap condition to reduce indentation

No functional change, just refactoring.

14 months agosd-journal: drop unnecessary temporal variable 'k'
Yu Watanabe [Tue, 6 Aug 2024 02:09:10 +0000 (11:09 +0900)] 
sd-journal: drop unnecessary temporal variable 'k'

No functional change, just refactoring.

14 months agosd-journal: add trailing comma
Yu Watanabe [Thu, 8 Aug 2024 14:24:11 +0000 (23:24 +0900)] 
sd-journal: add trailing comma

14 months agotest: add test cases for sd_journal_seek_realtime_usec() and sd_journal_seek_monotoni...
Yu Watanabe [Mon, 5 Aug 2024 20:20:05 +0000 (05:20 +0900)] 
test: add test cases for sd_journal_seek_realtime_usec() and sd_journal_seek_monotonic_usec()

14 months agosd-journal: fix sd_journal_seek_monotonic_usec()
Yu Watanabe [Wed, 7 Aug 2024 03:01:45 +0000 (12:01 +0900)] 
sd-journal: fix sd_journal_seek_monotonic_usec()

This fixes the following issues:

- We have a journal file, which contains entries of boot A and B. Let T
  be the timestamp of the _last_ entry of boot A.
  If sd_journal_seek_monotonic_usec() is called for boot A with a timestamp
  _after_ T, following sd_journal_next() will provide the _first_ entry of
  boot A, rather than the first entry of boot B.

- We have two journal files X and Y. The file X contains entries of boot A.
  Let T be the timestamp of the _last_ entry of boot A in file X. The file Y
  contains entries of boot A after timestamp T.
  If sd_journal_seek_monotonic_usec() is called for boot A with a
  timestamp _after_ T, following sd_journal_next() will provide the
  _first_ entry of boot A, whose timestamp is of course earlier than T.

14 months agotest: modernize test-journal-interleaving
Yu Watanabe [Wed, 7 Aug 2024 02:01:49 +0000 (11:01 +0900)] 
test: modernize test-journal-interleaving

14 months agotest: replace ASSERT_TRUE() for dns_cache_lookup() with ASSERT_OK_POSITIVE()
Yu Watanabe [Wed, 7 Aug 2024 04:44:19 +0000 (13:44 +0900)] 
test: replace ASSERT_TRUE() for dns_cache_lookup() with ASSERT_OK_POSITIVE()

As it may return negative errno on error, and returns number of found
entries on success.

14 months agotest: add ASSERT_OK_POSITIVE() and ASSERT_OK_ZERO()
Yu Watanabe [Wed, 7 Aug 2024 08:48:42 +0000 (17:48 +0900)] 
test: add ASSERT_OK_POSITIVE() and ASSERT_OK_ZERO()

14 months agoMerge pull request #33991 from DaanDeMeyer/manager-json-split
Luca Boccassi [Wed, 14 Aug 2024 19:35:04 +0000 (21:35 +0200)] 
Merge pull request #33991 from DaanDeMeyer/manager-json-split

Various refactorings and fixes

14 months agotest-network: Add test for BareUDP srcportmin 32067/head
Susant Sahani [Wed, 14 Aug 2024 17:47:44 +0000 (23:17 +0530)] 
test-network: Add test for BareUDP srcportmin

14 months agonetwork: netdev - BareUDP Add support for srcportmin
Susant Sahani [Wed, 14 Aug 2024 17:48:20 +0000 (23:18 +0530)] 
network: netdev - BareUDP Add support for srcportmin

Allows to configure the lowest value of the UDP tunnel source port range.

14 months agoMerge pull request #33990 from yuwata/run-json-follow-ups
Mike Yuan [Wed, 14 Aug 2024 14:06:03 +0000 (16:06 +0200)] 
Merge pull request #33990 from yuwata/run-json-follow-ups

run: several follow-ups for recent change

14 months agocore-varlink: Introduce manager_varlink_managed_oom_connect() 33991/head
Daan De Meyer [Mon, 12 Aug 2024 12:15:35 +0000 (14:15 +0200)] 
core-varlink: Introduce manager_varlink_managed_oom_connect()

In the next commit, we'll introduce a varlink server for the user
manager. As preparation for that, let's introduce a new function to
initialize only the managed OOM connection whenever we send a managed
OOM update.

14 months agocore-varlink: merge two FLAGS_SET() where appropriate
Mike Yuan [Wed, 24 Jul 2024 20:08:15 +0000 (22:08 +0200)] 
core-varlink: merge two FLAGS_SET() where appropriate

14 months agosd-json: Use goto finish instead of return
Daan De Meyer [Thu, 8 Aug 2024 12:14:53 +0000 (14:14 +0200)] 
sd-json: Use goto finish instead of return

sd_json_buildv() uses a "finish" goto label for cleanup so make sure
we goto that label on failure instead of returning directly.

14 months agotaint: Add taint_strv() to get taints as an array
Daan De Meyer [Thu, 8 Aug 2024 08:57:35 +0000 (10:57 +0200)] 
taint: Add taint_strv() to get taints as an array

14 months agocore: Clean up includes a little
Daan De Meyer [Fri, 9 Aug 2024 12:07:34 +0000 (14:07 +0200)] 
core: Clean up includes a little

14 months agocore: Introduce unit_is_filtered()
Daan De Meyer [Wed, 7 Aug 2024 11:12:03 +0000 (13:12 +0200)] 
core: Introduce unit_is_filtered()

14 months agocore: Use RateLimit struct to store ratelimits
Daan De Meyer [Wed, 29 Nov 2023 13:15:00 +0000 (14:15 +0100)] 
core: Use RateLimit struct to store ratelimits

This makes it easier to serialize these ratelimits with
JSON_BUILD_CALLBACK().

14 months agobasic: Various cleanups for ratelimit functions
Daan De Meyer [Fri, 9 Aug 2024 12:49:52 +0000 (14:49 +0200)] 
basic: Various cleanups for ratelimit functions

14 months agotest: Use usual setup in integration-test-setup script
Daan De Meyer [Thu, 8 Aug 2024 20:34:05 +0000 (22:34 +0200)] 
test: Use usual setup in integration-test-setup script

14 months agotest: Fix section of StateDirectory=
Daan De Meyer [Thu, 8 Aug 2024 19:49:09 +0000 (21:49 +0200)] 
test: Fix section of StateDirectory=

14 months agomkosi: Install llvm
Daan De Meyer [Thu, 8 Aug 2024 19:48:34 +0000 (21:48 +0200)] 
mkosi: Install llvm

For llvm-symbolizer which is required to sanitize address sanitizer
reports.

14 months agomkosi: Disable pagination in gdb
Daan De Meyer [Thu, 8 Aug 2024 08:59:08 +0000 (10:59 +0200)] 
mkosi: Disable pagination in gdb

14 months agoMerge pull request #33957 from yuwata/network-generator-vlan
Luca Boccassi [Wed, 14 Aug 2024 10:45:25 +0000 (12:45 +0200)] 
Merge pull request #33957 from yuwata/network-generator-vlan

network-generator: fixlets for vlan interfaces

14 months agorun: use sd_json_variant_set_field_id128() 33990/head
Yu Watanabe [Wed, 14 Aug 2024 06:53:42 +0000 (15:53 +0900)] 
run: use sd_json_variant_set_field_id128()

14 months agosd-json: add sd_json_variant_set_field_id128() and _uuid()
Yu Watanabe [Wed, 14 Aug 2024 06:52:39 +0000 (15:52 +0900)] 
sd-json: add sd_json_variant_set_field_id128() and _uuid()

14 months agorun: drop unnecessary initializations
Yu Watanabe [Wed, 14 Aug 2024 06:45:31 +0000 (15:45 +0900)] 
run: drop unnecessary initializations

Follow-up for fe5a6c47af675bc0020c545d86fb103492e1d77c.

14 months agonetwork-generator: drop wrong warning for rd.peerdns without value 33957/head
Yu Watanabe [Wed, 14 Aug 2024 06:39:12 +0000 (15:39 +0900)] 
network-generator: drop wrong warning for rd.peerdns without value

14 months agonetwork-generator: ignore kernel command line without value
Yu Watanabe [Wed, 14 Aug 2024 06:36:22 +0000 (15:36 +0900)] 
network-generator: ignore kernel command line without value

And drop duplicated log messages.

14 months agonetwork-generator: use extract_first_word()
Yu Watanabe [Fri, 9 Aug 2024 05:41:07 +0000 (14:41 +0900)] 
network-generator: use extract_first_word()

Now, ip= with trailing colon is refused.

14 months agonspawn: Fix help typo
Dr. David Alan Gilbert [Wed, 14 Aug 2024 00:11:26 +0000 (01:11 +0100)] 
nspawn: Fix help typo

'an an' -> 'an'

14 months agoman/systemd-sysusers, man/systemd-tmpfiles: fix sentence fragments
James Muir [Tue, 13 Aug 2024 01:53:24 +0000 (21:53 -0400)] 
man/systemd-sysusers, man/systemd-tmpfiles: fix sentence fragments

add "are executed" so that those two sentences have a verb.

14 months agonspawn: Assume unified cgroup hierarchy if there's no systemd in the image
Daan De Meyer [Tue, 13 Aug 2024 09:59:51 +0000 (11:59 +0200)] 
nspawn: Assume unified cgroup hierarchy if there's no systemd in the image

If there's no systemd installation in the image, assume the unified
cgroup hierarchy.

14 months agodocs: Mention the new mount API in the container interface doc
Daan De Meyer [Tue, 13 Aug 2024 08:36:40 +0000 (10:36 +0200)] 
docs: Mention the new mount API in the container interface doc

Let's mention that the new mount API may be used to establish new
mounts in a container without needing the /run/host/incoming directory.

14 months agoMerge pull request #33979 from YHNdnzj/edit-util-no-duplicate-strip
Luca Boccassi [Mon, 12 Aug 2024 23:48:06 +0000 (01:48 +0200)] 
Merge pull request #33979 from YHNdnzj/edit-util-no-duplicate-strip

edit-util: a few cleanups; support networkctl edit --stdin

14 months agosystemd-run: add unit and invocation_id JSON output
Lukas Nykryn [Mon, 12 Aug 2024 13:15:15 +0000 (15:15 +0200)] 
systemd-run: add unit and invocation_id JSON output

14 months agonetworkctl: support edit --stdin 33979/head
Mike Yuan [Fri, 5 Jul 2024 19:34:07 +0000 (21:34 +0200)] 
networkctl: support edit --stdin

14 months agoedit-util: several cleanups for --stdin handling
Mike Yuan [Sun, 11 Aug 2024 13:41:07 +0000 (15:41 +0200)] 
edit-util: several cleanups for --stdin handling

Follow-up for 329050c5e2c7e9561699f87b5edb72edd0d54c96

I don't particularly favor the duplicated strstrip()
and such, so let's ensure if we get fixed data it's
only trimmed once. Subsequently we can benefit more
by making all copies reflinks.

14 months agoedit-util: do not try to recreate temp file if missing
Mike Yuan [Sun, 11 Aug 2024 13:41:30 +0000 (15:41 +0200)] 
edit-util: do not try to recreate temp file if missing

We initially read from temp file, then strip it, and write
back to it. If the file suddenly disappeared during the process,
it indicates someone else is touching our temp file
behind our back. Let's not silently continue.

14 months agoedit-util: clean up run_editor() a bit
Mike Yuan [Sun, 7 Jul 2024 15:21:08 +0000 (17:21 +0200)] 
edit-util: clean up run_editor() a bit

- Add missing assertions
- Close all fds before spawning editor
- Use FOREACH_STRING() + empty_to_null() where appropriate
  Note that this slightly changes the behavior, in that
  empty envvars would be treated as unset and we'd try
  the next candidate. But the new behavior is better IMO.

14 months agomkosi: update debian commit reference
Luca Boccassi [Sun, 11 Aug 2024 13:33:07 +0000 (14:33 +0100)] 
mkosi: update debian commit reference

6e0f4f74ba Update changelog for 256.4-3 release
4b142f9c37 Depend on new linux-bpf-dev package where available
f5fe5ecf4d autopkgtest: use hint-testsuite-triggers to ensure other packages changes trigger our testsuite
407932845d autopkgtest: run upstream test last
31458d03c2 Stop installing legaly pkla file in upstream CI too
484643291a Use d/not-installed instead of manual removals
752bb4c34c Stop shipping empty /etc/init.d directory
174603ffc2 Use debian/clean instead of override in d/rules
9a355e5a51 Drop redundant pot build
3d249c88cb Update changelog for 256.4-2 release

14 months agocore/exec-invoke: call setpriority() after sched_setattr()
Ivan Shapovalov [Wed, 7 Aug 2024 08:02:45 +0000 (10:02 +0200)] 
core/exec-invoke: call setpriority() after sched_setattr()

The nice value is part of struct sched_attr, and consequently invoking
sched_setattr() after setpriority() would clobber the nice value with
the default (as we are not setting it in struct sched_attr).

It would be best to combine both calls, but for now simply invoke
setpriority() after sched_setattr() to make sure Nice= remains effective
when used together with CPUSchedulingPolicy=.

14 months agoterminal-util: do not query kernel cmdline for pty size
Mike Yuan [Fri, 9 Aug 2024 15:33:39 +0000 (17:33 +0200)] 
terminal-util: do not query kernel cmdline for pty size

This is pointless and noisy even for debug level.

14 months agoMerge pull request #33961 from bluca/busctl_exit
Luca Boccassi [Fri, 9 Aug 2024 12:48:40 +0000 (14:48 +0200)] 
Merge pull request #33961 from bluca/busctl_exit

busctl: add support for --timeout and --num-matches for monitor verb

14 months agobusctl: add --num-matches= for monitor verb 33961/head
Luca Boccassi [Wed, 7 Aug 2024 20:59:26 +0000 (21:59 +0100)] 
busctl: add --num-matches= for monitor verb

Useful in scripts when one wants to wait for a specific
signal before continuing

14 months agocore/unit: do not use unit path cache in unit_need_daemon_reload()
Nick Rosbrook [Wed, 7 Aug 2024 22:18:06 +0000 (18:18 -0400)] 
core/unit: do not use unit path cache in unit_need_daemon_reload()

When unit_need_daemon_reload() calls unit_find_dropin_paths() to check
for new drop-in configs, the manager's unit path cache is used to limit
which directories are considered. If a new drop-in directory is created,
it may not be in the unit path cache, and hence unit_need_daemon_reload()
may return false, despite a new drop-in being present. However, if a
unit path cache is not given to unit_file_find_dropin_paths() at all,
then it behaves as if the target path was found in the unit path cache.

So, to fix this, adapt unit_find_dropin_paths() to take a boolean
argument indicating whether or not to pass along the unit path cache.
Set this to false in unit_need_daemon_reload().

Fixes #31752

14 months agonetwork-generator: use network_acquire() at more places
Yu Watanabe [Fri, 9 Aug 2024 05:37:59 +0000 (14:37 +0900)] 
network-generator: use network_acquire() at more places

14 months agonetwork-generator: introduce network_acquire() and netdev_acquire()
Yu Watanabe [Wed, 7 Aug 2024 06:19:23 +0000 (15:19 +0900)] 
network-generator: introduce network_acquire() and netdev_acquire()

No functional change, just refactoring.

14 months agonetwork-generator: trivial cleanups
Yu Watanabe [Thu, 8 Aug 2024 15:42:11 +0000 (00:42 +0900)] 
network-generator: trivial cleanups

14 months agonetwork-generator: parse vlan ID from vlan interface name
Yu Watanabe [Wed, 7 Aug 2024 06:04:46 +0000 (15:04 +0900)] 
network-generator: parse vlan ID from vlan interface name

Fixes #33954.

14 months agonetwork-generator: allow to create bridge or friends without slave interfaces
Yu Watanabe [Fri, 9 Aug 2024 10:01:40 +0000 (19:01 +0900)] 
network-generator: allow to create bridge or friends without slave interfaces

14 months agonetwork-generator: vlan= can be specified multiple times
Yu Watanabe [Wed, 7 Aug 2024 06:03:59 +0000 (15:03 +0900)] 
network-generator: vlan= can be specified multiple times

14 months agotest: add one more test case without hostname
Yu Watanabe [Fri, 9 Aug 2024 06:39:05 +0000 (15:39 +0900)] 
test: add one more test case without hostname

14 months agotest: modernize test-network-generator
Yu Watanabe [Fri, 9 Aug 2024 05:34:33 +0000 (14:34 +0900)] 
test: modernize test-network-generator

14 months agotest: note in README how to get full list of Ubuntu CI jobs
Luca Boccassi [Thu, 8 Aug 2024 14:13:38 +0000 (15:13 +0100)] 
test: note in README how to get full list of Ubuntu CI jobs

15 months agohwdb: Fix accelerometer mount matrix for ASUS T100TAS
Renan Guilherme [Wed, 7 Aug 2024 22:57:18 +0000 (18:57 -0400)] 
hwdb: Fix accelerometer mount matrix for ASUS T100TAS

15 months agobusctl: add support for --timeout to monitor verb
Luca Boccassi [Wed, 7 Aug 2024 19:41:20 +0000 (20:41 +0100)] 
busctl: add support for --timeout to monitor verb

Useful in scripts when you want to exit successfully after a certain time

15 months agoMerge pull request #33959 from DaanDeMeyer/crash
Daan De Meyer [Thu, 8 Aug 2024 06:14:46 +0000 (08:14 +0200)] 
Merge pull request #33959 from DaanDeMeyer/crash

Two crash handler improvements

15 months agonspawn: fix settings leak for init parameter
Luca Boccassi [Wed, 7 Aug 2024 21:35:52 +0000 (22:35 +0100)] 
nspawn: fix settings leak for init parameter

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

Follow-up for ce2291730d5f91190e97e7c515ac772ae4970062

15 months agocrash-handler: Drop 10s sleep before we spawn the crash shell 33959/head
Daan De Meyer [Wed, 7 Aug 2024 18:48:09 +0000 (20:48 +0200)] 
crash-handler: Drop 10s sleep before we spawn the crash shell

It pointlessly delays getting to the crash shell so let's drop the
10s sleep.

15 months agocrash-handler: Call vhangup on /dev/console before spawning crash shell
Daan De Meyer [Wed, 7 Aug 2024 18:44:38 +0000 (20:44 +0200)] 
crash-handler: Call vhangup on /dev/console before spawning crash shell

When pid 1 crashes, the getty unit for the console will happily keep
running which means we end up with two shells competing for the same
tty. Let's call vhangup on /dev/console to kill every other process
attached to the console before we spawn the crash shell. The getty
units have Restart=always but lucky for us, pid 1 just crashed in fire
and flames so it isn't actually able to restart the getty unit.

15 months agomkosi: Disable debuginfod
Daan De Meyer [Wed, 7 Aug 2024 19:23:37 +0000 (21:23 +0200)] 
mkosi: Disable debuginfod

We generally don't care about library debuginfo so let's just disable
debuginfod so it doesn't get in the way when debugging.

We use /root/.gdbinit as the systemwide gdbinit location is distribution
specific.

15 months agomeson: enable -Wunterminated-string-initialization
Yu Watanabe [Wed, 7 Aug 2024 05:03:13 +0000 (14:03 +0900)] 
meson: enable -Wunterminated-string-initialization

With af1a6db58fde8f64edcf7d27e1f3b636c999934c, now we can build with the
option.

15 months agoMerge pull request #33951 from DaanDeMeyer/nspawn
Daan De Meyer [Wed, 7 Aug 2024 05:32:50 +0000 (07:32 +0200)] 
Merge pull request #33951 from DaanDeMeyer/nspawn

nspawn: Allow specifying custom init program

15 months agobasic|boot: silence Wunterminated-string-initialization gcc15 warnings
Cristian Rodríguez [Sun, 4 Aug 2024 22:51:54 +0000 (18:51 -0400)] 
basic|boot: silence Wunterminated-string-initialization gcc15 warnings

gcc15 has -Wunterminated-string-initialization in -Wextra and
warns about string constants that are not null terminated even though
the functions do do out of bounds access.
Silence the warnings by simply not providing an explicit size.

15 months agonspawn: Allow specifying custom init program 33951/head
Daan De Meyer [Tue, 6 Aug 2024 09:08:33 +0000 (11:08 +0200)] 
nspawn: Allow specifying custom init program

This allows for example forcing to use /sbin/init instead of always
using /usr/lib/systemd/systemd if it exists. Or it allows using a
different path altogether.

15 months agocoredump: generate properly symbolized stacktrace for containerized processes
Michal Sekletar [Tue, 9 Jul 2024 13:21:34 +0000 (15:21 +0200)] 
coredump: generate properly symbolized stacktrace for containerized processes

15 months agosysusers: check if requested group name matches user name in queue
Nick Rosbrook [Tue, 6 Aug 2024 00:43:15 +0000 (20:43 -0400)] 
sysusers: check if requested group name matches user name in queue

When creating a user, check if the requested group name matches a user
name in the queue. If that matched user name is also going to be a group
name, then use it for the new user too. In other words, allow the
following:

 u foo -
 u bar -:foo

when both foo and bar are new users.

Fixes #33547

15 months agonspawn: Drop unused includes
Daan De Meyer [Tue, 6 Aug 2024 08:25:06 +0000 (10:25 +0200)] 
nspawn: Drop unused includes

15 months agoMerge pull request #33942 from yuwata/udevadm-info-attribute-walk-json
Daan De Meyer [Tue, 6 Aug 2024 08:23:45 +0000 (10:23 +0200)] 
Merge pull request #33942 from yuwata/udevadm-info-attribute-walk-json

udevadm-info: support json output for --attribute-walk

15 months agoMerge pull request #33933 from yuwata/systemctl-bus-transport-and-runtime-scope
Yu Watanabe [Tue, 6 Aug 2024 00:12:28 +0000 (09:12 +0900)] 
Merge pull request #33933 from yuwata/systemctl-bus-transport-and-runtime-scope

systemctl: fix bus transport and runtime scope handling

15 months agoMerge pull request #33941 from yuwata/network-dhcp-pd-route-type
Yu Watanabe [Tue, 6 Aug 2024 00:11:54 +0000 (09:11 +0900)] 
Merge pull request #33941 from yuwata/network-dhcp-pd-route-type

network/dhcp-pd: introduce UnassignedSubnetPolicy= to customize type of 'catch-all' route

15 months agosystemctl: gracefully adjust bus transport and runtime scope when --boot-loader-entry... 33933/head
Yu Watanabe [Sun, 4 Aug 2024 05:09:53 +0000 (14:09 +0900)] 
systemctl: gracefully adjust bus transport and runtime scope when --boot-loader-entry=help

This fixes the following assertion:
===
SYSTEMD_LOG_LEVEL=debug systemctl --user -H foo --boot-loader-entry=help
Assertion 'transport != BUS_TRANSPORT_REMOTE || runtime_scope == RUNTIME_SCOPE_SYSTEM' failed at src/shared/bus-util.c:284, function bus_connect_transport(). Ignoring.
Failed to connect to bus: Operation not supported
===

Fixes a bug introduced by 97af80c5a7029c3f92e982dcf9338b9e67ad9cde.
Fixes #33661.
Fixes oss-fuzz#70153.

15 months agotest-network: add test case for UnassignedSubnetPolicy= 33941/head
Yu Watanabe [Mon, 5 Aug 2024 02:18:45 +0000 (11:18 +0900)] 
test-network: add test case for UnassignedSubnetPolicy=

15 months agonetwork/dhcp-pd: allow to customize route type for delegated prefix
Yu Watanabe [Sun, 4 Aug 2024 09:18:51 +0000 (18:18 +0900)] 
network/dhcp-pd: allow to customize route type for delegated prefix

Closes #33929.

15 months agoudevadm-info: support json output for --attribute-walk 33942/head
Yu Watanabe [Mon, 5 Aug 2024 03:29:46 +0000 (12:29 +0900)] 
udevadm-info: support json output for --attribute-walk

Closes #33852.

15 months agosrc/pcrlock/pcrlock.c: Handle empty pcrlock.d directories
Arnaud Patard [Mon, 8 Jul 2024 13:39:14 +0000 (15:39 +0200)] 
src/pcrlock/pcrlock.c: Handle empty pcrlock.d directories

Running the following commands:

  # mkdir -p /var/lib/pcrlock.d/123-empty.pcrlock.d
  # /usr/lib/systemd/systemd-pcrlock predict --pcr=1+2+3+4+5+16

Will result in:

...
Floating point exception

Running the following commands:
  # mkdir -p /var/lib/pcrlock.d/123-empty.pcrlock.d
  # /usr/lib/systemd/systemd-pcrlock make-policy --pcr=1+2+3+4+5+16

Will result to this (partial) log:
...
Predicted future PCRs in 133us.
[]
...
Written policy digest 0000000000000000000000000000000000000000000000000000000000000000 to NV index 0x1921da6
...

So, add missing checks to handle gracefully cases where there's no variant
inside the component.

Signed-off-by: Arnaud Patard <arnaud.patard@collabora.com>
15 months agologind: add PreparingForShutdownWithMetadata property
Luca Boccassi [Sun, 4 Aug 2024 22:47:29 +0000 (23:47 +0100)] 
logind: add PreparingForShutdownWithMetadata property

The PrepareForShutdownWithMetadata signal was added via
e4aab5cf1a00bbb73f325f4f785dd4171ccdae77 but a corresponding property
was not. A property has to be a single type, so the bool needs to be
one of the key/value pairs as 'ba{sv}' is not a valid property.