1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-08 05:57:26 +03:00

55878 Commits

Author SHA1 Message Date
Ludwig Nussel
8625211cc8 pull: fix PullFlags numbering
(cherry picked from commit 5243331fb8b77812177cf327f7d8c86c2e4ce323)
(cherry picked from commit 6a9cf204a724cbe02bb8dcbb28566fcb2065c6c9)
2022-11-04 13:02:20 +01:00
Luca Boccassi
c454d5fafb integritysetup: do not use crypt_init_data_device after crypt_init
crypt_init_data_device() replaces the crypt_device struct with a
new allocation, losing the old one, which we get from crypt_init().
Use crypt_set_data_device() instead.

Enhance the test to cover this option too.

(cherry picked from commit 872f9da4d8b67b012f1b1b227416d0c99bcdf43c)
(cherry picked from commit a27b69445384ec190503ec957cb9f81b1a382694)
2022-11-04 13:02:20 +01:00
Daan De Meyer
215b6ce2d6 man: Clarify that tools should prefer mount units over editing fstab
(cherry picked from commit 29e804dffd52496aaad2d0fc6a50d18a9940010d)
(cherry picked from commit 3814bd0e719dee925b4f3e47efe7cbd5ce03005a)
2022-11-04 13:02:20 +01:00
Lennart Poettering
3367e1bf48 man: fix docbook
(cherry picked from commit 1374f5a03aec469ad2f0ce56650f26da285d8660)
(cherry picked from commit 6b58b06c7d52db11e48213628370b25a7e2da69a)
2022-11-04 13:02:20 +01:00
James Hilliard
4fa81b6a2d bpf: fix is_allow_list section
The llvm bpf compiler appears to place const volatile variables in
a non-standard section which creates an incompatibility with the gcc
bpf compiler.

To fix this force GCC to also use the rodata section.

Note this does emit an assembler warning:
Generating src/core/bpf/restrict_ifaces/restrict-ifaces.bpf.unstripped.o with a custom command
/tmp/ccM2b7jP.s: Assembler messages:
/tmp/ccM2b7jP.s:87: Warning: setting incorrect section attributes for .rodata

See:
https://github.com/llvm/llvm-project/issues/56468

Fixes:
../src/core/restrict-ifaces.c:45:14: error: ‘struct
restrict_ifaces_bpf’ has no member named ‘rodata’; did you mean
‘data’?
   45 |         obj->rodata->is_allow_list = is_allow_list;
      |              ^~~~~~
      |              data

(cherry picked from commit e8b1e9cf1095f9d6d0f1e2dce2503e25fec2e6c5)
(cherry picked from commit cdd3f180b0777e3f94dd1666a7a07a494277beed)
2022-11-04 13:02:20 +01:00
Loïc Collignon
12b041584a Fix 24172: __STDC_VERSION__ may be defined in C++
According to the C++ ISO standard, a conformant compiler is allowed to
define this macro to any value for any reason as it is implementation
defined: https://timsong-cpp.github.io/cppwp/cpp.predefined#2.3

This mean that it cannot be assumed that it is not defined in a C++.
Change the condition to reflect that.

(cherry picked from commit 00852912edc69e652f4932fa536da60528f08ed3)
(cherry picked from commit 45faf77d4d0e349d7a7b84c46f943504d8f3b4cf)
2022-11-04 13:02:20 +01:00
Lennart Poettering
618b8d5a6d systemctl: clarify that "status" is about the most recent invocation of a service
And point people to "journalctl --unit=" for information of prior runs.

Inspired by: #24159

(cherry picked from commit 157cb4337b83359267050bff43c1ad39b0303f10)
(cherry picked from commit 0cfe2d7e88e197795209dbf7442fc05f814468ad)
2022-11-04 13:02:20 +01:00
Lennart Poettering
8e6ba03724 repart: when keeping ref to backing inode/devnode, use fd_reopen() rathern than F_DUPFD
Via the "backing_fd" variable we intend to pin the backing inode through
our entire code. So far we typically created the fd via F_DUPFD_CLOEXEC,
and thus any BSD lock taken one the original fd is shared with our
backing_fd reference. And if the origina fd is closed but our backing_fd
is not, we'll keep the BSD lock open, even if we then reopen the block
device through the backing_fd. If hit, this results in a deadlock.

