Commit Graph
53883 Commits
Author SHA1 Message Date
Yu Watanabe a84171ce6f libsystemd-network: do not warn when log_dhcp_client() or friends with NULL 2021-10-26 08:09:40 +09:00
Yu Watanabe 6681eb021a udev: do not try to rename interface if it is already up
See dev_change_name() in kernel's net/core/dev.c.

Fixes #21105.
2021-10-25 20:18:53 +01:00
Yu Watanabe f595b2e9b4 Merge pull request #21116 from poettering/test-cleaner
make tests a bit cleaner in regards to oomd handling
2021-10-25 23:16:14 +09:00
Yu Watanabe 1dfdf96716 Merge pull request #21117 from mrc0mmand/last-coverage-related-tweaks
Last batch of coverage-related tweaks
2021-10-25 23:15:47 +09:00
Yu Watanabe f8aa82e43f Merge pull request #21077 from poettering/mount-setattr
optimize remounting with mount_setattr() syscall
2021-10-25 23:15:10 +09:00
Yu Watanabe 2db32618fe nspawn: fix build when SECCOMP is disabled
Follow-up for 20e458ae3c.
2021-10-25 19:23:55 +09:00
Frantisek Sumsal 35382a9da3 test: merge coverage reports from previous test runs
Relevant mainly for tests which utilize both QEMU and nspawn.
2021-10-25 11:35:47 +02:00
Frantisek Sumsal e70103e2d4 test: tweak TriggerLimitIntervalSec= when built with coverage
Collecting coverage causes a significant slowdown in general, but since
this test requires certain timing, we need to tweak the defaults to make
it reliably pass.
2021-10-25 11:02:22 +02:00
Lennart Poettering 1d1ba68816 varlink: don't try to talk to oomd from unit tests
Talking to external daemons we ourselves maintain is a job for the
integration tests, not the unit tests. This communication is likely to
fail hence don#t even bother.

This makes our tests a bit cleaner.
2021-10-25 10:45:22 +02:00
Lennart Poettering fc594dee98 cgroup: handle gracefully if we can't read oom_kill cgroup attribute 2021-10-25 10:45:22 +02:00
Lennart Poettering 0289948eb4 mount-util: move opening of /proc/self/mountinfo into bind_remount_one_with_mountinfo()
Let's move things around a bit, and open /proc/self/mountinfo if needed
inside of bind_remount_one_with_mountinfo(). That way bind_remount_one()
can become a superthin inline wrapper around
bind_remount_one_with_mountinfo(). Main benefit is that we don't even
have to open /p/s/mi in case mount_setattr() actually worked for us.
2021-10-25 10:41:26 +02:00
Lennart Poettering 874052c501 mount-util: port over bind_remount_recursive_with_mountinfo() to mount_setattr() 2021-10-25 10:41:26 +02:00
Lennart Poettering 4f5644dba6 mount-util: use modern mount_setattr() syscall for bind_remount_one_with_mountinfo()
New kernels have a nice syscall for changing bind mount flags. Let's use
it. This makes the complex libmount based iteration logic unnecessary.
2021-10-25 10:41:26 +02:00
Luca Boccassi 6dbfbc4667 TODO: add note about chase_symlink flag 2021-10-24 17:00:49 +01:00
Yu Watanabe 8e4de611eb Merge pull request #21108 from mrc0mmand/here-comes-the-coverage
A couple more coverage-related tweaks
2021-10-24 22:54:23 +09:00
Frantisek Sumsal d2a39812fd test: rename the global service override file for coverage runs
Otherwise we break TEST-15-DROPIN, since it uses
/usr/lib/systemd/system/service.d/override.conf in some of its
sub-tests.
2021-10-23 22:10:24 +02:00
Frantisek Sumsal 8d5b38e568 README: fix CentOS CI badge 2021-10-23 21:46:53 +02:00
Frantisek Sumsal 035af7adfe test: disable ProtectHome= when collecting coverage as well
Depending on the location of the original build dir, either ProtectHome=
or ProtectSystem= may get in the way when creating the gcov metadata
files.

Follow-up to:
    * 02d7e73013
    * 6c9efba677
