]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
21 months agohwdb: Fix mount matrix for CSL Panther Tab HD (#25752)
mvzlb [Thu, 15 Dec 2022 10:59:14 +0000 (11:59 +0100)] 
hwdb: Fix mount matrix for CSL Panther Tab HD (#25752)

Commit a76d7aca sets ACCEL_MOUNT_MATRIX to match the device's casing
(landscape) instead of the LCD panel (portrait).

21 months agoMerge pull request #25350 from poettering/efi-guid-equal
Lennart Poettering [Thu, 15 Dec 2022 09:24:58 +0000 (10:24 +0100)] 
Merge pull request #25350 from poettering/efi-guid-equal

efi: add efi_guid_equal() helper

21 months agoMerge pull request #25602 from fbuihuu/fix-TEST-73-LOCALE
Yu Watanabe [Thu, 15 Dec 2022 08:47:05 +0000 (17:47 +0900)] 
Merge pull request #25602 from fbuihuu/fix-TEST-73-LOCALE

localed: reload PID1 configuration after modifying /etc/locale.conf

21 months agorepart: Rework Minimize= option settings
Daan De Meyer [Tue, 13 Dec 2022 18:52:18 +0000 (18:52 +0000)] 
repart: Rework Minimize= option settings

Instead of having Minimize= take a boolean let's allow for two
different ways to enable it. "best" means we want the most minimal
image possible, which currently is only possible for read-only
filesystems but can be extended in the future with bisection
to find the most minimal possible size.

We also add "guess", which is the current behavior, where we
populate once and use the sparse size to make a reasonable guess
on a size that fits all the sources without needing to O(log(n))
tries to find the most minimal size.

21 months agoMerge pull request #25743 from yuwata/timesync-ipv6
Yu Watanabe [Thu, 15 Dec 2022 03:57:54 +0000 (12:57 +0900)] 
Merge pull request #25743 from yuwata/timesync-ipv6

timesync: ignore IPv6 addresses when the kernel does not support it

21 months agobasic: do not output emojis if not on a proper terminal
Zbigniew Jędrzejewski-Szmek [Wed, 14 Dec 2022 14:39:26 +0000 (15:39 +0100)] 
basic: do not output emojis if not on a proper terminal

$TERM would generally be set if we're connected to a proper graphical terminal
emulator. In all other cases, in particular if $TERM is not set, we almost
certainly are not connected to something that can output emojis. In particular
the text console is unlikely to ever do it correctly.

So let's invert the check, and only write emojis if $TERM is set.

Fixes #25521.

21 months agoMerge pull request #25732 from enr0n/unit-test-machine-id-initialized
Yu Watanabe [Thu, 15 Dec 2022 03:55:04 +0000 (12:55 +0900)] 
Merge pull request #25732 from enr0n/unit-test-machine-id-initialized

unit tests: do not fail when `/etc/machine-id` is empty

21 months agoMerge pull request #25723 from keszybz/generators-tmp
Yu Watanabe [Thu, 15 Dec 2022 03:53:49 +0000 (12:53 +0900)] 
Merge pull request #25723 from keszybz/generators-tmp

Run generators with / ro and /tmp mounted

21 months agoMerge pull request #25693 from yuwata/binfmt
Yu Watanabe [Thu, 15 Dec 2022 03:52:30 +0000 (12:52 +0900)] 
Merge pull request #25693 from yuwata/binfmt

binfmt: several cleanups

21 months agopam: actually align the columns
Zbigniew Jędrzejewski-Szmek [Wed, 14 Dec 2022 21:23:31 +0000 (22:23 +0100)] 
pam: actually align the columns

In 9efb224443d819b7d64ec76cb94c8aa625a8abf2 was supposed to align
them, but for some reason I just added a second space everywhere.

21 months agosystemctl: is-enabled: document the return code change
Mike Yuan [Wed, 14 Dec 2022 16:50:19 +0000 (00:50 +0800)] 
systemctl: is-enabled: document the return code change

Follow-up for #25689

We've added a new output ("not-found") in #25689.

21 months agofstab-generator: use log message that matches reality 25723/head
Zbigniew Jędrzejewski-Szmek [Tue, 13 Dec 2022 13:38:06 +0000 (14:38 +0100)] 
fstab-generator: use log message that matches reality

We *assume* that when /sys is read-only, we're running in a container. But
there can other reasons, for example root is mount ro and nobody has mounted
/sys yet, or somebody forgot to add /sys to the list of filesystem not to
remount ro in a sandbox. So let's actually say what we know instead of assuming.

systemd-fstab-generator was reporting that it's running in a container and I
spent a good few minutes trying to figure out why 'systemd-detect-virt -c'
disagrees, before noticing that it's just checking a different condition.

21 months agotree-wide: use mode=0nnn for mount option
Zbigniew Jędrzejewski-Szmek [Tue, 13 Dec 2022 13:35:56 +0000 (14:35 +0100)] 
tree-wide: use mode=0nnn for mount option

This is an octal number. We used the 0 prefix in some places inconsistently.
The kernel always interprets in base-8, so this has no effect, but I think
it's nicer to use the 0 to remind the reader that this is not a decimal number.

21 months agomanager: execute generators in a mount namespace "sandbox"
Zbigniew Jędrzejewski-Szmek [Tue, 13 Dec 2022 13:32:35 +0000 (14:32 +0100)] 
manager: execute generators in a mount namespace "sandbox"

When generators are executed during early boot, /tmp might not be available
yet. This causes problems with bash, because here-docs don't work. Even
non-shell code can often assume that /tmp is available. This limitation is
known to trip up people, and when the code is tested on a "normal" system,
everything works.

We can solve this nicely, and get another small benefit, by making most of the
file system read-only and "punching holes" for some dirs that should be
writable. The generator code runs with full privileges and can do anything it
wants by writing appropriate systemd units, so it doesn't make much sense to do
any significant sandboxing around generators. But making root read-only is nice
because it can catch stupid mistakes where the generator tries to write to a
wrong path or something like that. We effectively also get a "private /tmp" for
the generators, which protects them against existing files in /tmp.

The path does the following:
when executing generators, we fork, and the child unshares root and makes
it recursively read-only, with the exception of /sys and /run. Error handling
is permissive — if some of this setup fails, we're in the same state as
before the patch.

Fixes #24430.

21 months agoshared: add new safe_fork flag FORK_PRIVATE_TMP
Zbigniew Jędrzejewski-Szmek [Wed, 14 Dec 2022 12:40:53 +0000 (13:40 +0100)] 
shared: add new safe_fork flag FORK_PRIVATE_TMP

If the flag is set, we mount /tmp/ in a way that is suitable for generators and
other quick jobs.

Unfortunately I had to move some code from shared/mount-util.c to
basic/mountpoint-util.c. The functions that are moved are very thin wrappers
around mount(2), so this doesn't actually change much in the code split between
libbasic and libshared.

Implications for the host would be weird if a private mount namespace is not
used, so assert on FORK_NEW_MOUNTNS when the flag is used.

21 months agojournal: skip part of test-journal-interleaving if no machine-id exists 25732/head
Nick Rosbrook [Wed, 14 Dec 2022 15:07:40 +0000 (10:07 -0500)] 
journal: skip part of test-journal-interleaving if no machine-id exists

When executed on a systemd with an empty /etc/machine-id,
test-journal-interleaving fails in test_sequence_numbers_one() when
re-opening the existing "two.journal". This is because opening the
existing journal file with managed_journal_file_open() causes
journal_file_verify_header() to be called. This function tries to
compare the current machine-id to the machine-id in the journal file
header, but does not handle the case where the machine-id is empty or
non-existent.

Check if we have an initialized machine-id before executing this portion
of the test.

21 months agotest-load-fragment: simplify machine-id check
Nick Rosbrook [Tue, 13 Dec 2022 17:25:35 +0000 (12:25 -0500)] 
test-load-fragment: simplify machine-id check

21 months agotest-unit-name: simplify machine-id check
Nick Rosbrook [Tue, 13 Dec 2022 17:22:37 +0000 (12:22 -0500)] 
test-unit-name: simplify machine-id check

21 months agotest-fs-util: skip part of test_chase_symlinks if machine-id is not initialized
Nick Rosbrook [Mon, 12 Dec 2022 19:37:52 +0000 (14:37 -0500)] 
test-fs-util: skip part of test_chase_symlinks if machine-id is not initialized

The part of test_chase_symlink in test-fs-util that calls
sd_id128_get_machine will fail if /etc/machine-id is empty, so skip this
block if the machine-id is not initialized.

21 months agotest-id128: simplify machine-id check
Nick Rosbrook [Mon, 12 Dec 2022 19:35:08 +0000 (14:35 -0500)] 
test-id128: simplify machine-id check

This also ensures that the test is skipped when /etc/machine-id exists,
but is not initialized.

21 months agounit: check more specific path to be written by systemd-binfmt 25693/head
Yu Watanabe [Sat, 10 Dec 2022 02:46:45 +0000 (11:46 +0900)] 
unit: check more specific path to be written by systemd-binfmt

Follow-up for 41807efb1594ae8e71e0255e154ea7d17be2251a.
Replaces #25690.

21 months agobinfmt: check if binfmt is mounted before applying rules
Yu Watanabe [Sat, 10 Dec 2022 02:42:50 +0000 (11:42 +0900)] 
binfmt: check if binfmt is mounted before applying rules

21 months agobinfmt-util: also check if binfmt is mounted in read-write
Yu Watanabe [Sat, 10 Dec 2022 02:32:24 +0000 (11:32 +0900)] 
binfmt-util: also check if binfmt is mounted in read-write

21 months agotimesync: ignore IPv6 addresses when the kernel does not support IPv6 25743/head
Yu Watanabe [Wed, 14 Dec 2022 14:54:11 +0000 (23:54 +0900)] 
timesync: ignore IPv6 addresses when the kernel does not support IPv6

Fixes #25728.

21 months agobinfmt-util: split out binfmt_mounted()
Yu Watanabe [Sat, 10 Dec 2022 02:25:28 +0000 (11:25 +0900)] 
binfmt-util: split out binfmt_mounted()

No functional changes, just refactoring and preparation for later
commits.

21 months agostat-util: introduce fd_is_read_only_fs()
Yu Watanabe [Sat, 10 Dec 2022 02:23:05 +0000 (11:23 +0900)] 
stat-util: introduce fd_is_read_only_fs()

Then, reimplement path_is_read_only_fs() by the function to avoid race.

21 months agoefi: add common implementation for loop finding EFI configuration tables 25350/head
Lennart Poettering [Wed, 14 Dec 2022 17:48:52 +0000 (18:48 +0100)] 
efi: add common implementation for loop finding EFI configuration tables

21 months agoefi: add efi_guid_equal() helper
Lennart Poettering [Fri, 11 Nov 2022 15:05:03 +0000 (16:05 +0100)] 
efi: add efi_guid_equal() helper

21 months agoMerge pull request #25575 from brauner/nspawn.socket_surgery
Lennart Poettering [Wed, 14 Dec 2022 17:36:44 +0000 (18:36 +0100)] 
Merge pull request #25575 from brauner/nspawn.socket_surgery

nspawn: reduce number of sockets

21 months agoMerge pull request #25734 from yuwata/sd-id128
Yu Watanabe [Wed, 14 Dec 2022 17:23:03 +0000 (02:23 +0900)] 
Merge pull request #25734 from yuwata/sd-id128

sd-id128: several followups

21 months agotimesync: Keep trying to connect even if the socket cannot be opened
Felix Riemann [Wed, 14 Dec 2022 14:02:39 +0000 (15:02 +0100)] 
timesync: Keep trying to connect even if the socket cannot be opened

This makes sure that after a server could not be contacted due to a
socket error, other (possibly working) NTP servers in the list of
configured NTP servers are (re-)tried.

Fixes #25728.

21 months agohwdb: Add mount matrix for CSL Panther Tab HD
MVZ Ludwigsburg [Wed, 14 Dec 2022 15:57:24 +0000 (16:57 +0100)] 
hwdb: Add mount matrix for CSL Panther Tab HD

21 months agoUse dummy allocator to make accesses defined as per standard
Siddhesh Poyarekar [Tue, 13 Dec 2022 21:54:36 +0000 (16:54 -0500)] 
Use dummy allocator to make accesses defined as per standard

systemd uses malloc_usable_size() everywhere to use memory blocks
obtained through malloc, but that is abuse since the
malloc_usable_size() interface isn't meant for this kind of use, it is
for diagnostics only.  This is also why systemd behaviour is flaky when
built with _FORTIFY_SOURCE.

One way to make this more standard (and hence safer) is to, at every
malloc_usable_size() call, also 'reallocate' the block so that the
compiler can see the larger size.  This is done through a dummy
reallocator whose only purpose is to tell the compiler about the larger
usable size, it doesn't do any actual reallocation.

Florian Weimer pointed out that this doesn't solve the problem of an
allocator potentially growing usable size at will, which will break the
implicit assumption in systemd use that the value returned remains
constant as long as the object is valid.  The safest way to fix that is
for systemd to step away from using malloc_usable_size() like this.

Resolves #22801.

21 months agoman: update documents for sd_id128_get_invocation() 25734/head
Yu Watanabe [Wed, 14 Dec 2022 05:29:25 +0000 (14:29 +0900)] 
man: update documents for sd_id128_get_invocation()

21 months agosd-id128: also refuse an empty invocation ID
Yu Watanabe [Wed, 14 Dec 2022 04:40:42 +0000 (13:40 +0900)] 
sd-id128: also refuse an empty invocation ID

21 months agosd-id128: allow sd_id128_get_machine() and friend to be called with NULL
Yu Watanabe [Wed, 14 Dec 2022 04:34:15 +0000 (13:34 +0900)] 
sd-id128: allow sd_id128_get_machine() and friend to be called with NULL

It may be useful to check if the machine ID or friends is set or not.

21 months agosd-id128: make sd_id128_get_machine() or friends return -EUCLEAN when an ID is in...
Yu Watanabe [Wed, 14 Dec 2022 05:31:09 +0000 (14:31 +0900)] 
sd-id128: make sd_id128_get_machine() or friends return -EUCLEAN when an ID is in an invalid format

EINVAL suggests that the caller passes an invalid argument. EIO is
for "input/output error", i.e. the error you'd get if the disk or
file system is borked, and this error code could be returned by the
underlying read/write functions.

Let's make the functions return an unambiguous error code.

21 months agotimesync: downgrade log message about unsupported address family
Yu Watanabe [Wed, 14 Dec 2022 14:50:08 +0000 (23:50 +0900)] 
timesync: downgrade log message about unsupported address family

As this is mostly not user's fault.

21 months agoswap: tell swapon to reinitialize swap if needed
David Tardon [Mon, 12 Dec 2022 15:21:30 +0000 (16:21 +0100)] 
swap: tell swapon to reinitialize swap if needed

If the page size of a swap space doesn't match the page size of the
currently running kernel, swapon will fail. Let's instruct it to
reinitialize the swap space instead.

21 months agoMerge pull request #25717 from bluca/reload
Luca Boccassi [Wed, 14 Dec 2022 14:45:22 +0000 (15:45 +0100)] 
Merge pull request #25717 from bluca/reload

manager: log reload() sender and allow rate-limiting

21 months agoNEWS: fix typo
Yu Watanabe [Wed, 14 Dec 2022 11:41:42 +0000 (20:41 +0900)] 
NEWS: fix typo

21 months agoMerge pull request #25726 from dtardon/cleanups
Yu Watanabe [Wed, 14 Dec 2022 11:17:56 +0000 (20:17 +0900)] 
Merge pull request #25726 from dtardon/cleanups

Several small cleanups

21 months agoresolve: fix NULL-pointer dereference
Yu Watanabe [Wed, 14 Dec 2022 07:10:05 +0000 (16:10 +0900)] 
resolve: fix NULL-pointer dereference

Fixes a bug introduced by 16a6bc5a7a5da2482d96f7dc43da360ceab1c320.
Fixes CID#1501514.

21 months agodoc: add language decorator on the code block
Jiayi Chen [Wed, 14 Dec 2022 08:27:50 +0000 (16:27 +0800)] 
doc: add language decorator on the code block

Add `c` decorator on the code block for applying syntax highlighting.

21 months agobtrfs-util: shorten a bit 25726/head
David Tardon [Wed, 30 Nov 2022 15:56:40 +0000 (16:56 +0100)] 
btrfs-util: shorten a bit

21 months agomachine: propagate error from machine_new
David Tardon [Wed, 30 Nov 2022 15:46:05 +0000 (16:46 +0100)] 
machine: propagate error from machine_new

21 months agomachine: use _cleanup_ in machine_new
David Tardon [Wed, 30 Nov 2022 15:42:08 +0000 (16:42 +0100)] 
machine: use _cleanup_ in machine_new

21 months agolocaled-util: use _cleanup_ harder
David Tardon [Wed, 30 Nov 2022 15:18:06 +0000 (16:18 +0100)] 
localed-util: use _cleanup_ harder

21 months agobusctl-introspect: use _cleanup_
David Tardon [Wed, 30 Nov 2022 15:02:11 +0000 (16:02 +0100)] 
busctl-introspect: use _cleanup_

21 months agoMerge pull request #25689 from YHNdnzj/systemctl-exit-code
Zbigniew Jędrzejewski-Szmek [Wed, 14 Dec 2022 07:37:16 +0000 (08:37 +0100)] 
Merge pull request #25689 from YHNdnzj/systemctl-exit-code

systemctl: make is-* return EXIT_PROGRAM_OR_SERVICES_STATUS_UNKNOWN(4) when no unit file is found

21 months agorepart: Rename --skip-partitions to --defer-partitions
Daan De Meyer [Tue, 13 Dec 2022 18:14:43 +0000 (18:14 +0000)] 
repart: Rename --skip-partitions to --defer-partitions

Defer is better because it indicates that we still intend to
populate these partitions later.

21 months agoMerge pull request #25706 from yuwata/hwdb-pointing-stick
Luca Boccassi [Wed, 14 Dec 2022 00:38:55 +0000 (01:38 +0100)] 
Merge pull request #25706 from yuwata/hwdb-pointing-stick

hwdb: several fixes for pointing stick

21 months agoMerge pull request #25725 from keszybz/oom-policy-fixup
Luca Boccassi [Wed, 14 Dec 2022 00:38:11 +0000 (01:38 +0100)] 
Merge pull request #25725 from keszybz/oom-policy-fixup

Add missing integration of OOMPolicy in scope units

21 months agomkosi: Enable CONFIG_ZBOOT
Daan De Meyer [Tue, 13 Dec 2022 18:04:48 +0000 (18:04 +0000)] 
mkosi: Enable CONFIG_ZBOOT

Required to boot mkosi images with systemd-boot on aarch64.

21 months agoNEWS: add a bunch of entries for v253
Zbigniew Jędrzejewski-Szmek [Tue, 13 Dec 2022 19:24:08 +0000 (20:24 +0100)] 
NEWS: add a bunch of entries for v253

During the call today we agreed to work towards -rc1 in January. Nevertheless,
I already started writing this up and I'll push it so it doesn't get lost.

I didn't include all the changes to systemd-repart, because those are still in
flux.

21 months agomanager: add option to rate limit daemon-reload 25717/head
Luca Boccassi [Mon, 12 Dec 2022 22:10:18 +0000 (22:10 +0000)] 
manager: add option to rate limit daemon-reload

Reloading is a heavy-weight operation, and currently it is not
possible to stop an orchestrator from spamming reload requests.
Add configuration options to allow rate-limiting.

21 months agomanager: log unit/pid of sender when Reload() is called
Luca Boccassi [Mon, 12 Dec 2022 15:34:43 +0000 (15:34 +0000)] 
manager: log unit/pid of sender when Reload() is called

Reloading is a heavy-weight operation, and currently it is not
possible to figure out who/what requested it, even at debug level
logging.
Check the sender of the D-Bus message and print it out at info level.

21 months agoTEST-26-SYSTEMCTL: test about systemctl return codes for is-* verbs 25689/head
Mike Yuan [Mon, 12 Dec 2022 16:39:31 +0000 (00:39 +0800)] 
TEST-26-SYSTEMCTL: test about systemctl return codes for is-* verbs

We should return 4 when no unit file is found.

See also: #25689 #25680

21 months agosystemctl: is-*: return correct code when no unit is found
Mike Yuan [Sat, 10 Dec 2022 12:55:42 +0000 (20:55 +0800)] 
systemctl: is-*: return correct code when no unit is found

According to systemctl(1), we should use LSB return code 4
(EXIT_PROGRAM_OR_SERVICES_STATUS_UNKNOWN) when the state
is "no such unit" for is-{active,failed,enabled} verbs.

Fixes #25680

21 months agohwdb: also add a generic entry for DualPoint Stick 25706/head
Yu Watanabe [Mon, 12 Dec 2022 04:51:38 +0000 (13:51 +0900)] 
hwdb: also add a generic entry for DualPoint Stick

Also mention Dell DualPoint Stick in the comment.

21 months agohwdb: add comments about matching entries
Yu Watanabe [Mon, 12 Dec 2022 04:41:34 +0000 (13:41 +0900)] 
hwdb: add comments about matching entries

Follow-up for 57bb707d48131f4daad2b1b746eab586eb66b4f3.

This makes the comments in 60-evdev.hwdb, 60-keyboard.hwdb, and
70-pointingstick.hwdb consistent.

21 months agohwdb: drop trailing space
Yu Watanabe [Mon, 12 Dec 2022 04:57:42 +0000 (13:57 +0900)] 
hwdb: drop trailing space

21 months agoMerge pull request #25658 from yuwata/fuzz-etc-hosts
Yu Watanabe [Tue, 13 Dec 2022 16:44:12 +0000 (01:44 +0900)] 
Merge pull request #25658 from yuwata/fuzz-etc-hosts

resolve: dedup entries in /etc/hosts

21 months agocoredump: cescape invalid json data before logging
Zbigniew Jędrzejewski-Szmek [Tue, 13 Dec 2022 10:15:17 +0000 (11:15 +0100)] 
coredump: cescape invalid json data before logging

In both cases, the json string is short, so we can print it, which is useful
for diagnosing invalid data in packages. But we need escape non-printable
characters.

https://bugzilla.redhat.com/show_bug.cgi?id=2152685

I went over the rest of the codebase, and it seems that other calls to
json_parse() don't have this problem.

21 months agohwdb: Add additional Dell models that require ACCEL_LOCATION=base (#25724)
AndyChi [Tue, 13 Dec 2022 15:19:27 +0000 (23:19 +0800)] 
hwdb: Add additional Dell models that require ACCEL_LOCATION=base (#25724)

21 months agoratelimit: drop use of goto
David Tardon [Wed, 30 Nov 2022 14:44:25 +0000 (15:44 +0100)] 
ratelimit: drop use of goto

21 months agonspawn: remove cgroup socket 25575/head
Christian Brauner [Wed, 30 Nov 2022 14:01:27 +0000 (15:01 +0100)] 
nspawn: remove cgroup socket

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
21 months agonspawn: remove pty socket
Christian Brauner [Wed, 30 Nov 2022 13:59:52 +0000 (14:59 +0100)] 
nspawn: remove pty socket

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
21 months agonspawn: remove rtnl socket
Christian Brauner [Wed, 30 Nov 2022 13:50:43 +0000 (14:50 +0100)] 
nspawn: remove rtnl socket

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
21 months agomountpoint-util: reduce variable scope
David Tardon [Wed, 30 Nov 2022 14:18:15 +0000 (15:18 +0100)] 
mountpoint-util: reduce variable scope

21 months agocore,man: add missing integration of OOMPolicy= in scopes 25725/head
Zbigniew Jędrzejewski-Szmek [Tue, 13 Dec 2022 14:26:58 +0000 (15:26 +0100)] 
core,man: add missing integration of OOMPolicy= in scopes

Fixup for 5fa098357e0ea9f05b00ed5b04a36ef9f64037db.

21 months agoman: rework description of OOMPolicy= a bit
Zbigniew Jędrzejewski-Szmek [Tue, 13 Dec 2022 14:25:55 +0000 (15:25 +0100)] 
man: rework description of OOMPolicy= a bit

One had to read to the very end of the long description to notice that
the setting is actually primarily intended for oomd. So let's mention oomd
right at the beginning.

21 months agonspawn: s/kmsg_socket_pair/fd_inner_socket_pair/g
Christian Brauner [Wed, 30 Nov 2022 13:47:53 +0000 (14:47 +0100)] 
nspawn: s/kmsg_socket_pair/fd_inner_socket_pair/g

Also stop stashing the kmsg fifo fd in the socket. Just retrieve it in
the parent and have the parent hold on to it.

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
21 months agonspawn: s/fd_socket_pair/fd_outer_socket_pair/g
Christian Brauner [Wed, 30 Nov 2022 13:44:07 +0000 (14:44 +0100)] 
nspawn: s/fd_socket_pair/fd_outer_socket_pair/g

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
21 months agonspawn: remove uid socket
Christian Brauner [Wed, 30 Nov 2022 13:38:04 +0000 (14:38 +0100)] 
nspawn: remove uid socket

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
21 months agonspawn: remove uuid socket
Christian Brauner [Wed, 30 Nov 2022 13:35:19 +0000 (14:35 +0100)] 
nspawn: remove uuid socket

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
21 months agonspawn: remove pid socket
Christian Brauner [Wed, 30 Nov 2022 13:28:07 +0000 (14:28 +0100)] 
nspawn: remove pid socket

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
21 months agonspawn: s/notify_socket/fd_socket/g
Christian Brauner [Wed, 30 Nov 2022 13:22:53 +0000 (14:22 +0100)] 
nspawn: s/notify_socket/fd_socket/g

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
21 months agodoc: add an example code to lock the whole disk
January [Thu, 24 Nov 2022 13:13:17 +0000 (21:13 +0800)] 
doc: add an example code to lock the whole disk

add an example to leverage `libsystemd` infrastructure to get the whole disk of a block device and take BSD lock on it #25046

21 months agocore/namespace: indentation
Zbigniew Jędrzejewski-Szmek [Tue, 13 Dec 2022 13:04:32 +0000 (14:04 +0100)] 
core/namespace: indentation

21 months agotreewide: drop "RUN_" from "RUN_WITH_UMASK"
Zbigniew Jędrzejewski-Szmek [Tue, 13 Dec 2022 11:11:29 +0000 (12:11 +0100)] 
treewide: drop "RUN_" from "RUN_WITH_UMASK"

RUN_WITH_UMASK was initially conceived for spawning externals progs with the
umask set. But nowadays we use it various syscalls and stuff that doesn't "run"
anything, so the "RUN_" prefix has outlived its usefulness.

21 months agoexecute: Pass AT_FDCWD instead of -1
Daan De Meyer [Tue, 13 Dec 2022 10:50:01 +0000 (10:50 +0000)] 
execute: Pass AT_FDCWD instead of -1

Let's enforce that callers pass AT_FDCWD as read_dfd to load_credential()
to avoid an assert() in read_full_file_full() if read_dfd is -1.

21 months agomkosi: Drop i686 packages
Daan De Meyer [Tue, 13 Dec 2022 12:14:49 +0000 (12:14 +0000)] 
mkosi: Drop i686 packages

These are only needed for some kernel selftests but they prevent
building the mkosi image on aarch64 systems so let's drop them
until mkosi has support for conditional configuration so we can
only add these packages on the right architecture.

21 months agoresolve: dedup entries in /etc/hosts 25658/head
Yu Watanabe [Wed, 7 Dec 2022 14:39:56 +0000 (23:39 +0900)] 
resolve: dedup entries in /etc/hosts

This improves the performance of parsing the file and reduces memory pressure.

Running 'fuzz-etc-hosts timeout-strv' with valgrind,

Before:
total heap usage: 321,020 allocs, 321,020 frees, 15,820,387,193 bytes allocated
real    0m23.531s
user    0m21.458s
sys     0m1.961s

After:
total heap usage: 112,408 allocs, 112,408 frees, 7,297,480 bytes allocated
real    0m8.664s
user    0m8.545s
sys     0m0.065s

Hopefully fixes oss-fuzz#47708 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47708).

21 months agoresolve: introduce more hash-ops and use them
Yu Watanabe [Wed, 7 Dec 2022 14:38:45 +0000 (23:38 +0900)] 
resolve: introduce more hash-ops and use them

No functional changes, just refactoring.

21 months agoresolve: use dns_name_hash_ops_free
Yu Watanabe [Tue, 13 Dec 2022 11:36:19 +0000 (20:36 +0900)] 
resolve: use dns_name_hash_ops_free

No functional changes, just refactoring.

21 months agodns-domain: introduce dns_name_hash_ops_free
Yu Watanabe [Wed, 7 Dec 2022 13:35:09 +0000 (22:35 +0900)] 
dns-domain: introduce dns_name_hash_ops_free

Preparation for later commits.

21 months agoin-addr-util: introduce in_addr_data_hash_ops_free and expose its compare and hash...
Yu Watanabe [Wed, 7 Dec 2022 13:34:40 +0000 (22:34 +0900)] 
in-addr-util: introduce in_addr_data_hash_ops_free and expose its compare and hash functions

Preparation for later commits.

21 months agoresolve: split manager_etc_hosts_lookup() into small parts
Yu Watanabe [Wed, 7 Dec 2022 14:14:46 +0000 (23:14 +0900)] 
resolve: split manager_etc_hosts_lookup() into small parts

No functional changes, just refactoring.

21 months agoresolve: adjust warning
Yu Watanabe [Wed, 7 Dec 2022 13:55:37 +0000 (22:55 +0900)] 
resolve: adjust warning

21 months agoresolve: merge two boolean variables
Yu Watanabe [Wed, 7 Dec 2022 13:53:46 +0000 (22:53 +0900)] 
resolve: merge two boolean variables

No functional changes, just refactoring.

21 months agoresolve: introduce cleanup functions for EtcHostsItemBy{Address,Name}
Yu Watanabe [Wed, 7 Dec 2022 14:30:22 +0000 (23:30 +0900)] 
resolve: introduce cleanup functions for EtcHostsItemBy{Address,Name}

No functional change, just refactoring and preparation for later
commits.

21 months agoresolve: make etc_hosts_item_by_{address,name}_free() accept NULL
Yu Watanabe [Wed, 7 Dec 2022 13:48:14 +0000 (22:48 +0900)] 
resolve: make etc_hosts_item_by_{address,name}_free() accept NULL

21 months agoresolve: rename EtcHostsItem -> EtcHostsItemByAddress
Yu Watanabe [Wed, 7 Dec 2022 13:41:17 +0000 (22:41 +0900)] 
resolve: rename EtcHostsItem -> EtcHostsItemByAddress

21 months agoresolve: rename etc_hosts_free() -> etc_hosts_clear()
Yu Watanabe [Wed, 7 Dec 2022 13:30:45 +0000 (22:30 +0900)] 
resolve: rename etc_hosts_free() -> etc_hosts_clear()

21 months agonspawn: realign columns
Zbigniew Jędrzejewski-Szmek [Thu, 24 Nov 2022 13:20:56 +0000 (14:20 +0100)] 
nspawn: realign columns

Follow-up for b9e7f22c2d80930cad36ae53e66e42a2996dca4a.

21 months agoMerge pull request #25713 from keszybz/hwdb-matching
Yu Watanabe [Tue, 13 Dec 2022 09:13:27 +0000 (18:13 +0900)] 
Merge pull request #25713 from keszybz/hwdb-matching

Restore backwards compat in 60-evdev.rules

21 months agocryptsetup-fido2: Try all FIDO2 key slots when opening LUKS volume
Peter Cai [Sat, 29 Oct 2022 23:00:53 +0000 (19:00 -0400)] 
cryptsetup-fido2: Try all FIDO2 key slots when opening LUKS volume

After #25268, it is now possible to check whether a credential
is present on a FIDO2 token without actually attempting to retrieve said
credential. However, when cryptsetup plugins are not enabled, the
fallback unlock routines are not able to make multiple attempts with
multiple different FIDO2 key slots.

Instead of looking for one FIDO2 key slot when trying to unlock, we now
attempt to use all key slots applicable.

Fixes #19208.

21 months agoMerge pull request #25375 from PeterCxy/fido2-fixups
Luca Boccassi [Mon, 12 Dec 2022 20:48:09 +0000 (21:48 +0100)] 
Merge pull request #25375 from PeterCxy/fido2-fixups

Fixups for FIDO2 pre-flight checks

21 months agoUpdate 60-evdev.hwdb (#25704)
uerdogan [Mon, 12 Dec 2022 20:46:50 +0000 (21:46 +0100)] 
Update 60-evdev.hwdb (#25704)

This solves Debian Bug report 1008760:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008760.

Solution was inspired by this kernel bug report message:
https://bugzilla.kernel.org/show_bug.cgi?id=204967#c15.

My measured pad dimensions with a ruler were 85x44mm.
But I decided to take the 2x size reported by the current kernel
when invoking the touchpad-edge-detector command from the
libdev-tools package. Because this comment claims that the old
vs new kernel reportings differ by factor 2:
https://bugzilla.kernel.org/show_bug.cgi?id=204967#c3 .

Therefore I have used this command to get the new entry to 60-evdev.hwdb:

"root@pb:~# touchpad-edge-detector 80x34 /dev/input/event2
Touchpad ETPS/2 Elantech Touchpad on /dev/input/event2

Move one finger around the touchpad to detect the actual edges
Kernel says: x [0..1254], y [0..528]
Touchpad sends: x [0..2472], y [-524..528] -^C

Touchpad size as listed by the kernel: 40x17mm
User-specified touchpad size: 80x34mm
Calculated ranges: 2472/1052

Suggested udev rule:
# <Laptop model description goes here>
evdev:name:ETPS/2 Elantech Touchpad:dmi:bvnPackardBell:bvrV1.21:bd08/09/2012:br21.240:svnPackardBell:pnEasyNoteTS11HR:pvrV1.21:rvnPackardBell:rnSJV50_HR:rvrBaseBoardVersion:cvnPackardBell:ct10:cvrV1.21:*
 EVDEV_ABS_00=0:2472:31
 EVDEV_ABS_01=-524:528:31
 EVDEV_ABS_35=0:2472:31
 EVDEV_ABS_36=-524:528:31
"