1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-20 14:03:39 +03:00

55855 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
3ce09d9127 shared/udev-util: say "ignoring device", not "ignoring"
The short form sounds like we're ignoring the error.

(cherry picked from commit 406fbeca32d9abacdcc28b0cc00d2beefcc4feb2)
(cherry picked from commit 6d4c1385347e73fd68466f51eae33dad78a46125)
2022-11-04 13:02:20 +01:00
Zhaofeng Li
86e121dd7b virt: Support detection of Apple Virtualization.framework guests
(cherry picked from commit f5558306746c0791dab666e76d51e7ef1ce38362)
(cherry picked from commit cd2fad23008f1f339625904925e21ccf9147b50a)
2022-11-04 13:02:20 +01:00
Yu Watanabe
85ec3345fc virt: align tables
(cherry picked from commit 5c86cec1f3466b2f4ed169fd3f32e944a0bca06e)
(cherry picked from commit 6e47e75c86965e4f28ac94970116f86b99be8851)
2022-11-04 13:02:20 +01:00
David Jaša
7cb0c3bc99 check-os-release.py compatible with Python < 3.8
The ":=" operator was only added in Python 3.8 so splitting the line with it into two makes check-os-release.py actually fulfill its claim of working with any python version.

(cherry picked from commit ce0a056abc41168e1b45537505ca9f65bf6f5c30)
(cherry picked from commit 951e99231e539c11861d62ce9cfc5b186a3a3e6e)
2022-11-04 13:02:20 +01:00
Yu Watanabe
d59171e362 core/mount: adjust deserialized state based on /proc/self/mountinfo
Fixes #23796.
Replaces #23803 and #23851.

(cherry picked from commit 01400460ae16c6522d11d08dd9a4b0928e7980d9)
(cherry picked from commit d572a74163428e52982ee70844f8cc54c814a741)
2022-11-04 13:02:20 +01:00
Goffredo Baroncelli
eb53ee4a2f Allow uneven length BootXXXX variables
The BootXXXX variables may have an uneven length. Don't return error
in this case.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
(cherry picked from commit 046f101bf6ecbe2c18fd969760256ada3e6230f0)
(cherry picked from commit 2e372afc358f50408580323c56a44a7a6284cce0)
2022-11-04 13:02:20 +01:00
Yu Watanabe
5fe4b668cd gpt: fix native uuids for s390x
__s390__ is defined for both s390 and s390x. Hence, we need to define
the native uuids for s390x at first.

(cherry picked from commit 4565246911adbdd1b20d8944c0754772788a768c)
(cherry picked from commit 8ad143e684c57d8fd9801fad3c379253d2cec92f)
2022-11-04 13:02:20 +01:00
Antonio Alvarez Feijoo
683980d551 bash-completion: add systemd-sysext support
(cherry picked from commit aa2118cb0b5478c6b8a30f8c55507ee5d5854943)
(cherry picked from commit cf67d5ed1be38db5ea3f54551f4509ce315f7877)
2022-11-04 13:02:20 +01:00
Antonio Alvarez Feijoo
bff3edb1ca sysext: add missing COMMAND to the help output and man synopsis
(cherry picked from commit 782e41ab8891673575ec03366d17d5e5c1da7b0d)
(cherry picked from commit ada437cfb1e1d8feeecab9f6391561027d5987f1)
2022-11-04 13:02:20 +01:00
Zbigniew Jędrzejewski-Szmek
503ebc858f booctl: do not say uuids differ if one of the uuids is unset
We allow ESP autodetection to fail, e.g. if it is not mounted, but then we'd
say that the detected one is different than the one reported by the bootloader,
which is rather confusing.

While at it, if we actually detect a mismatch, print the two uuids.