Let's fix that by creating the backing_fd via fd_reopen(), so that the
locks are no longer shared, and if the original fd is closed all BSD
locks on it that are in effect are auto-released.

(Note the deadlock is only triggered if multiple operations on the same
backing inode are executed, i.e. factory reset, resize and applying of
partitions.)

Replaces: #24181
(cherry picked from commit 38f81e937426993cfc899aa09298f69f00935852)
(cherry picked from commit d3e84e47035753b3c24a27ebab6ae2a7db87b71d)
2022-11-04 13:02:20 +01:00
Jacek Migacz
a2fc30409d resolved: fix single-label resolution over DNS
Fixes: #23494 (when ResolveUnicastSingleLabel=yes)
(cherry picked from commit ff0a5070d45f20df7744b1090892be797bf18365)
(cherry picked from commit 7384d152c811c4c87616b67a2f4bb1783c5a2373)
2022-11-04 13:02:20 +01:00
Cristian Rodríguez
c57e95e8fa gcrypt: switch to system rng before gcry_check_version (#24162)
Current docs claim this must be done before gcry_check_version.

(cherry picked from commit 91375fb9cf38aca397a6d50e3f22dfb7a4aa1b98)
(cherry picked from commit 695eb673222cbf35c3afce0892fedcc7d08fb4af)
2022-11-04 13:02:20 +01:00
Max Gautier
427d189479 docs: Correct StandartOutput documentation
fix #2114

(cherry picked from commit e0a12b96344b1d7ee499df1d0447b14ced62c1b4)
(cherry picked from commit 79de67e2dfebf3c40a65010d4d261dda28489f3e)
2022-11-04 13:02:20 +01:00
Eli Schwartz
9359dd6977 meson: fix broken boolean kwarg
Everywhere else that `conf.get('ENABLE_*')` is used as a boolean key for
something (for example in if statements) it always checks if == 1, but
in this one case it neglects to do so. This is important because
conf.get yields the same int that was stored, but if statements require
booleans.

So does executable's "install" kwarg, at least according to the
documentation. In actuality, it accepts all types without sanity
checking, then uses python "if bool(var)", so you can actually do
`install: 'do not'` and that's treated identical to `true`. This is a
type-checking bug which Meson will eventually fix.

muon fails on the same code, today.

(cherry picked from commit 9e4a50bcdf7a275766e4f5c7af012c32bc22128d)
(cherry picked from commit 3a382bf86bd2da98cdb9094165e4da0aaee68c9c)
2022-11-04 13:02:20 +01:00
Cristian Rodríguez
97c82a3abb gcrypt: prefer the OS RNG
by default, gcrypt defaults to an userspace RNG, this is
the wrong thing (tm) to do on linux.

Switch to the SYSTEM rng instead.

(cherry picked from commit 80f967311ac53ae43b5a26332f32cc6665661338)
(cherry picked from commit ca0ed3a78cc2414706a59384d50b9048e1f00357)
2022-11-04 13:02:20 +01:00
Fei Li
427995b49b virt: detect KubeVirt instance
Kubevirt is currently technically based on KVM (but not xen yet[1]).
The systemd-detect-virt command, used to differentiate the current
virtualization environment, works fine on x86 relying on CPUID, while
fails to get the correct value (none instead of kvm) on aarch64.

Let's fix this by adding a new 'vendor[KubeVirt] = kvm' classification
considering the sys_vendor is always KubeVirt.

[1] https://groups.google.com/g/kubevirt-dev/c/C6cUgzTOsVg

Signed-off-by: Fei Li <lifei.shirley@bytedance.com>
(cherry picked from commit c15d1ac2c4e8ce46c6d07621f7d5531cbc2160a8)
(cherry picked from commit e7d635f0b92dcd205802b459e25843de461022fe)
2022-11-04 13:02:20 +01:00
w30023233
62ea1502e0 virt: detect OpenStack Nova instance
(cherry picked from commit 01d9fbccddd694bc584aed24eaa0543f831dc929)
2022-11-04 13:02:19 +01:00
Vishal Chillara Srinivas
fb48f600cf RFC 6762 section 7.1: a Multicast DNS querier SHOULD NOT include records in the
Known-Answer list whose remaining TTL is less than half of their original TTL

(cherry picked from commit f941c124273ac1b3bce0029f69f9664ba6f01f7f)
(cherry picked from commit ef6c37908904f27e1322a03b1859c66ead4b629d)
2022-11-04 13:02:19 +01:00
Yu Watanabe
d935dd7e9d resolve: do not trigger assertions on invalid query
(cherry picked from commit 055acd4d8b385fd9ff29e49e0c46856a9e705433)
(cherry picked from commit b61a61ec53bb07550d71b5e8611e06ebc0b41755)
2022-11-04 13:02:19 +01:00
Yu Watanabe
30d24c8df6 resolve: mdns_packet_extract_matching_rrs() may return 0
Fixes the following assertion:
---
Assertion 'r > 0' failed at src/resolve/resolved-mdns.c:180, function mdns_do_tiebreak(). Aborting.
---

(cherry picked from commit f2605af1f2e770818bbc6bad2561acdbd25a38ad)
(cherry picked from commit 0070302b3cdc1350bf7bfd5d032dbea420f4ed40)
2022-11-04 13:02:19 +01:00
Yu Watanabe
23d0a99497 resolve: fix misuse of accuracy parameter in sd_event_add_time()
Also, this makes mDNS regular queries sent without delay (except for
one caused by the default accuracy of sd-event).

Note, RFC 6762 Section 5.2 is about continuous mDNS query, which is not
implemented yet.

(cherry picked from commit 765647ba805727e93ac8607e38c7b60da2aab2dd)
(cherry picked from commit 41810cb16653058c529d123412ed78064406b34e)
2022-11-04 13:02:19 +01:00
Yu Watanabe
324bacfe9a resolve: drop unnecessary else, and add short comment
(cherry picked from commit 4b2ceb8a48c3aeef4147e335b5f31bc2ed4aa6fb)
(cherry picked from commit a1edebfde068a07179817259db270763067ebcd3)
2022-11-04 13:02:19 +01:00
Yu Watanabe
dc3faeed05 resolve: mdns: fix use-after-free
Fixes #23843 and #23873.

(cherry picked from commit d50a58e7252b763043485aa79a61094bfae9d7ff)
(cherry picked from commit e832a277ead1b1a4ec0d4757d24c44dfee8889e2)
2022-11-04 13:02:19 +01:00
Luca Boccassi
74c33f69bb portable: set PrivateTmp=yes in trusted profile too
When running on images you don't want to modify the /tmp
directory even if it's writable, and often it will just
be read-only. Set PrivateTmp=yes.

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

(cherry picked from commit f2d26cd89b195e53f184387f1a5b97a98512c82a)
(cherry picked from commit 6e111d2811b12e67879e66fc9fdf39cc96977681)
2022-11-04 13:02:19 +01:00
Yu Watanabe
40cdad3506 core/mount: downgrade log level about several mkdir failures
(cherry picked from commit 574febda6b0e00aae164b18b70aa80744d950500)
(cherry picked from commit 9f8b7ee55a38ac94fe88e396772efeda8a020693)
2022-11-04 13:02:19 +01:00
Yu Watanabe
f26f995108 Revert "core/mount: fail early if directory cannot be created"
This reverts commit e4de58c8231e47509ffeb3aa47620ca42f22d7f6.

If mkdir() fails and the path does exist, then the later mount
command fails anyway. Hence, it is not necessary to fail here.

Fixes #24120.

(cherry picked from commit e5e6b7c225987551ebda14d2d7feadb66a64fb3c)
(cherry picked from commit b1e494d64ded9b1f4927d41d0165420bf1def996)
2022-11-04 13:02:19 +01:00
Yu Watanabe
f0f5e74b2b home: drop conflicted headers
Fixes #24117.

(cherry picked from commit 0a58cd00454cc7b57b04f3a4a334584d743d7f7a)
(cherry picked from commit 739d7130cb7cfc67e79bd2dbf13856b6a2fc666d)
2022-11-04 13:02:19 +01:00
Yu Watanabe
ed66376b05 homed: fix dbus node enumerator
Fixes #24114.

(cherry picked from commit 52023622d2f8312887fcf72ca29bab4ad42c8eb7)
(cherry picked from commit 834632a4775e72d361a493979fd038f48163f65c)
2022-11-04 13:02:19 +01:00
Lennart Poettering
81bc16ab7c localed: don't fail if we cannot copy an xattr
We ignore xattr copy failures on all other cases, and we should do so
here too.

Fixes: #24106
(cherry picked from commit d3efe29452aeddc395865469b776fe7a1eb45eae)
(cherry picked from commit 200cbc299bddd6f0c896167be8a8be6475d76f20)
2022-11-04 13:02:19 +01:00
Yu Watanabe
8ead3d8e07 udev: downgrade error level and mention that the error is ignored
(cherry picked from commit 6e40ed53257604f81b14ddefadf5a782dc8ad279)
(cherry picked from commit a9dd0f6fc962e9cf00bfd98b056928fc956f78b7)
2022-11-04 13:02:19 +01:00
Rudi Heitbaum
998b08ec5f glibc: Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
(cherry picked from commit 3657d3a01c7e25ff86d7a4642065b367c4ff7484)
(cherry picked from commit 8fe0c121787efe16c2a7a0f27a3d9862d0a12c81)
2022-11-04 13:02:19 +01:00
Yu Watanabe
0e7214c8b5 unit-file: avoid (null) in debugging logs
The variable `inst` was set to NULL by TAKE_PTR().

This fixes the following log message:
```
systemd[1]: Unit getty@tty2.service has alias (null).
```

(cherry picked from commit 7c35b78a0b96085e3d634542212c5521bc2a2f21)
(cherry picked from commit 9ac0ad80fe97c22ec3dc4670e859abaae9a1f8bf)
2022-11-04 13:02:19 +01:00
Zbigniew Jędrzejewski-Szmek
aa97e014fa manager: limit access to private dbus socket
For the system manager, /run/systemd/private is publicly accessible, because
/run/systemd is 0755, and /run/systemd/private is 0777. For the user manager,
/run/user/<uid> is 0700, and /run/user/<uid>/systemd/private is 0777. This
does not directly cause any security issue because we check the sender in
bus_check_peercred (ucred.uid != 0 && ucred.uid != geteuid()).

But it makes sense to limit access to the socket to avoid wasting time in PID1.
Somebody could send messages there that'd we'd reject anyway. It also makes
things more explicit.

(cherry picked from commit df1cbd1adf26071aab41d96e054452a3d66103a4)
(cherry picked from commit dc3333bcc992003607582e4a05ca8699ee9317aa)
2022-11-04 13:02:19 +01:00
Richard Huang
44725ecccd Update sleep.conf HibernateDelaySec default to match implementation
(cherry picked from commit 5f2b4f9cb9555f3beb582e95624418a8277128e9)
(cherry picked from commit 9f3ed4f5ccccd1ab36e099b548a71c5518cd28ba)
2022-11-04 13:02:19 +01:00
David Tardon
1dbe819311 systemctl: include upheld units in dependencies
Fixes: #22706
(cherry picked from commit cbc2593eeaf35a42881319d7fa50b12fc5584bf9)
(cherry picked from commit 8e466d902d56b7a815abc81536a71b92690d8c51)
2022-11-04 13:02:19 +01:00
Vito Caputo
919b10b361 man: fix grammatical error in --cursor-file description
Just a minor cleanup to fix unparseable wording

(cherry picked from commit 729d2df8065ac90ac606e1fff91dc2d588b2795d)
(cherry picked from commit 110d49d15138ff6de17c7d964cd20ac124697c3e)
2022-11-04 13:02:19 +01:00
Frantisek Sumsal
32848f4559 core: drop a stray %m specifier from a warning message
since in this specific case (r == 0) `errno` is irrelevant and most likely
set to zero, leading up to a confusing message:

```
[  120.595085] H systemd[1]: session-5.scope: No PIDs left to attach to the scope's control group, refusing: Success
[  120.595144] H systemd[1]: session-5.scope: Failed with result 'resources'.
```

(cherry picked from commit e99b9285cb289115a64d775c768e6e831e39f12e)
(cherry picked from commit 5c822e33c90bd7f15c44e7375fd0c83ccec54918)
2022-11-04 13:02:19 +01:00
Zbigniew Jędrzejewski-Szmek
c4c647fdb9 man: fix formatting of "BARRIER=1"
Whitespace inside of the <varname> field was propagated to the displayed form,
causing strange indentation.

(cherry picked from commit 9cfc294fe0e2637d96f8e5c29143c10e2173daa3)
(cherry picked from commit b7c5530a1f6874650628cc4771cb99ae353c2495)
2022-11-04 13:02:19 +01:00
lastkrick
c93fb9a57e man: fix typo in systemd.network documentation in IPv6RoutePrefix section (#24030)
(cherry picked from commit 69a7d108327fa5d4b4e8e913441e924b2187cd78)
(cherry picked from commit 7632ff4cccb03893800d36bbf1966f8c20829c9f)
2022-11-04 13:02:19 +01:00
Łukasz Stelmach
217b3e012b core: drop ambient capabilities in user manager
Ambient capabilities should not be passed implicitly to user
services. Dropping them does not affect the permitted and effective sets
which are important for the manager itself to operate.

(cherry picked from commit 963b6b906e5666876f5c90b47600b13ae94d5e4c)
(cherry picked from commit c88309d5cd69d9997cfb74a77e340783a7ac63a9)
2022-11-04 13:02:19 +01:00
Lennart Poettering
d8464304f0 cgroups-agent: connect stdin/stdout/stderr to /dev/null
Inspired by https://github.com/systemd/systemd/pull/24024 this is
another user mode helper, where this might be an issue. hence let's
rather be safe than sorry, and also connect stdin/stdout/stderr
explicitly with /dev/null.

(cherry picked from commit 50492ce81589773df2d82b4fc8047778e86c6edf)
(cherry picked from commit 689487785f776815e71642f89685ff01f0bc4fde)
2022-11-04 13:02:19 +01:00
Daan De Meyer
3e1224d4ac coredump: Connect stdout/stderr to /dev/null before doing anything
When invoked as the coredump handler by the kernel, systemd-coredump's
stdout and stderr streams are closed. This is dangerous as this means
the fd's can get reallocated, leading to hard to debug errors such as
log messages ending up being appended to a compressed coredump file.

To avoid such issues in the future, let's bind stdout/stderr to
/dev/null so the file descriptors can't get used for anything else.

(cherry picked from commit 1f9d2a8199c261593aa6a11df9cce5d31e23c714)
(cherry picked from commit fba50bc0fc5a69e5573ceadb5d6224f365d3c3f5)
2022-11-04 13:02:19 +01:00
Lennart Poettering
7e7a6d60f4 man: explain why various resource limits don't make sense and should not be used.
(cherry picked from commit 8c8889577238749007c9bc129635af7c608723df)
(cherry picked from commit 724d52146abcdc02187d7cc2a12aec5e56300a9b)
2022-11-04 13:02:19 +01:00
Lennart Poettering
e655a7ac7b man: drop misplaced ','
(cherry picked from commit 3840b147818882a0d8e3ad5427c464796bb713f5)
(cherry picked from commit 83203873ee90e943966b36e5d6b4506d2526fa46)
2022-11-04 13:02:19 +01:00
Andre Kalb
a791dc67f8 man/network: ServerAddress= drop "literal" from IP address ranges
(cherry picked from commit 1df6201882607666daec13d7f7c056e8366ef5aa)
(cherry picked from commit 098d70f438661fee40dba45d8f00f2b6415e0d15)
2022-11-04 13:02:18 +01:00
Lennart Poettering
296bd564cc base-filesystem: pick more conservative access mode for /root/
Let's not allow anyone to look into /root/ if we create it via the
base-filesystem logic. i.e. change 0755 → 0750 as default access mode
for /root/, in case we create it if it happens to be missing.

(cherry picked from commit 93cbc9ca12043a13a2a80087a00012e009216f13)
(cherry picked from commit 64be8d8a345424021d837e922679816595d4b9ee)
2022-11-04 13:02:18 +01:00
Lennart Poettering
8b674cf43f tmpfiles: check the directory we were supposed to create, not its parent
This current code checks the wrong directory. This was broken in
4c39d899ff00e90b7290e4985696f321d7f2726f which converted the previous
code incorrectly.

(cherry picked from commit 92631578fff1568fa8e99f96de05baae5b258ffe)
(cherry picked from commit 625472b219a4b1ac64534d38cf6e64b51ab22bbb)
2022-11-04 13:02:18 +01:00
Lennart Poettering
a77b81f124 stat-util: replace is_dir() + is_dir_fd() by single is_dir_full() call
This new call can execute both of the old operations, but also do
generic fstatat() like behaviour.

(cherry picked from commit a586dc791ca465f4087473d2ad6794b7776aee2d)
(cherry picked from commit 9255fa3a15c5c7dea9ddb2ce5399d3b675f8368b)
2022-11-04 13:02:18 +01:00
undef
71e8f6de62 growfs: Expand FS even if underlying block expansion fails
This allows growfs to expand the filesystem even when the underlying
block device cannot be expanded. This has been useful for example on
LUKS devices that have already been expanded using systemd-repart.

This works around the following error:
```
root@mobian:/home/mobian# /usr/lib/systemd/systemd-growfs /
crypt_resize() of /dev/block/179:2 failed: Operation not permitted
```

(cherry picked from commit e9a28b8ccd3352da3e0a75a18fc1185e52476a80)
(cherry picked from commit 378e187ed49d28fed2adfb4848f89aa438854f28)
2022-11-04 13:02:18 +01:00
undef
e39019fd10 growfs: don't actually resize on dry-run
This causes systemd-growfs to exit before resizing the partition when
`--dry-run` is passed. Resizing during a dry run of a change breaks the
users expectations.

(cherry picked from commit d26c0f7243a709cfa7b8bdc87e8131746bb0e2d0)
(cherry picked from commit 00c6c62845c560ef09f845aeedabdc9027be5678)
2022-11-04 13:02:18 +01:00
Yu Watanabe
a6aa5b2f72 sd-bus: do not pass NULL when received message with invalid type
Fixes #24003.

(cherry picked from commit 3f0dbb0f0c4e3c0013fa5fe54441ca7f969555a7)
(cherry picked from commit e56bfc8a417d1877c25b943b75cd73163246fbf2)
2022-11-04 13:02:18 +01:00
Zbigniew Jędrzejewski-Szmek
ca6ee4241a man: lift pam_systemd_homed description to Summary
Also change the title to describe the module more comprehensively.
Follow-up for 90bc309aa2c1430941f4c50f73e681ab3e488bd3. Suggested
in https://bugzilla.redhat.com/show_bug.cgi?id=2085485#c5.

(cherry picked from commit 9e6df034128936895df2d6348eefce61317ebcc2)
(cherry picked from commit a4af8592c66900734d2561b2f6809baaefdbcce8)
2022-11-04 13:02:18 +01:00