Commit Graph
66847 Commits
Author SHA1 Message Date
Daan De Meyer 3a78b0e9c4 execute: Chown credentials files and directories to service group
For a userns root user to be able to access the credentials, both
the uid and gid of the credentials directory have to be mapped into
the userns. Currently, the credentials directory group is root, which
we obviously do not want to map in to a userns, so let's make sure
that the credentials directory and files are owned by the service
group instead, which can generally be safely mapped into the userns.

Since we use permissions mode 0600, this shouldn't cause any change
in who is able to access the credentials.

Fixes #28747
2023-08-10 14:36:26 +02:00
Daan De Meyer 4152fd46bb Merge pull request #28756 from DaanDeMeyer/repart-fix
repart --copy-from followups
2023-08-10 14:36:02 +02:00
Yu Watanabe 8aa0aa40cf udev-builtin-net_id: use strjoin() if possible
Addresses the post-merge comment
https://github.com/systemd/systemd/pull/28623#pullrequestreview-1571307466.
2023-08-10 20:13:43 +09:00
Yu Watanabe f5f1e766ba udev-builtin-net_id: add more debugging logs 2023-08-10 20:09:11 +09:00
Yu Watanabe ce8ff47f74 udev-builtin-net_id: introduce get_first_syspath_component() helper function
Obtaining a component from syspath is a common pattern. Let's split out
the pattern. No functional change, just refactoring.
2023-08-10 20:09:11 +09:00
Yu Watanabe 5dc06b376f udev-builtin-net_id: introduce get_matching_parent() helper function
The pattern is common in many naming scheme. Let's split out the
pattern. No functional change, just refactoring.
2023-08-10 20:09:06 +09:00
Lennart Poettering d67a0999aa coredump: let's use FOREACH_ARRAY() at once very obvious place 2023-08-10 12:13:46 +02:00
Lennart Poettering 946dc7c635 coredump: fix error path
We must go through finish, to undo the destruction of the final elements
of the iovw properly.
2023-08-10 12:13:09 +02:00
Lennart Poettering db9ac80163 coredump: rename gather_pid_metadata() → gather_pid_metadata_from_procfs()
Let's make clear what this function does, and what it distinguishes with
the more precisely named gather_pid_metadata_from_argv().
2023-08-10 12:11:55 +02:00
Lennart Poettering e6aa443feb coredump: add four assert()s 2023-08-10 12:11:33 +02:00
Lennart Poettering 6257e2fb1a coredump: use a cleanup handler for destroying iovw objects 2023-08-10 12:10:47 +02:00
Lennart Poettering 85ec1b6efa coredump: explicitly document that in order to process a coredump we have to write it to disk first
Prompted by: #28740
2023-08-10 12:09:15 +02:00
Frantisek Sumsal 8b1932cf2d tools: pylint dbus_exporter.py 2023-08-10 11:08:17 +02:00
Frantisek Sumsal f56accb6ef tools: pylint check-includes.py 2023-08-10 11:08:17 +02:00
Frantisek Sumsal b4048aaa1e tools: pylint catalog-report.py 2023-08-10 11:08:17 +02:00
Frantisek Sumsal e7ecc24eda tools: pylint analyze-dump-sort.py 2023-08-10 11:08:17 +02:00
Daan De Meyer 39b4649fc1 repart: Reword --copy-from docs 2023-08-10 10:46:14 +02:00
Daan De Meyer c74d50ffdd repart: Pass GptPartitionType * 2023-08-10 10:32:35 +02:00
Lennart Poettering 9b5560f39c main: drop redundant () 2023-08-10 10:14:33 +02:00
Lennart Poettering f24e1b54e1 update TODO 2023-08-10 10:07:00 +02:00
Lennart Poettering a74c99807f Merge pull request #28736 from poettering/polkit-tweaks
some minor polkit handling tweaks
2023-08-10 09:35:52 +02:00
Yu Watanabe 7e1850e54b Merge pull request #28732 from yuwata/udev-vs-tmpfiles-take-2
Udev vs tmpfiles take 2
2023-08-10 08:48:51 +09:00
Yu Watanabe b8e483aa2c Merge pull request #28741 from keszybz/minor-tweaks-for-recent-patches
Minor tweaks for recent patches
2023-08-10 08:45:44 +09:00
Yu Watanabe 7a05926fbe udev: re-introduce symlinks for loopback block device
But the directories are changed from /dev/loop/by-ref/ -> /dev/disk/by-loop-ref/
and /dev/loop/by-inode/ -> /dev/disk/by-loop-inode/.
As /dev/loop/ is used by losetup command for other purpose.
See issue #28475.

