1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
Commit Graph

63732 Commits

Author SHA1 Message Date
Yu Watanabe
2c5f119c3c sd-device,udev: refuse invalid devlink and store in normalized form
This is especially for the case that the path contains "..".
Prompted by https://github.com/systemd/systemd/pull/27164#issuecomment-1498863858.

This also makes SYMLINK= gracefully handle paths prefixed with "/dev/",
and manage devlink paths with path_hash_ops.
2023-04-08 03:38:19 +09:00
Yu Watanabe
733b7bfd79 udev-rules: replace ingrowing word extractor with extract_first_word()
No functional change, just refactoring.
2023-04-08 03:38:19 +09:00
Yu Watanabe
f17af9c927 udev-rules: rename variable "filename" -> "path" 2023-04-08 03:38:19 +09:00
Yu Watanabe
03ff9c70ce udev-rules: add/update comments 2023-04-08 03:38:19 +09:00
Yu Watanabe
29162ba05c udev-rules: add missing paren 2023-04-08 03:38:19 +09:00
Olivier Gayot
b24b10592d 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.
2023-04-08 00:08:43 +08:00
Uwe Kleine-König
381ccb4246 man/systemd-mount: Clearify documentation about --bind-device
The documentation suggests that the mount point (i.e. the directory
where the device is mounted) is removed when the device vanishes.
However only stopping of the automount unit is implemented.

