1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-02 09:47:03 +03:00

61171 Commits

Author SHA1 Message Date
Vitaly Kuznetsov
1e8057fce7 man: /usr/lib/systemd/random-seed -> /usr/lib/systemd/systemd-random-seed
/usr/lib/systemd/random-seed is not a thing.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
(cherry picked from commit b4e5c103be9de99dfb5e2e47fd1563cf5388978a)
(cherry picked from commit b1ecfe3fe7a74b2be8127dfa15514cd9f01f5c85)
2023-04-28 16:29:56 +01:00
Zbigniew Jędrzejewski-Szmek
e451c03340 test: use idiomatic bash loop iteration
In a few cases, also avoid a sleep in the last (failed) iteration of the loop.
It doesn't matter too much, but it's still ugly.

(cherry picked from commit 4481a3085501b4982e81c904db6c8f11a567efb9)
(cherry picked from commit c6e957d02de5bfbefc6f43e0d0d8db61cf41d7b4)
2023-04-28 16:29:56 +01:00
Zbigniew Jędrzejewski-Szmek
420f0b39b7 testsuite-54: drop unnecessary pipe
(cherry picked from commit 97b35c7cecc328c706dfdf90ade0c620d454c205)
(cherry picked from commit 26e181e94e9c938373829622b916f26c3f9ad2cc)
2023-04-28 16:29:56 +01:00
Zbigniew Jędrzejewski-Szmek
ea1ed1cd18 testsuite-70: drop unnecessary env
(cherry picked from commit add53f9b93033ca93a59b0263047955489dbfb21)
(cherry picked from commit d2c738341b7a2bb004a004e6696bb6b9969f6c8b)
2023-04-28 16:29:56 +01:00
Zbigniew Jędrzejewski-Szmek
3626aabecb test: drop uses of "&& { echo 'unexpected success'; exit 1; }"
Brief is sweet.

(cherry picked from commit 128db0aa0098b58b415065c2955f9abc7fc967e1)
(cherry picked from commit f3abd451dde25086e06c56ba0b8388f64c1d306e)
2023-04-28 16:29:56 +01:00
Luca Boccassi
7bcdbf4301 man: fix LogControl1 manpage example
Follow-up for c6b8fffdfaf1f7c9a1dac73e1e54993a06c766c0

(cherry picked from commit 33054db730fb6f2fd6221d38a788e30b95525463)
(cherry picked from commit 59243061f62142ee0f74d25e352a55f174f1bb97)
2023-04-28 16:29:56 +01:00
Luca Boccassi
bdbad92ac0 pam: cache sd-bus separately per module
sd-bus connection is cached by the two pam modules globally, but this
can lead to issues due to hashmaps (used by sd-bus) using a global
static variable for the shared hash key, which is different per module
as both modules are loaded in the same process.

This happens because the sd-bus object is create in one module, but
used in the other, so global state does not match.

Use a different pam cache identifier for the sd-bus pointer, so that
each module uses a different sd-bus connection as a workaround.

Fixes https://github.com/systemd/systemd/issues/27216
Fixes https://github.com/systemd/systemd/issues/17266

(cherry picked from commit a2dd39b4cb19f4ed4599422e635cc019dcae6ada)
(cherry picked from commit 04983c2b00c8c04dd97ce55a43c6811355b642d6)
2023-04-28 16:29:56 +01:00
Luca Boccassi
791205fe3f pam_systemd_home: clean up sd-bus when called about something else's user
acquire_home() takes a reference to a sd-bus object, which the open_session
hook cleans on success. But only when handling a user actually owned by homed,
it did not clean it up when skipping because it is being invoked on a system
user.
We need to be careful with sd-bus here as pam_sm_open_session is the last
hook before forking, and we want to clean up sd-bus before that happens, or
we'll have a broken reference (FDs are cloexec) in the child process, which
will then assert when attempting to close them, or leak the bus connection
which causes dbus to complain loudly:

 dbus-daemon[62]: [system] Connection has not authenticated soon enough, closing it (auth_timeout=30000ms, elapsed: 30020ms)