This effectively reverts commits 9915cc6086,
5022fab15f, and
c0d998248e.
2023-08-10 07:05:47 +09:00
Yu Watanabe c27d9c0ac1 udev-builtin-net_id: fix potential invalid memory access
Follow-up for 28141620d9.

Addresses post-merge review in #28269.
2023-08-10 05:13:17 +09:00
Luca Boccassi 4051fc1d54 Merge pull request #28734 from loongarch64/dev-wu-main
seccomp: add LoongArch 64bit support
2023-08-09 20:20:03 +01:00
Daan De Meyer 1f035c91bb mkosi: Update to latest
This update introduces the explicit Dependencies= setting, instead
of relying on implicit dependencies via alphanumerical ordering.

We also take the opportunity to rename the "final" preset to the
"system" preset, which seems like a better name.
2023-08-09 18:56:51 +02:00
Lennart Poettering d1e8e8b5ae tree-wide: drop _pure_ + _const_ from local, static functions
This is supposed to be a help for compilers to apply optimizations on
functions where they can't determine whether they are const/pure on
their own. For static, local functions the compiler can do this on its
own easily however, hence the decoration with pure/const is just noise.
Let's drop it, and let the compiler to its thing better.

(Use it for exported functions, since compilers can't 'reach-over' into
other modules to determine if they are pure, except if LTO is used)
2023-08-10 00:01:04 +08:00
Mike Yuan 07ba0bf7f5 Merge pull request #28728 from yuwata/fstab-no
gpt-auto, remount-fs: parse fstab= kernel command line option
2023-08-09 23:59:51 +08:00
Lennart Poettering d2a1673713 sysusers: move global variables into a Context object
Our coding style says static variables suck except for very special
cases, i.e. things like the log level or very per-process stuff, such as
parsed version of cmdline args and such. sysusers departed from that as
one of the very few exceptions in our codebases: it keeps its
operational state in global variables.

Address that. Introduce a Context object that carries the fields that so
far have been global, and pass it around as needed.

This has the nice effect that state and configuration is clearly
separated in code, and we can very clearly see which functions mangle
state and which ones do not.

No actual codeflow changes, just refactoring.
2023-08-09 17:34:00 +02:00
Lennart Poettering 7a23cc4b66 Merge pull request #28720 from poettering/vconsole-setup-tweaks
vconsole-setup: trivial modernizations
2023-08-09 17:32:12 +02:00
Xiaotian Wu f106a63952 LoongArch: Replace __loongarch64 with __loongarch_lp64
`__loongarch64` is no longer used for historical reasons and should be replaced by `__loongarch_lp64` in new code.

https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html#_cc_preprocessor_built_in_macro_definitions
2023-08-09 20:44:57 +08:00
Lennart Poettering 0de0ed6e89 bootctl: don't advertise systemd-efi-options in --help/man anymore
The command is deprecated, as per NEWS of 254. Let's go one step further
and remove it from the help text and man page, so that people are not
inspired to use it at this time anymore.

This is how we usually have done this before: remove it from visibility,
but support it for a while still.
2023-08-09 14:25:46 +02:00
Zbigniew Jędrzejewski-Szmek 288cc26803 60-ukify.install: fix whitespace 2023-08-09 13:56:07 +02:00
Zbigniew Jędrzejewski-Szmek 4d8c16b166 test: use pytest.raises wrapper
This way we check that the appropriate exception is raised,
not just ignore it.