(cherry picked from commit 22e54dd6de4d0be41ab70e0a94d7bd273e47c60a)
(cherry picked from commit 4ffde70981b2502cc5c13fffbfe77c72b59b460a)
2022-11-04 13:02:20 +01:00
Luca Boccassi
ef7b17be53 bash-completion: autocomplete cgroup names in systemd-cgtop
(cherry picked from commit 0a152619aca5b6c16d022cc3e6ab2fc3786d0284)
(cherry picked from commit 5219a99ccbaaf3b7a13bec74441443560b3f23fc)
2022-11-04 13:02:20 +01:00
Avram Lubkin
7ca021b87e sysusers: add fsync for passwd (#24324)
https://github.com/systemd/systemd/pull/6636 added `fsync()` when
temporary shadow, group, and gshadow files are created, but it was
not added for passwd. As far as I can tell, this seems to have been
an oversight. I'm seeing real world issues where a blank /etc/passwd
file is being created if a machine loses power early in the boot process.

(cherry picked from commit 19193b489841a7bcccda7122ac0849cf6efe59fd)
(cherry picked from commit 9f2f3911539c453037aecd51f875dfd75ed04113)
2022-11-04 13:02:20 +01:00
Yu Watanabe
c3fcff5291 udev/cdrom_id: check last track info
Fixes off-by-one issue.

Fixes #24306.

(cherry picked from commit 628998ecfa0d39b38874e1aecdb28022f80f3269)
(cherry picked from commit c67a388aeffcdc27ff280f01b7939005f7a9c8e9)
2022-11-04 13:02:20 +01:00
bin456789
da1589db45 firstboot: fix can't overwrite timezone
(cherry picked from commit e56dc320d39ade1795118ebe400308a80511e9c9)
(cherry picked from commit 52c631b02edcd32e4d20bc8c390df54e4cc40fa8)
2022-11-04 13:02:20 +01:00
Lennart Poettering
462b20cbd6 cryptenroll: fix memory leak
(cherry picked from commit 7e196e9aac41da206792d96a16b712dd300b0e82)
(cherry picked from commit f279a6f4d1feceaf32fdc790ae242044bb672a16)
2022-11-04 13:02:20 +01:00
Yu Watanabe
b48a17f13f sd-device-monitor: actually refuse to send invalid devices
Fixes an issue introduced by 9e79123884a36ce095b98d1c0fe247dddf02dbec.

(cherry picked from commit 8bb4989906a1659b0f6adfa03dc7585e294a392b)
(cherry picked from commit 6e1acfe81823b67b6b830d3ae8d0f0184eab8b2f)
2022-11-04 13:02:20 +01:00
Yu Watanabe
02a5c22ec1 sd-device-monitor: fix inversed condition
Fixes an issue introduced by b3d06b9226db96fddb6bb45a4708e2e8d413d91d.

(cherry picked from commit 133d78966fe8b1469e593bd467d9055f7afa5858)
(cherry picked from commit 81339c45e8d3372096599525397a632714da2dd5)
2022-11-04 13:02:20 +01:00
exploide
45e46fb4b2 resolvctl: only remove protocol after last dot when mangling ifname for resolvconf
ifname_resolvconf_mangle is supposed to remove protocol suffixes like .dhcp
from interface names. But this removed also valid parts of the ifname like
VLAN IDs, e.g. enp2s0u4.72.dhcp -> enp2s0u4 instead of enp2s0u4.72

After this change, everything behind the last dot is removed instead of the first.

(cherry picked from commit e8d0eb3915ac33cc0d3da87a836cee6e61645227)
(cherry picked from commit 1760559918c6299a31c4b28a4ce07e5d6322d986)
2022-11-04 13:02:20 +01:00
Yu Watanabe
2aeff0f39a oom: drop invalid %m in the log message
Fixes https://github.com/systemd/systemd/issues/23785#issuecomment-1210030100.

(cherry picked from commit b6f6df4cb07ebf736f0f4b60a845049306088797)
(cherry picked from commit a3348ba748e17d18e2bbf56776cdb1b331cd4525)
2022-11-04 13:02:20 +01:00
Jan Janssen
658013a7f7 meson: Test correct efi linker for supported args
Fixes: #24241
(cherry picked from commit 6a941db798e3c5d896f6732afb4e6e482d708900)
Closes https://github.com/systemd/systemd-stable/issues/216
(cherry picked from commit b3dd66f32beb1e2daea31c73ce4c3b4c4ad844fb)
2022-11-04 13:02:20 +01:00
Luca BRUNO
3733943f5a sysusers: properly process user entries with an explicit GID
This tweaks user creation logic to properly take into consideration
an explicitly requested GID.
It fixes a bug where the creation flow would mistakenly fall back
to use the username instead, resulting in wrong lookups in case of
users and groups using the same name.

(cherry picked from commit 5ed47c4d230b9491339c16c6ea4181dfd293bc98)
(cherry picked from commit f9d936b86561c23f5b40211254544b91e33eae7a)
2022-11-04 13:02:20 +01:00
Luca BRUNO
6ab318435e sysusers: only check whether the requested GID is available
This relaxes the availability check when creating a group, if an
explicit GID has been requested.
It avoids mixing up users and groups entries with valid and unique
UIDs/GIDs, but each having the same ID number.

(cherry picked from commit 6b6e45eb7386bb4399746b70f6f606caea450fed)
(cherry picked from commit ec5a46ca341f4f62779a54385ba7cae6a1dfcdb3)
2022-11-04 13:02:20 +01:00
Yu Watanabe
887837a5a9 dhcp: fix potential buffer overflow
Fixes a bug introduced by 324f818781a250b60f2fcfa74ff1c9101d2d1315.

This also renames several macros for DHCP packet size.

(cherry picked from commit 4473cd7f61b9eb0860f2daab81491ad2145d554b)
(cherry picked from commit 037b1a8acc50cbeeebb82f95594a4909375577c2)
2022-11-04 13:02:20 +01:00
Yu Watanabe
647c44c21a udev-util: assume system is running on AC power when no battery found
Fixes #24214.

(cherry picked from commit 96788d2aa4f4b0b49874b4a240ce47d9e8485d1b)
(cherry picked from commit ed2955f8fe194040c3b29fb58e6dc02d397d79d5)
2022-11-04 13:02:20 +01:00
undef
d1166a9060 shared/generator: Ensure growfs unit runs after repart
When deploying an image using systemd-repart and systemd-growfs one
should have the image expanded entirely and ready to use after the first
boot. This ensures that growfs does not occur before repart, thus
requiring a second boot.

(cherry picked from commit 7b45d6b6f64e9f5c006bdf31559a77294dbe00ad)
(cherry picked from commit 4fdca1ab9e90341d63113c7b3109daef08d1e04d)
2022-11-04 13:02:20 +01:00
Yu Watanabe
89a5b7752f network: dhcp4: disable DHCPv4 client on interfaces with non-supported types
Replaces f42d41cc5f9cd8cac538a1c30fda04d346b5bae2.

(cherry picked from commit 7e2f684e1fa391bd511b52bbbe4a3971cdc5ec33)
(cherry picked from commit 9951ea07d5a9a43b3a4c8225f1b79f446e62eebe)
2022-11-04 13:02:20 +01:00
Jan Janssen
b9216947a3 boot: Build with at least -O1 as workaround
Fixes: #24202
(cherry picked from commit 2fb11652381c199ad19bb469e530543366d99dd4)
(cherry picked from commit b0da0d61023ccc912e4d254b03d2350ec65ce87a)
2022-11-04 13:02:20 +01:00
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