So adapt the documentation to reality.
2023-04-07 16:33:46 +02:00
Daan De Meyer
3267fc3885 mkosi: Update to latest
This contains the recently merged fixes to config parsing ordering
and overrides.
2023-04-07 21:56:22 +09:00
b84b9f0414 hwdb: Add support for "Passion Model P612F"
Add hwdb sensor entry for device Passion with accelerometer "MXC6655".
2023-04-07 21:55:25 +09:00
Zbigniew Jędrzejewski-Szmek
ddd43f31e3
Merge pull request #26887 from yuwata/proc-cmdline-filter-arguments
proc-cmdline: filter PID1 arguments on container
2023-04-07 10:55:30 +02:00
Zbigniew Jędrzejewski-Szmek
9c1d3d6fa7
Merge pull request #27161 from pothos/sysext-refresh
systemd-sysext/confext.service: Refresh on start/reload
2023-04-07 10:40:18 +02:00
Daan De Meyer
05f7052732 bootctl: Gracefully handle missing bootloader directory
When --graceful is specified, let's gracefully deal with a missing
bootloader directory.
2023-04-07 10:34:34 +02:00
Ludwig Nussel
4bc14b1790 bootctl: show report state and type in json output 2023-04-07 10:22:37 +02:00
Cristian Rodríguez
e144a26306
resolve: change DNS_PACKET_UNICAST_SIZE_LARGE_MAX to 1232 (#27171)
The old common default was 4096, until 2020 on which all DNS servers (verified
on BIND9, NSD, Unbound, dnsmasq) switched to 1232 as an agreed max size [1].

[1] https://www.dnsflagday.net/2020/#message-size-considerations
2023-04-07 09:52:52 +02:00
Zbigniew Jędrzejewski-Szmek
1e094cb4ba
Merge pull request #27126 from yuwata/journal-compress
sd-journal: allow to specify compression algorithm through env
2023-04-07 09:28:27 +02:00
Sorah Fukumori
744b04c557 man: netdev: Clarify wireguard IPv6 endpoint format 2023-04-07 08:15:34 +09:00
Daan De Meyer
af6c5c7025 mkosi: Update to latest
This also migrates the configuration to the new format that was
just merged in mkosi. Specifically, we make use of the new [Match]
sections to only include specific config snippets per distro.
2023-04-07 08:13:42 +09:00
Yu Watanabe
0864b5eb6e
Merge pull request #27158 from mrc0mmand/more-tests
test: introduce TEST-81-GENERATORS
2023-04-07 07:53:37 +09:00
Frantisek Sumsal
61961e693d test: check if we skip the full setup on daemon-reexec
A simple test case for issue #27106.

Resolves: #27139
2023-04-07 07:53:14 +09:00
Yu Watanabe
d23a1c52a9 test: add test case that journal file is created with the requested compression algorithm 2023-04-07 02:30:43 +09:00
Kai Lueke
721412ac98 systemd-sysext/confext.service: Refresh on start/reload
When adding a sysext image to the system and manuall merging it, a
later "systemctl (re)start systemd-sysext" won't work because "merge"
refuses to work when something is merged already. Another problem with
"merge" at start plus "unmerge" at stop is that a service restart can't
make use of the new MOVE_MOUNT_BENEATH in the future even which would
only be available in "refresh". It also prepares us for setting up the
merged overlay for the sysroot from the initrd already, which also
would lead to the mentioned start problem of the service (One
optimization could be to skip the loading but only if we are sure that
all images were loaded and weren't modified since - this assumption is
hard because early services could want to inject a sysext, too).

Use "refresh" on service start to fix the problem that the service
can't start as soon as a manual merge was done. Also add a reload
action that allows to issue "systemctl reload systemd-sysext" and it
will make use of MOVE_MOUNT_BENEATH once we implement this in
systemd-sysext refresh (and it's available from the kernel).
2023-04-06 20:47:26 +09:00
Kai Lueke
1e07c6f31d man/systemd-dissect.xml: Remove old sysext path, add confext path
The /usr/lib/extensions/ location for systemd-sysext images is not
supported anymore. In https://github.com/systemd/systemd/pull/26013
systemd-confext images got introduced and we can list its path under
/usr instead.
2023-04-06 20:46:43 +09:00
Frantisek Sumsal
17c9dbc98b test: introduce TEST-81-GENERATORS
Add some explicit tests for various generators we ship, e.g.:
    - systemd-debug-generator
    - systemd-environment-d-generator
    - systemd-fstab-generator
2023-04-06 13:16:40 +02:00
Luca Boccassi
d7805ff711
Merge pull request #26013 from goenkam/maanya/syscfg-feature
confext: extension of sysext
2023-04-06 10:59:18 +01:00
Frantisek Sumsal
9948a169c0 test: add a couple of tests for systemd-modules-load 2023-04-06 10:26:47 +02:00
Frantisek Sumsal
006a60e079 fstab-generator: don't propagate ignored errno
With certain fstabs we may propagate ENXIO from the $SYSTEMD_SYSFS_CHECK
check all the way up, making fstab-generator exit with a non-zero EC and
without any helpful message, which is really confusing.
2023-04-06 10:26:47 +02:00
Daan De Meyer
b24bfd6ee4 repart: Add more logging 2023-04-06 09:45:46 +02:00
maanyagoenka
bbcc658e35 confext: shell completion for systemd-confext 2023-04-05 21:50:04 +00:00
maanyagoenka
1f4f166690 confext: documentation and man page updates for confext 2023-04-05 21:50:04 +00:00
maanyagoenka
f7700ea599 test-os-util: add tests for sysext and confext release files 2023-04-05 21:50:04 +00:00
maanyagoenka
c3c6a4f0a9 confext: add tests for systemd-confext 2023-04-05 21:50:04 +00:00
maanyagoenka
1f839f48e0 confext: add the systemd-confext.service file 2023-04-05 21:50:04 +00:00
maanyagoenka
4da1df42ac confext: add multi call functionality to sysext
The confext concept is an extension of the existing sysext concept and
allows to extend the host's filesystem or a unit's filesystem with signed
images that add new files to the /etc/ directory using OverlayFS.
2023-04-05 21:50:04 +00:00
maanyagoenka
30dfe035eb extension-release: establish compatibility between host file and extension-release file
The release file that accompanies the confext images needs to be
host compatible to be able to be merged into the host /etc/ directory.
This commit checks for version compatibility between the image file and
the host file.
2023-04-05 21:50:04 +00:00
maanyagoenka
b60e0f5777 os-util: add a new confext image type and the ability to parse their release files
Adds a new image type called IMAGE_CONFEXT which is similar to IMAGE_SYSEXT but works
for the /etc/ directory instead of /usr/ and /opt/. This commit also adds the ability to
parse the release file that is present with the confext image in /etc/confext-release.d/
directory.
2023-04-05 21:50:04 +00:00
Luca Boccassi
7393530f22
Merge pull request #27154 from DaanDeMeyer/kconfig
mkosi kernel build updates
2023-04-05 19:59:24 +01:00
Franck Bui
f9a23d428a test: use kbd-mode-map we ship in TEST-73-LOCALE
The rational is the same as the one described in commit
be0cc2ce6c.
2023-04-05 19:58:57 +01:00
Yu Watanabe
70650ae345 test: add tests for dir_fd_is_root_or_cwd()
Follow-up for e212f42279.
2023-04-05 19:38:08 +01:00
Daan De Meyer
85a319b65c mkosi: Update bundled kconfig
- Remove useless serial console configs
- Add CONFIG_SERIAL_8250_PCI so that qemu's virtconsole works properly
- Add CONFIG_DMI and CONFIG_DMI_SYSFS so that SMBIOS credentials work
- Add CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC so we can read the
  current kernel config from /proc/config.gz
- Add CONFIG_IOSCHED_BFQ to get rid of a udev error on boot on Fedora
- Add CONFIG_HW_RANDOM_VIRTIO to get hw rng in qemu
- Add CONFIG_SECURITY_YAMA to get rid of warning from sysctl on boot
- Add CONFIG_VSOCKETS and CONFIG_VIRTIO_VSOCKETS to enable vsock support
2023-04-05 17:19:24 +02:00
Daan De Meyer
74f2a3ae0d mkosi: Make sure we always boot our built from source kernel
If we build a kernel from source, let's make sure it's always booted
by giving it a very high version number.
2023-04-05 16:20:28 +02:00
Ronan Pigott
cad0fc7a13 resolve: refuse mdns scope for ipv4 broadcast addresses
This query can never be answered, so let's no wait for it to timeout.
2023-04-05 13:27:16 +02:00
Zbigniew Jędrzejewski-Szmek
effd05626d
Merge pull request #27143 from bluca/no_tpm
cryptsetup: fix build without TPM2
2023-04-05 11:24:18 +02:00
Daan De Meyer
89c8328fc9 Revert "mkosi: Drop python-docutils"
This reverts commit be266f49d6b7e3f021e2a07f937d39d1f14a283d.

Turns out we installed this because it's required by the bpf selftests
so let's keep it intact.
2023-04-05 11:00:52 +02:00
Lennart Poettering
aa7c4dd66e service: use newdup() where appropriate 2023-04-05 15:25:36 +09:00
Yu Watanabe
78ebf8bfb6
Merge pull request #27137 from yuwata/id128-get-machine
sd-id128: introduce id128_get_machine() and _at()
2023-04-05 15:24:45 +09:00
Zbigniew Jędrzejewski-Szmek
51214cf491 various: simplify calls to parse_boolean_argument()
parse_boolean_argument() returns the same information via both the output
argument and normal return.
2023-04-05 13:06:26 +08:00
Luca Boccassi
b7b48b389c ci: do one build with no tpm/p11kit/fido2
We have some missing coverage in the CI, all builds enable these features,
but there are often changes and they cover a lot of code. Do one build
without them to ensure we don't break builds.
2023-04-04 22:38:08 +01:00
Luca Boccassi
4255980887 cryptsetup: fix build without TPM2
Follow-up for acbb504eaf
2023-04-04 22:35:04 +01:00
William Roberts
96181b7a89 tpm2: fix nits from PR #26185
Fixes:
  - Comment style
  - Alignment style
  - cleanup macro usage
  - incorrect error message[1]

1. Thanks to tempusfugit991@gmail.com for pointing out the error
message mistake.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
2023-04-04 20:41:11 +01:00
Thomas Blume
d6d0661631 test/test-functions: fix typo in install_suse_systemd() 2023-04-04 20:39:11 +01:00