(cherry picked from commit db0c0f5e003b0a0e202dbc399d35db36087c641c)
(cherry picked from commit 0045d952b5db4b8761892faef2a2e173111c6333)
2023-04-28 16:29:56 +01:00
Luca Boccassi
a9e44da6b1 man: clarify sd_bus_default
It picks the bus based on the cgroup slice.

(cherry picked from commit f0f7cbd488fd0e00c5b77baf3b1324240fd7d72d)
(cherry picked from commit 5a8987794eb1cddf43bfe240d241d3a5462c1e5a)
2023-04-28 16:29:56 +01:00
Luca Boccassi
3c9b9aabc5 man: add working example to LogControl1 manpage
Add fully working and documented example that can be copied and pasted

(cherry picked from commit c6b8fffdfaf1f7c9a1dac73e1e54993a06c766c0)
(cherry picked from commit b9af9a320ece89804ba8e17390240e4325968ef5)
2023-04-28 16:29:56 +01:00
Zbigniew Jędrzejewski-Szmek
a473e95158 detect-virt: add message at debug level
Normal users do not have permissions to access /proc/1/root, so
'systemd-detect-virt -r' fails, but the output, even at debug level
is cryptic:

$ SYSTEMD_LOG_LEVEL=debug build/systemd-detect-virt -r
Failed to check for chroot() environment: Permission denied

Let's make this a bit easier to figure out:

$ SYSTEMD_LOG_LEVEL=debug build/systemd-detect-virt -r
Cannot stat /proc/1/root: Permission denied
Failed to check for chroot() environment: Permission denied

I looked over other users of files_same(), and I think in general the message
at debug level is OK for them too.

(cherry picked from commit 08c2f9c626e0f0052d505b1b7e52f335c0fbfa1d)
(cherry picked from commit 4d2b5338ac0ab8c351bc6aa31113c2dfbe26f890)
2023-04-28 16:29:56 +01:00
Lennart Poettering
cd6a82d835 dissect-image: issue BLKFLSBUF before probing an fs at block device offset != 0
See added code comment for a longer explanation. TLDR: Linux maintains
distinct block device caches for partition and "whole" block devices,
and a simply BLKFLSBUF should make the worst confusions this causes go
away.

(cherry picked from commit 4d49f44f0fcdaa51b7311fb9420018995945f3f3)
(cherry picked from commit 2be23f69eef7d9b12e4ddeffcf676ba54a9a6ad7)
2023-04-28 16:29:56 +01:00
Yu Watanabe
73f7c65d34 list: fix double evaluation
(cherry picked from commit 24a5370bbc1b52fee52d8891f66af13e9d77d799)
(cherry picked from commit 7b437659b15c0cd87b5720b3570dcd5e5ad9abca)
2023-04-28 16:29:56 +01:00
Yu Watanabe
f196219de4 mountpoint-util: check /proc is mounted on failure
(cherry picked from commit 4b1e461c49ea935df0c740b31aecfd161b12d2e7)
(cherry picked from commit ffbb75aa46786f0fc797c4a3b5b28679b28877a3)
2023-04-28 16:29:56 +01:00
Frantisek Sumsal
d5ad512709 test: prefix the transient unit with test- to make coverage runs happy
See 9fd8226312 for more details.

Follow-up to c9210b7470.

(cherry picked from commit 574d09bad079cfc19e0dd142fd6fe23d4b251878)
(cherry picked from commit 14eb49b5eb48a73a77baafc63aa3e46c524aeaf2)
2023-04-28 16:29:56 +01:00
Lennart Poettering
96e51b5f3e kmod-setup: bypass heavy virtio-rng check if we are not running in a VM anyway
detect_vm() is cheap, because cached, let's hence do that early before
we get out the big guns and sweep through sysfs.