2021-10-23 21:27:20 +02:00
Yu Watanabe 096a154acc Merge pull request #21082 from yuwata/network-dhcp6-pd-trivial-cleanups
network: DHCPv6 PD: several trivial cleanups
2021-10-23 23:58:22 +09:00
Anssi Hannula 37e4637a9e efivars: skip writing if variable is already in wanted state
In order to minimize EFI variable NVRAM wear, do not rewrite variables
if they are already in the wanted state (i.e. same data and attributes).

This allows e.g. performing repeat calls of "bootctl install" (which
always rewrites the EFI boot entry) without consuming EFI NVRAM write
cycles.
2021-10-23 23:57:56 +09:00
Lennart Poettering aa0379f16f homed: don't drop caches on activation
We should drop caches if we are configured to do so in all cases where
we are done with home dir operations: except if that operation is
activation, because in that case we are not destroying anything, but
leaving it on.

Hence, turn off the flag that reminds us that we should drop caches
before exiting, once activation completed fully,

Follow-up for 86019efa44
2021-10-23 17:26:26 +09:00
Yu Watanabe 20e458ae3c nspawn: ignore --suppress-sync=yes when seccomp is disabled
Follow-up for 4a4654e024.

Fixes #21090.
2021-10-22 23:43:20 +02:00
Lennart Poettering dbf1aca619 nspawn: bump RLIMIT_NOFILE for nspawn payload similar to how host PID 1 does it for its payload
We try to pass containers roughly the same rlimits as the host gets from
the kernel. However, this means we'd set the RLIMIT_NOFILE to 4K. Which
is quite limiting though, and is something we actually departed from in
PID1: since 52d6207578 we raise the limit
substantially for all userspace.