Follow-up for e3c04a5c84.
2023-08-09 13:56:07 +02:00
Lennart Poettering c1b2e1a89a polkit: move asserts up, so that they cover all reply codepaths 2023-08-09 11:02:51 +02:00
Lennart Poettering 0a901c71f5 polkit: use LIST_POP where appropriate 2023-08-09 11:02:51 +02:00
Yu Watanabe a38de31c8b remount-fs: refuse to remount based on fstab when fstab=no kernel command line option specified
Otherwise, if for some reasons remount-fs is invoked even when fstab=no is
specified, mounts may get unexpected options from fstab.

For safety, let's parse the kernel command line option.
2023-08-09 17:59:41 +09:00
Yu Watanabe 1be6f21320 remount-fs: split-out remount_by_fstab()
No functional change, just refactoring and preparation for later
commits.
2023-08-09 17:59:41 +09:00
Yu Watanabe b564224b37 fstab-generator: update cache in fstab_enabled_full() based on the parsed result of fstab=
Currently, fstab-generator does not use fstab file parsers in
fstab-util.c. So, this is not necessary. Just for a possible
optimization in the case the parsers used in the future.
2023-08-09 17:57:43 +09:00
Yu Watanabe 1177373b6a fstab-util: introduce fstab_enabled() helper function
And refuse to parse fstab when 'fstab=no' is specified in the kernel
command line.

When 'fstab=no' is specified in the kernel command line, fstab-generator
does not parse fstab and will not create e.g. /boot or /efi mount entry
even if fstab contains entries for the mount points. However, gpt-auto
generator may parse fstab file, and adjust or ignore mounts for EFI or
XBOOTLDR partitions based on the fstab file.

This makes gpt-auto also ignore fstab entries if 'fstab=no' is set in
the kernel command line.
2023-08-09 17:53:46 +09:00
Yu Watanabe 3787934b54 proc-cmdline: make proc_cmdline_get_bool() take flags
All other command line parsers takes flags. Let's make
proc_cmdline_get_bool() also take flags. Though, currently,
no flag is set by the caller.
2023-08-09 17:46:41 +09:00
Lennart Poettering 6433f1f6a2 vconsole-setup: simplify error handling
no need to negate an error which we don't need negated.

also, add debug log about errors we ignore.
2023-08-09 10:31:31 +02:00
Lennart Poettering 7b218ef930 vconsole-setup: simplify path allocation
Let's code this straighforwadly, and just allocate the string as we need
it, instead of doing pre-allocation.

This is not performance sensitive, as this will almost certainly just
return /dev/tty1 after the first transition.
2023-08-09 10:31:31 +02:00
Lennart Poettering bc6059844d vconsole-setup: use FOREACH_ARRAY() at one more place 2023-08-09 10:31:31 +02:00
Lennart Poettering 7686f3f16c vconsole-setup: port to main-func.h boilerplate 2023-08-09 10:31:31 +02:00
Yu Watanabe 3178698bb5 test: also check the ordering between udevd and tmpfiles-setup 2023-08-09 15:52:42 +09:00
Yu Watanabe ca15b59f1f Revert "Revert "tmpfiles.d: adjust /dev/vfio/vfio access mode""
This reverts commit 33b91308c2.

The commit b42482af90 dropped
'--exclude-prefix=/dev' from systemd-tmpfiles-setup.service. So, the
possibly later invocation of the service changes the permission set by
udevd.

As commmented in the head of this file, settings should be consistent
with udev rules. Only missing entry here is vfio. Let's re-add the
entry for the device.

Addresses https://github.com/systemd/systemd/pull/28681#issuecomment-1666949888.
2023-08-09 11:27:39 +09:00
Yu Watanabe 685e0dd192 veritysetup-generator: fix ordering of generated units
Fixes a bug introduced by 08b04ec7e7 and
953006dcb0.

Fixes #28725.
2023-08-09 11:26:09 +09:00
Yu Watanabe 20e7b94b72 Merge pull request #28731 from yuwata/sd-dhcp-server-cleanups
sd-dhcp-server: cleanups
2023-08-09 11:25:44 +09:00