Commit Graph
71422 Commits
Author SHA1 Message Date
Yu Watanabe 6a5134e83a Merge pull request #31555 from yuwata/sd-ndisc-trivial-cleanups
sd-ndisc: trivial cleanups
2024-03-01 12:18:19 +09:00
Yu Watanabe ccb1ace77f sd-ndisc: drop unused sd_ndisc_router_get_raw() 2024-03-01 09:44:58 +09:00
Yu Watanabe f169c56447 sd-ndisc: use _packed_ attribute 2024-03-01 09:44:58 +09:00
Luca Boccassi 7a2ba85aee Merge pull request #31551 from keszybz/rpm-macro-kernel-install
New rpm macro %_kernel_install_dir
2024-03-01 00:44:52 +00:00
Yu Watanabe bbb2a0fb41 icmp6-packet: check the alignment of struct nd_opt_hdr for safety
Addresses https://github.com/systemd/systemd/pull/31492#discussion_r1507481748.
2024-03-01 09:44:45 +09:00
Yu Watanabe 1e18e1aa11 Merge pull request #31492 from yuwata/icmp6-packet
sd-ndisc: introduce ICMP6Packet and relevant functions, and use them
2024-03-01 09:18:52 +09:00
Eli Schwartz 5656c593ce fix the value of default shells to use /bin and not /usr/bin
Partially reverts commit b0d3095fd6.

While it is generally worthwhile for systemd to drop split-usr support,
these options are NOT about split-usr support. The universal location of
POSIX sh is always /bin/sh. Bash is pretty reasonably standardized there
too.

This happens irrespective of /bin being a symlink to /usr/bin.
Ramifications of this change include things like:

- portably running shell scripts that might run very nearly anywhere
- /etc/shells support

For standardization and compatibility reasons, these commands with these
paths need to be consistently found on any system, and thus distros make
sure this works, although even on split-usr systems /usr/bin/bash may be
a symlink to /bin/bash.

Embedding the *access path* of bash as /usr/bin/bash in systemd, for
example in libnss_systemd.so, means that login shells must agree with
systemd on how they invoke the shell. End result: users fail to login
because of access violations.

This cannot be fixed by "fixing PAM" because PAM does not follow
symlinks by design: one example is that it needs to treat rbash as
different from bash.

Fixes: https://bugs.gentoo.org/919749
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-02-29 21:51:03 +01:00
Lennart Poettering d52320337e ssh-generator: don't do AF_VSOCK stuff if we run in a container
Tighten our VM check: whether we run in a VM is not enough to do
AF_VSOCK. We also need to check if we are run in a container, because if
we run in a container inside a VM then we should *not* do the AF_VSOCK
stuff, but leave the port free for the VM itself.

As discussed here:

https://github.com/systemd/systemd/pull/31544#issuecomment-1971455401
2024-02-29 20:43:12 +00:00
Zbigniew Jędrzejewski-Szmek 5248a0c5b3 rpm/macros: add %_kernel_install_dir
This makes it easier for people packaging kernel-install plugins
to get the path right.

E.g. https://src.fedoraproject.org/rpms/python-virt-firmware/pull-request/3
fixes an issue where %{_libdir}/kernel/install.d was used,
which gives incorrect results on 64-bit architectures.
%_kernel_install_dir will make this even easier.
2024-02-29 21:38:03 +01:00
Zbigniew Jędrzejewski-Szmek 1578622bfd rpm/macros: drop compat define with a typo
Search on sourcegraph.com doesn't yield any users. And each
use would emit a warning, so I think it's safe to assume that
it has no users.
2024-02-29 21:32:10 +01:00
Luca Boccassi d74d989c25 Merge pull request #31544 from mrc0mmand/more-test-tweaks
A couple of fixlets for TEST-46-HOMED's ssh tests
2024-02-29 20:29:24 +00:00
Lennart Poettering f557129ecb ssh-generator: handle gracefully if AF_VSOCK works, but /dev/vsock doesn't
Apparently this case exists, let's handle it gracefully.

Prompted by: https://github.com/systemd/systemd/pull/31544#issuecomment-1971241397
2024-02-29 18:28:01 +01:00
Ludwig Nussel 33f23e2230 Revert "options" rename in json bootctl output
Revert the rename from "options" to "finalCmdline" in 122650b4a0
while the bigger https://github.com/systemd/systemd/pull/31339 is still
under review.
2024-02-29 18:07:14 +01:00
Frantisek Sumsal 8fddb50fd4 test: create sshd's runtime directory (Debian variant)
sshd.service on Debian uses RuntimeDirectory=sshd, without which sshd
complains:

[ 4065.834904] sshd[711]: Missing privilege separation directory: /run/sshd
[ 4065.835785] systemd[1]: mysshserver@0-127.0.0.1:4711-127.0.0.1:58232.service: Deactivated successfully.
[ 4065.836433] testsuite-46.sh[708]: kex_exchange_identification: read: Connection reset by peer
[ 4065.836433] testsuite-46.sh[708]: Connection reset by 127.0.0.1 port 4711