Given that nspawn is quite often invoked without proper PID1, let's raise the
limits for container payloads the same way as we do from the real PID1
to its service payloads.
2021-10-22 23:42:55 +02:00
Lennart Poettering a07ab1dd8c update TODO 2021-10-22 19:20:13 +02:00
Jan Janssen e6cab77eca sd-boot: Add keys to reboot into firmware interface
This is useful if the auto-firmware setting has been disabled. The
keys used here are based on what the majority of firmware employ in
the wild.
This also ensures there's a chance for the user to discover this in
case they were too slow during POST or simply used the wrong ones.
2021-10-22 19:12:55 +02:00
Lennart Poettering 784c249f41 Merge pull request #21094 from poettering/userns-split
util-lib: split out userns allocation into new helper function
2021-10-22 19:12:21 +02:00
Lennart Poettering 7afef7ed14 Merge pull request #21093 from poettering/homework-trivial-tweaks
homed trivial refactoring
2021-10-22 19:12:01 +02:00
Lennart Poettering a5bf435ed7 update TODO 2021-10-22 17:57:13 +02:00
Lennart Poettering a972ab0f25 Merge pull request #21079 from poettering/fd-reopen-directory-tweak
fd-util: when re-opening a directory with fd_reopen() go via openat(……
2021-10-22 17:41:17 +02:00
Lennart Poettering 43cac49092 process-util: move sync() out of freeze()
We are using this for creating userns namespaces, and we really
shouldn't try to sync there. Moreover the use of free() in shutdown code
doesn't need it anyway, since it just sync()ed right before anyway. Only
the third user of freeze() we have actually needs the syc(), hence do it
there and nowhere else.
2021-10-22 16:37:10 +02:00
Lennart Poettering 979b0ff2c4 namespace-util: introduce userns_acquire() as helper for allocating new unbound userns
This returns a namespace fd, and takes a uidmap/gidmap as string. This
is split out out mount-util.c's remount_idmap() logic, so that we can
allocate a userns independently.
2021-10-22 16:34:30 +02:00
Lennart Poettering 8ddefb8eef basic: move freeze() from shared/exec-util.h to basic/process-util.h
That way we can use it in other code from basic/. It fits into both
headers equally well or badly, hence let's just move this one function.
2021-10-22 16:34:30 +02:00
Lennart Poettering 7cb791bcac homework: split home_unshare_and_mount() in two
Previously the call did two things, and the second thing was optional
(depending on first arg being NULL). Let's simplify this and just make
it two distinct functions, where one calls the other.

This should make things a bit more readable, given that we called a
function called "…and_mount()" which didn't actually mount...

No actual code changes, just some refactoring.
2021-10-22 16:09:50 +02:00
Lennart Poettering baa41cee77 homework: use bit fields where we deal with lots of separate boolean flags
No actual code changes, just making a structure a bit shorter.
2021-10-22 16:03:23 +02:00
Lennart Poettering 498abadb8c homework: add macro for "/run/systemd/user-home-mount"
We use this work dir a various places, and it's easy to mistype, hence
let the compiler detect this for us, and introduce a macro for it.

No code changes, just some search/replace.
2021-10-22 16:01:42 +02:00
Yu Watanabe 197aec7e79 network: dhcp6pd: fix the default value of subnet ID
The type of dhcp6_pd_subnet_id is int64_t.
2021-10-22 21:38:29 +09:00
Lennart Poettering 7c26a631ad varlink: disconnect varlink link in one more case
Previously we'd possibly see POLLHUP on a varlink link, and continue to
run epoll on it even though we have nothing to read nor write anymore.

Let's fix that, and once we know that there's nothing to write anymore
(or we saw a write error already) we'll disconnect after POLLHUP.

Fixes: #20062
2021-10-22 21:37:31 +09:00
Lennart Poettering 61fb966ccc test-fd-util: add test case for fd_reopen() 2021-10-22 14:06:08 +02:00
Lennart Poettering d6274e6b8f fd-util: tweak error handling in fd_reopen()
If we know that /proc/ works, then ENOENT when reopening an fd means the
fd didn't exist. Let's return the correct error code for that, i.e.
EBADF.
2021-10-22 14:06:08 +02:00
Lennart Poettering b4f73d1e17 fd-util: when re-opening a directory with fd_reopen() go via openat(…, ".", …)
This adds a tiny shortcut to fd_reopen(): if we are about to reopen the
fd via O_DIRECTORY then we know it#s a directory and we might as well
reopen it via opening "." using the fd as "at fd" in openat().

This has the benefit that we don't need /proc/self/fd/ around for this
special case: fewer sources of errors.
2021-10-22 14:05:12 +02:00
Lennart Poettering e0e914eaf8 test-networkd-address: fix clock type
The clock to use internally is clock_boottime_or_monotonic(), but the
test used CLOCK_MONOTONIC. After one system suspend the test thus likely
starts to fail.
2021-10-22 13:29:12 +02:00
Jan Janssen c496451216 sd-boot: Be more precise about secure boot modes
Fixes: #11559
2021-10-22 10:08:38 +02:00
Yu Watanabe b7f7c78793 network: dhcp6pd: check link state earlier before assigning prefixes to downstream
Also, narrow the acceptable range of the states.
2021-10-22 15:58:42 +09:00
Yu Watanabe a3ad6acf7b network: dhcp6pd: also call dhcp6_pd_prepare() and dhcp6_pd_finalize() for upstream interface
As now the subnet prefix may be assigned to the upstream interface.
2021-10-22 15:58:38 +09:00
Yu Watanabe aee21f7f8f Merge pull request #21081 from mrc0mmand/even-more-coverage-tweaks
test: collect even more coverage
2021-10-22 04:48:40 +09:00
Jonas Dreßler afa31f8c0f hwdb: Allow USB autosuspend for MS Surface Pro (2017) Type Cover
The Surface Type Covers are known to support USB autosuspend just fine
(and it's also enabled by default on Windows), so enable it in hwdb.
2021-10-21 18:59:06 +01:00
Yu Watanabe 796273775c network: dhcp6pd: not necessary to drop routes when Assign=yes 2021-10-22 02:00:46 +09:00
Yu Watanabe f45fb83996 Merge pull request #21072 from yuwata/network-address-lifetime
network: address: use usec_t for handling lifetime
2021-10-22 01:46:55 +09:00
Yu Watanabe a3e33adfb5 Merge pull request #21050 from yuwata/network-bpf-cleanups
libsystemd-network: cleanup BPF code
2021-10-22 01:46:15 +09:00
Frantisek Sumsal 7a6c5b6ab5 test: make the coverage check safer for non-compiled builds 2021-10-21 18:34:21 +02:00