(cherry picked from commit 0a5d3c0b5bfee68102de6345a3cd5580fbd5da02)
(cherry picked from commit 980954d2cf66a52d8950b93371b222443e4c7f23)
2023-04-28 16:29:56 +01:00
Lennart Poettering
ecda1ada56 kmod-setup: use STARTSWITH_SET() where appropriate
(cherry picked from commit fa505db314ba74c71e5165c8857009ff9e7d4641)
(cherry picked from commit 567a1a6fd87794ea948305d8809875f66470666a)
2023-04-28 16:29:56 +01:00
Luca Boccassi
f55ffedc69 creds: make available to all ExecStartPre= and ExecStart= processes
Fixes https://github.com/systemd/systemd/issues/27275

(cherry picked from commit c9210b74701d749c5b684cc4de517be42baa9c57)
(cherry picked from commit d37f06f96f7ddaa447b01077a4024473a02c7ba8)
2023-04-28 16:29:56 +01:00
jcg
ec659f9285 user-util:remove duplicate includes
(cherry picked from commit 1034dfd0d8f7b788a64c325b0ca2e1585bf639cf)
(cherry picked from commit d15f907b5b010124f12637e9a98883dc7fbb01bf)
2023-04-28 16:29:56 +01:00
Benjamin Herrenschmidt
c7b42ad937 virt: Further improve detection of EC2 metal instances
Commit f90eea7d18d9ebe88e6a66cd7a86b618def8945d
virt: Improve detection of EC2 metal instances

Added support for detecting EC2 metal instances via the product
name in DMI by testing for the ".metal" suffix.

Unfortunately this doesn't cover all cases, as there are going to be
instance types where ".metal" is not a suffix (ie, .metal-16xl,
.metal-32xl, ...)

This modifies the logic to also allow those new forms.

Signed-off-by: Benjamin Herrenschmidt <benh@amazon.com>
(cherry picked from commit aab896e2135362ab126830c73284d4af0baad88a)
(cherry picked from commit cedea4cb7ee18b2d174e5290dbad03c5b91bea37)
2023-04-28 16:29:56 +01:00
Lennart Poettering
5e04efbc2a string-util: add strstrafter()
strstrafter() is like strstr() but returns a pointer to the first
character *after* the found substring, not on the substring itself.
Quite often this is what we actually want.

Inspired by #27267 I think it makes sense to add a helper for this,
to avoid the potentially fragile manual pointer increment afterwards.

(cherry picked from commit d791013ff529cbbb74d4cc5f1455f172befab1e6)
(cherry picked from commit 826662680badec75ba0fd607dbeaedf6f45cec8f)
2023-04-28 16:29:56 +01:00
Frantisek Sumsal
2a82906e9e test: add a couple of tests with invalid UTF-8 characters
(cherry picked from commit 841834d9c358163308deb70642249e8b2ba76c1a)
(cherry picked from commit ac721c88aff0dca71bc517d4d7ba57091307c8ae)
2023-04-28 16:29:56 +01:00
Frantisek Sumsal
e8ac7521b4 test: add a simple test for getenv_path_list()
(cherry picked from commit 192242c986e2462c4d2ec5b3ecd6f1ac02f9c0ad)
(cherry picked from commit 9c8d8719e4d60c1220e06a10d1c8f779043bbf95)
2023-04-28 16:29:56 +01:00
Frantisek Sumsal
e166b24da6 test: add a couple of basic sanity tests for the security verb
(cherry picked from commit f7f5657ece9d0afd5026edd835b12aa970f46547)
(cherry picked from commit a9c73150ac056c718c60beef612bbc00cc57d0d3)
2023-04-28 16:29:56 +01:00
Frantisek Sumsal
1002f0e350 test: add a couple of basic sanity tests for timedatectl
(cherry picked from commit a51ba8e31a8d68d3d27711d173e55b7cfc48e6d9)
(cherry picked from commit 06a70861bc008f9916b6c1a54b703b0cb069f296)
2023-04-28 16:29:56 +01:00
Frantisek Sumsal
71a8198af4 shared: add a missing include
(cherry picked from commit 1b2719c2c5ce1349a1e48a093668fb90734e2e53)
(cherry picked from commit def6c37a196e8b0750edc8dee31d3e16e93d9afd)
2023-04-28 16:29:56 +01:00
Frantisek Sumsal
41ada7d970 test: add tests for uuid/uint64 specifiers
They're used in repart, but are not part of the "common" specifier
lists, so cover them explicitly.