Resolves: #31518
2024-02-29 13:44:29 +01:00
Frantisek Sumsal 38cbb9ab8a test: avoid SIGPIPE from ssh | tail -n 1
Addresses: https://github.com/systemd/systemd/issues/31518#issuecomment-1968295678
2024-02-29 13:43:40 +01:00
Frantisek Sumsal 905c9d2c92 test: use ECDSA keys for ssh-related tests
This should make the test faster, especially on machines without
acceleration.
2024-02-29 13:43:25 +01:00
Frantisek Sumsal 6e97142b84 test: shell & cleanup cleanup 2024-02-29 13:18:07 +01:00
Luca Boccassi 9b61d422ff Merge pull request #31430 from CodethinkLabs/vmspawn/machinectl_vmspawn_support
machinectl: initial vmspawn support
2024-02-29 11:27:02 +00:00
Michael Biebl 836a06db0d Drop build-api support
It appears the build-api effort at
https://github.com/cgwalters/build-api hasn't really caught on.
systemd appears one of the very few projects actually supporting it.

It does confuse certain tools though. E.g. debhelper by finding a
configure script wrongly assumes this is an autoconf project and thus
needs to be told explicitly that this is in fact a Meson project [1].

Given that Meson is an established build system by now, it appears ok to
drop this compat layer, which will never be fully complete anyway.

[1] https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/rules?ref_type=heads#L281
2024-02-29 09:55:58 +01:00
Luca Boccassi 7eedcb4e3b semaphore: speed up build
- avoid stripping debug symbols and creating dbgsym packages
- avoid LTO, slows down build a lot
- avoid compressing packages, they are thrown out immediately after use
- avoid building udeb packages, not needed
2024-02-29 09:55:40 +01:00
Lennart Poettering b5a3418332 dissect-image: fix build
PRs #31531 and #31524 were merged in quick succession. They are fine
both on their own. But in combination they break the build. Fix it.
2024-02-28 23:02:08 +00:00
Sam Leonard eb77d24baa vmspawn: only add to cmdline if tpm was started 2024-02-28 22:05:33 +01:00
Lennart Poettering 5b97957376 Merge pull request #31531 from poettering/verity-userspace-optional
dissect: make use of userspace verity keyring optional
2024-02-28 22:04:58 +01:00
Luca Boccassi e72ae41b51 Merge pull request #31524 from poettering/secure-getenv-naming-fix
change naming order getenv_xyz_secure() → secure_getenv_xyz() to match glibc
2024-02-28 18:01:52 +00:00
Luca Boccassi de461d3269 Merge pull request #31526 from poettering/proc-cmdline-underscorify
make sure we use underscores for kernel cmdline option names, not dashes
2024-02-28 17:59:46 +00:00
Sam Leonard f82dcc3fc3 machinectl: support vmspawn as a backend 2024-02-28 17:49:00 +00:00
Sam Leonard b0dc766852 vmspawn: support machined registration 2024-02-28 17:49:00 +00:00
Lennart Poettering 6aa14b283b Merge pull request #31514 from CodethinkLabs/ptyfwd_issues
ptyfwd/terminal-util: improve edge case handling
2024-02-28 18:36:50 +01:00
Lennart Poettering f0ecff8506 dissect: condition usespace verity keyring via kernel cmdline option + env var 2024-02-28 16:18:22 +01:00
Lennart Poettering f4a63ce25f dissect-image: add flag for explicitly enabling userspace verity signature checking
let's make userspace verity signature checking optional. This adds a
dissection flag to enable the logic and patches through all our users to
enable it by default, thus effectively not changing anything from the
status quo ante. However, know we have a knob to turn this off in
certain scenarios.
2024-02-28 16:17:40 +01:00
Lennart Poettering dbe253aa9d env-util: also rename getenv_uint64_secure() → secure_getenv_uint64()
As in the previous commit, let's not change the order of the words
compared to the underlying glibc API.
2024-02-28 15:38:00 +01:00
Lennart Poettering efb9b3bab2 env-util: rename getenv_bool_secure() → secure_getenv_bool()
The glibc API is behind the wrapper is called "secure_getenv()", hence
our wrapper really should keep the order too, otherwise things are just
too confusing.
2024-02-28 15:38:00 +01:00
Lennart Poettering dc9a56d83e man: add a few missing entries to kernel-command-line man page 2024-02-28 15:33:51 +01:00
Lennart Poettering 78266a54f1 tree-wide: use "_" rather than "-" as separator in kernel cmdline options
Most of our kernel cmdline options use underscores as word separators in
kernel cmdline options, but there were some exceptions. Let's fix those,
and also use underscores.

Since our /proc/cmdline parsers don't distinguish between the two
characters anyway this should not break anything, but makes sure our own
codebase (and in particular docs and log messages) are internally
consistent.
2024-02-28 15:33:51 +01:00
Frantisek Sumsal 78816ce72e Merge pull request #31444 from bluca/semaphore
semaphore: set upstream build profile and set default branch to debian/master
2024-02-28 15:03:11 +01:00
Luca Boccassi 0cad991c4c Merge pull request #31293 from ragazenta/netdev_rps
udevd: Add ReceivePacketSteeringCPUMask for systemd.link
2024-02-28 13:37:28 +00:00
Lennart Poettering 6a145157eb resolved: exit function if varlink_dispatch() returns > 0
varlink_dispatch() returns > 0 if it already replied to the method call,
hence this is reason to return from the handler function, and not
proceed.
2024-02-28 13:35:47 +00:00
Lennart Poettering f9f5ce61fa userbdb: pass log level from main daemon to worker 2024-02-28 12:42:06 +00:00
Sam Leonard d848a94998 shared/ptyfwd: detect String Terminator or BEL when parsing an OSC sequence 2024-02-28 11:50:18 +00:00
Sam Leonard 9eb118eea7 shared/ptyfwd: allow window title but not background color as a valid state
Previously if a PTYForward instance had the window title set but no
background color set then it would crash in an assertion as
pty_forward_ansi_process didn't require both to be present.

systemd-vmspawn could get into this state if it failed to get the
terminal tint color.

Now any method that would have called background_color_sequence now
becomes just a NOP if the background color is not set.

This allows keeping the functionality to set window titles even if the
terminal doesn't support the background coloring.
2024-02-28 11:50:18 +00:00
Sam Leonard 73a72e3a7b basic/terminal-util: accept ST or BEL to end escape sequence queries
Currently scan_background_color_response only accepts BEL (\x07) to end
a response, however some terminals (namely kitty in my case) will reply
with the string terminator (ST - https://en.wikipedia.org/wiki/ANSI_escape_code).

This commit changes the behaviour to now accept either ending.
2024-02-28 11:50:18 +00:00
Sam Leonard 9924d3c595 basic/terminal-util: add check for poll timeout in get_default_background_color
Currently the return value 0 is not checked for, this indicates a
timeout and should be handled to prevent doing a blocking read on a file
descriptor with no data ready.
2024-02-28 11:50:17 +00:00
Yu Watanabe 39af486a7f network/ndisc: drop redundant sd_ndisc_router_get_icmp6_ratelimit()
This effectively reverts 9175002864.

The retrans time field in RA message is for neighbor solicitation,
and the commit d4c8de21a0 makes the value
assigned to the correct sysctl property.

Let's deprecate the option, and drop the redundant functions.
2024-02-28 11:05:00 +00:00
Lennart Poettering 29eddf0ea4 nspawn: minor coding style tweaks to nspawn-register.c 2024-02-28 11:07:58 +01:00
Zbigniew Jędrzejewski-Szmek ab95ba1558 Merge pull request #31511 from jamacku/prepare-for-diff-shellcheck
Prepare for new version of Differential ShellCheck & scanning of shell completion scripts
2024-02-28 10:28:56 +01:00
Yu Watanabe 9398ef0786 cgroup-setup: clarify '<=' is evaluated earlier
Follow-up for 31323f21bb.

The code is correct, but let's silence Coverity.

Closes CID#1534787.
2024-02-28 14:11:43 +08:00
Renjaya Raga Zenta a6f5673c99 test-network: Add test for rps_cpu_mask option 2024-02-28 11:37:18 +07:00
Renjaya Raga Zenta 0f30bf5886 udevd: Add ReceivePacketSteeringCPUMask for systemd.link
Takes a list of CPU indices or ranges separated by either whitespace or commas. Alternatively,
takes the special value "all" in which will include all available CPUs in the mask.
CPU ranges are specified by the lower and upper CPU indices separated by a dash (e.g. "2-6").
This option may be specified more than once, in which case the specified CPU affinity masks are merged.
If an empty string is assigned, the mask is reset, all assignments prior to this will have no effect.
Defaults to unset and RPS CPU list is unchanged. To disable RPS when it was previously enabled, use the
special value "disable".

Currently, this will set CPU mask to all `rx` queue of matched device (if it has multiple queues).

The `/sys/class/net/<dev>/queues/rx-<n>/rps_cpus` only accept cpu bitmap mask in hexadecimal.

Fix: #30323
2024-02-28 11:35:36 +07:00
Yu Watanabe 630023e2e4 TODO: fix typo
Follow-up for 666a348d1c.
2024-02-28 11:46:21 +09:00
Yu Watanabe c4047829bb test-network: fix typo
Follow-up for a663ddc04e.
2024-02-28 11:44:20 +09:00