(cherry picked from commit 9f7fcf80ad2bd69d1267e782ac2c846e40bf2c7d)
(cherry picked from commit 79e23f618fec48cc8ff4fdf9aa3cf8e82f6c1d04)
2023-04-28 16:29:56 +01:00
Florian Klink
23a3efd4e7 fsck: look for fsck binary not just in /sbin
This removes remaining hardcoded occurences of `/sbin/fsck`, and instead
uses `find_executable` to find `fsck`.

We also use `fsck_exists_for_fstype` to check for the `fsck.*`
executable, which also checks in `$PATH`, so it's fair to assume fsck
itself is also available.

(cherry picked from commit a108fcbacee859036f5613177321889bc34fd597)
(cherry picked from commit 3ee1839c19f1187d04b81a823b62ce26e8f6e595)
2023-04-28 16:29:56 +01:00
Frantisek Sumsal
e334874083 test: stop the test unit when it's not needed anymore
Otherwise it keeps printing stuff to the journal/console, adding
unnecessary noise.

(cherry picked from commit 3a8b7e8b5f72a940a07938a8ed33f2c3283dd52b)
(cherry picked from commit eab75a859117206352f4c8d2928631c42e9b3541)
2023-04-28 16:29:56 +01:00
ZjYwMj
ef395963a4 Synposis and description of networkctl man page reflecting only part of its functionality (#27264)
* Fix inaccurate synposis, and description

Before the fix, they reflected only part of networkctl functionality.

(cherry picked from commit dd9f909ea819a4a06218982f681b92dab0ba7d9d)
(cherry picked from commit f86ec3495853ab143d5b0c1d0cb09b5725ef8d40)
2023-04-28 16:29:56 +01:00
Mike Yuan
e7015a5a02 core/main: fix a typo for --log-target
Follow-up for d2ebd50d7f9740dcf30e84efc75610af173967d2

Fixes #27105

(cherry picked from commit 6b7f150bbf4e873e57d527b7328ac59a57e0a681)
(cherry picked from commit fffcebc4bbe841418556d551b9ed44f8b7056138)
2023-04-28 16:29:56 +01:00
Nick Rosbrook
6da4d102e1 test: add some tests for RuntimeMaxSec
Make sure the RuntimeMaxSec is applied correctly to service and scope
units when they are started, and also on coldplug.

(cherry picked from commit af4688398f55b110c9d7d57be5cd0199b06e18c8)
(cherry picked from commit f152cdabaed160c767de2857b9c22513e8518b3e)
2023-04-28 16:29:56 +01:00
Nick Rosbrook
6bdcd58a88 scope: do not disable timer event source when state is SCOPE_RUNNING
In scope_set_state(), the timer event source may be disabled depending
on the state. Currently, it will be disabled when the state is
SCOPE_RUNNING. This has the effect of new RuntimeMaxSec values being
ignored on coldplug.

Note that this issue is not currently present when scopes are started
because when scope_start() is called, scope_arm_timer() is called after
scope_set_state().

(cherry picked from commit e1f85b49b09ed3e3717cf7776c9da7acc4e906c6)
(cherry picked from commit 999f48558bbe5d4665b97d76c530edc12f71b70b)
2023-04-28 16:29:56 +01:00
Franklin Yu
696c0ed616 Fix cross-reference of manual for LogsDirectory
(cherry picked from commit 8dacdd28f49e0b985d651e7c9f946aa666454063)
(cherry picked from commit 430861fc96585c6a5913b2a84456916e516a1a44)
2023-04-28 16:29:56 +01:00
David Schroeder
be49fcd07b pid1: fix coredump_filter setting
Correct what appears to be a copy/paste error in config_parse_exec_coredump_filter that is preventing the coredump_filter setting from working correctly.

(cherry picked from commit 9c669abb7106ae340ea47e7747d3bd054fbacdc5)
(cherry picked from commit 91953109ecd0956775b5bef442cd567917b11050)
2023-04-28 16:29:56 +01:00
Luca Boccassi
dd7a821b5f Uphold/StopWhenUnneeded/BindsTo: requeue when job finishes
When a unit is upheld and fails, and there are no state changes in
the upholder, it will not be retried, which is against what the
documentation suggests.

Requeue when the job finishes. Same for the other two queues.

(cherry picked from commit 4c7a0fc8d061b41fdd63eb19b6fc0a5c94668dde)
(cherry picked from commit fa8d33bb3704f7b14c1c51e1d0e48e0e5042a98c)
2023-04-28 16:29:56 +01:00
Luca Boccassi
374ef07274 Uphold/StopWhenUnneeded/BindsTo: add retry timer on rate limit
The Upholds= promise is that as long as unit A is up and Upholds=B,
B will be activated if failed or inactive. But there is a hard-coded,
non-configurable rate limit for this, so add a timed retry after the
ratelimit has expired.

Apply to BindsTo= and StopWhenUnneeded= as well.

(cherry picked from commit 7223d500ac548c69e7879931e3ad8c84838f925b)
(cherry picked from commit 6fc08d840718cbf20ddc2832a603c149ed92331b)
2023-04-28 16:29:56 +01:00
Michal Sekletar
7c353ca5d6 man: add util-linux to the package list for Fedora container
/bin/login is shipped in util-linux, however, systemd.spec on Fedora has
"Requires: (util-linux-core or util-linux)". If the dependency is
fulfilled just by installation of util-linux-core then users won't be
able to log in into the container after it boots. Let's add util-linux
package to the package list so that /bin/login is always present.

(cherry picked from commit 5015b5014bcff93371aef2c78b92efcfc2e38a40)
(cherry picked from commit 1fb4ae32b08c737662714c259573159d0e8788c3)
2023-04-28 16:29:56 +01:00
Zbigniew Jędrzejewski-Szmek
b3f0c01a9d man: link to Fedora 37
Fedora 36 is a bit old at this point and will be EOL in about 6 weeks.
Fedora 38 is not out yet, so the cloud link wouldn't work.

(cherry picked from commit 5a9e2dff473fe9c18f1425fd18ed7c16881b6997)
(cherry picked from commit 841146f243db0c368b20b111fe5d33166ff325b4)
2023-04-28 16:29:56 +01:00
Mike Yuan
bbbbf4932a systemctl: suppress error for try-* if unit is masked
Closes #16521

(cherry picked from commit 8a826a979aa51703ec45dbecc34691265b4d04e0)
(cherry picked from commit 465edc123029be095772a4ebcfc63b793ab09e94)
2023-04-28 16:29:56 +01:00
Jan Macku
77f5c97733 ci: drop checkout from release workflow
It's not required as per comment - https://github.com/systemd/systemd/pull/27110#issuecomment-1499653913

(cherry picked from commit 19cdda7c3a37362df602b3bfd1d2b949cc1f3598)
(cherry picked from commit 7102925d1a9b08cb25e5d8de031c75f29cff0d68)
2023-04-28 16:29:56 +01:00
Jan Macku
4857bc61d2 ci: don't run release wf on systemd-security
(cherry picked from commit 9718afd194290228e225a81126988394d167bf7a)
(cherry picked from commit 167c01688f80b97b9f148276b1fb2b601dff6706)
2023-04-28 16:29:56 +01:00
Masatake YAMATO
88f058583b shell-completion: add --xml-interface option of busctl to the rules
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
(cherry picked from commit a5efb0cc2b92d20f885b34c26254d9a9d45e3f4a)
(cherry picked from commit bda5c892a83a34a3e895c5e541f3eec19af8f04c)
2023-04-28 16:29:56 +01:00
Masatake YAMATO
5ebdf8e0f5 busctl: add --xml-interface to the help message
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
(cherry picked from commit c39b8978f62cbf5b693aafb5735b838b6af7b1fe)
(cherry picked from commit 6265430ca97ee255ce2d435c01b4559dd231e8be)
2023-04-28 16:29:56 +01:00
Yu Watanabe
6de5e76467 test: update description
(cherry picked from commit adc5b9823c6e6b518e73789d5ae9ae9718cd7072)
(cherry picked from commit d26fd71d1a2636c553672476d9b16dd4e1ec5bf4)
2023-04-28 16:29:56 +01:00
Дамјан Георгиевски
24c3212eae ci: add permissions to make a release
follow-up to https://github.com/systemd/systemd/pull/27071
in order to create Github Releases, the job needs permissions to write
contents

also:
- pinned the `softprops/action-gh-release` action to a specific commit
- made it only active on the `systemd` organization repos (so not on
  forks)

(cherry picked from commit 7b411cf8421ef3bf6c05edcf131f63b8e7bae8ac)
(cherry picked from commit dc2facf61d80cbb45421d024b56b93fb70e363aa)
2023-04-28 16:29:56 +01:00
Thomas Blume
1f8ec0ed38 test/test-functions: fix typo in install_suse_systemd()
(cherry picked from commit d6d06616319ef41ae2f6fcc4812764de2295cd7e)
(cherry picked from commit 4c65c644d6227dadedb317ae500a929e92f365fd)
2023-04-28 16:29:56 +01:00
Franck Bui
e1a7f29467 test: install symlinks with valid targets on SUSE and Debian
(cherry picked from commit f8d527aa9a9c724199aeafab45714a94eea2caf3)
(cherry picked from commit fca5a45a59a8e4707a92c52bb55c37b2fdd0da7e)
2023-04-28 16:29:56 +01:00
Olivier Gayot
fcd9ec3eff localed: fix invalid free after shifting pointers using strstrip
After manually editing /etc/locale.gen, calling localectl set-locale
sometimes fails. When it fails, the systemd journal shows:
systemd-localed: free() / invalid pointer.

It turned out that it only fails if some of the uncommented lines in
/etc/locale.gen have leading spaces, as in:

  * C.UTF-8       <= OK
  * en_US.UTF-8   <= OK
  *  fr_FR.UTF-8  <= NOK

After parsing a line from /etc/locale.gen, we use strstrip() to obtain
the "trimmed" line (without leading or trailing spaces).

However, we store the result of strstrip() in the original pointer
containing the untrimmed line. This pointer is later passed to free
(this is done automatically using _cleanup_free_).

This is a problem because if any leading space is present, the pointer
will essentially be shifted from its original value. This will result in
an invalid free upon cleanup.

The same issue is present in the locale_gen_locale_supported function.

Fixed by storing the result of strstrip() in a different pointer.

(cherry picked from commit b24b10592d74b73529817813ff33f7e28e79ca41)
(cherry picked from commit d18037b8ff43a1d7310708a50786f92c1291ce80)
2023-04-28 16:29:56 +01:00
Frantisek Sumsal
59982fbe8d test: bump the timeout for non-qemu runs to 90s
When Ubuntu CI is oversaturated, 60s doesn't seem to be enough.

(cherry picked from commit cb58571a1193122a5c20e8f6587115382d281002)
(cherry picked from commit 93ac024b7e568fe65b2e8f55ef13a32880239e95)
2023-04-28 16:29:56 +01:00