]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agosocket-activate: make a copy of the command name and arguments 28060/head
Frantisek Sumsal [Fri, 16 Jun 2023 17:05:57 +0000 (19:05 +0200)] 
socket-activate: make a copy of the command name and arguments

When we call safe_fork() with the first argument set (process name), we
call rename_process() that zeroes out saved argv (that was saved by
save_argc_argv() in the main func defined by DEFINE_MAIN_FUNC()). In this
case this means that with --accept both the target executable name and
its arguments will be empty strings:

```
$ systemd-socket-activate --accept --listen 1111 cat &
Listening on [::]:1111 as 3.
$ curl localhost:1111
Communication attempt on fd 3.
Connection from 127.0.0.1:52948 to [::ffff:127.0.0.1]:1111
Spawned cat (cat) as PID 10576.
Execing  ()
Failed to execp  (): No such file or directory
Child 10576 died with code 1
curl: (56) Recv failure: Connection reset by peer
```

Let's make a copy of the necessary arguments beforehand and use it
instead to fix this.

2 years agotest: add a couple of tests for systemd-journal-gatewayd
Frantisek Sumsal [Fri, 16 Jun 2023 16:50:08 +0000 (18:50 +0200)] 
test: add a couple of tests for systemd-journal-gatewayd

2 years agojournal-gatewayd: make MHD_OPTION_EXTERNAL_LOGGER the first option
Frantisek Sumsal [Fri, 16 Jun 2023 15:03:27 +0000 (17:03 +0200)] 
journal-gatewayd: make MHD_OPTION_EXTERNAL_LOGGER the first option

To get rid of the warning on gatewayd startup:
    microhttpd: MHD_OPTION_EXTERNAL_LOGGER is not the first option
    specified for the daemon. Some messages may be printed by the
    standard MHD logger.

2 years agotest: clean up the new test case a bit
Frantisek Sumsal [Fri, 16 Jun 2023 07:56:32 +0000 (09:56 +0200)] 
test: clean up the new test case a bit

Follow-up to 61cecfa0d8.

2 years agoMerge pull request #27927 from Geass-LL/main
Lennart Poettering [Fri, 16 Jun 2023 07:38:53 +0000 (09:38 +0200)] 
Merge pull request #27927 from Geass-LL/main

core/unit: increase the GetNameOwner timeout to 90s

2 years agojournalctl: add --truncate-newline option
zhmylove [Tue, 30 Aug 2022 15:50:19 +0000 (18:50 +0300)] 
journalctl: add --truncate-newline option

2 years agocore/unit: increase the NameOwnerChanged/GetNameOwner timeout to the unit's start... 27927/head
licunlong [Wed, 24 May 2023 03:45:31 +0000 (11:45 +0800)] 
core/unit: increase the NameOwnerChanged/GetNameOwner timeout to the unit's start timeout

When dbus is overloaded, these messages are easily timedout,
systemd may kill dbus-type service by mistake. This PR
mitigates this problem by increasing the timeout to the
unit's start timeout.

2 years agocore/unit: add get_timeout_start_usec in UnitVTable and define it for service
licunlong [Thu, 15 Jun 2023 02:47:32 +0000 (10:47 +0800)] 
core/unit: add get_timeout_start_usec in UnitVTable and define it for service

2 years agoMerge pull request #28053 from mrc0mmand/assorted-fixes
Luca Boccassi [Fri, 16 Jun 2023 00:21:22 +0000 (01:21 +0100)] 
Merge pull request #28053 from mrc0mmand/assorted-fixes

A bunch of typo fixes and code cleanups

2 years agofind-esp: fix XBOOTLDR stx_dev_major=0 and not btrfs fix
наб [Thu, 15 Jun 2023 13:04:32 +0000 (15:04 +0200)] 
find-esp: fix XBOOTLDR stx_dev_major=0 and not btrfs fix

The original commit is fully correct in its analysis, description, and
mechanics, but the patch changes an identical condition around line 500
(find_esp_and_warn()), instead of line 800 (find_xbootldr_and_warn()).

The internal patch I distributed to testers was correct (L800), and
neither the reviewers, nor me, caught that I wrote the wrong line for
upstream submission. I've re-checked that this patch applied to
systemd 252.11-1 fixes the issue.

Keep the -ENOTTY condition for find_esp_and_warn(), since the conditions
are clearly supposed to be the same and similar semantics apply.

Fixes: commit ed89819f8fd7bfe99cd652082076e85e1417e4e9 ("find-esp: don't
 silently error bootctl install if presumed XBOOTLDR part is
 stx_dev_major=0 but not btrfs")

2 years agocore: fix post-fork memory leak
Luca Boccassi [Thu, 15 Jun 2023 18:20:05 +0000 (19:20 +0100)] 
core: fix post-fork memory leak

Doesn't matter really, but it is caught by ASAN when things fail
and there's no execve, so fix it.

https://jenkins-systemd.apps.ocp.cloud.ci.centos.org/job/upstream-vagrant-archlinux-sanitizers/3245/console

2 years agoudev: use timestamp_is_set() in one more place 28053/head
Frantisek Sumsal [Thu, 15 Jun 2023 18:49:24 +0000 (20:49 +0200)] 
udev: use timestamp_is_set() in one more place

2 years agoaudit-util,varlink: use IOVEC_MAKE() in a couple more places
Frantisek Sumsal [Thu, 15 Jun 2023 18:45:32 +0000 (20:45 +0200)] 
audit-util,varlink: use IOVEC_MAKE() in a couple more places

2 years agotree-wide: fix a couple of typos
Frantisek Sumsal [Thu, 15 Jun 2023 18:37:55 +0000 (20:37 +0200)] 
tree-wide: fix a couple of typos

As reported by Fossies.org.

2 years agoUpdate badge on README to refer new scorecard viewer (#28050)
Joyce [Thu, 15 Jun 2023 18:24:32 +0000 (15:24 -0300)] 
Update badge on README to refer new scorecard viewer (#28050)

* Update scorecard badge on README.md

Signed-off-by: Joyce <joycebrum@google.com>
2 years agotest: set $PATH to something predictable in the ASan wrapper
Frantisek Sumsal [Thu, 15 Jun 2023 11:11:24 +0000 (13:11 +0200)] 
test: set $PATH to something predictable in the ASan wrapper

This is still necessary when running with clang's ASan, as it uses an
external binary to symbolize the stack traces.

Follow-up to ba79e8c2ccd.

2 years agosystemctl: let's emphasize a bit that halt/poweroff/reboot/shutdown are compat commands
Lennart Poettering [Thu, 15 Jun 2023 08:40:31 +0000 (10:40 +0200)] 
systemctl: let's emphasize a bit that halt/poweroff/reboot/shutdown are compat commands

Let's try to make clear that these calls really should not be extended
anymore, but remain as the compat glue they are but not more.

Anything new should really be added to systemctl poweroff/halt/reboot,
which is actually defined and owned by us.

This is added in light of a9c3cc8db02dc36d41b17d0bbf1e02500046e4ce which
really shouldn't have been added I am sure.

This adds two things: a note to the --help text that people use the
relevant systemctl commands instead (as they are a lot more powerful,
for example give you inhibitor and boot loader control, kexec, and so
on). And a note to developers that they stop adding new stuff to the
compat interfaces.

2 years agoupdate TODO
Lennart Poettering [Thu, 15 Jun 2023 11:43:54 +0000 (13:43 +0200)] 
update TODO

2 years agoexecute: fix the condition of private mounts for user namespacing
Haochen Tong [Wed, 14 Jun 2023 15:55:56 +0000 (23:55 +0800)] 
execute: fix the condition of private mounts for user namespacing

Follow-up for: 6ef721cbc7dadee4ae878ecf0076d87e57233908

2 years agosd-bus: make bus_add_match_full accept timeout
licunlong [Thu, 15 Jun 2023 08:28:28 +0000 (16:28 +0800)] 
sd-bus: make bus_add_match_full accept timeout

2 years agokernel-install: skip to read /etc/machine-info in test
Yu Watanabe [Thu, 15 Jun 2023 05:00:09 +0000 (14:00 +0900)] 
kernel-install: skip to read /etc/machine-info in test

We do not provide any way to override /etc/machine-info.
As the file is deprecated in kernel-install, let's skip to read it when
we test kernel-install.

Fixes #28011.

2 years agonetwork: make degraded-carrier bond/bridge as routable (#27776)
Henrik Holst [Thu, 15 Jun 2023 04:32:10 +0000 (06:32 +0200)] 
network: make degraded-carrier bond/bridge as routable (#27776)

This makes a bond or bridge interface in the degraded-carrier state but has a routable address
handled as routable operational state.

If the carrier is degraded but the address state is routable then the operational state should be
seen as routable and not degraded because that may be the case for bonds if some of the links are down,
but when that happens the bond as whole is still routable.

This also makes operational state to degraded if address state is degraded even if the link state is
degraded-carrier.

Fixes #22713.

2 years agoMerge pull request #28038 from mrc0mmand/cleanups
Luca Boccassi [Wed, 14 Jun 2023 22:18:04 +0000 (23:18 +0100)] 
Merge pull request #28038 from mrc0mmand/cleanups

A couple of cleanups

2 years agoSquashed commit of the following:
Joyce Brum [Wed, 14 Jun 2023 17:35:17 +0000 (14:35 -0300)] 
Squashed commit of the following:

commit ef2fc83647f69c172c11e0dea318bf6ecf79a4aa
Author: Joyce <joycebrum@google.com>
Date:   Wed Jun 14 12:18:23 2023 -0300

    Update scorecards.yml

Signed-off-by: Joyce <joycebrum@google.com>
commit c59c05c6ab156b20249e8056d8cbaafbe0c495f8
Merge: 7431a54568 f66d040d95
Author: Joyce <joycebrum@google.com>
Date:   Wed Jun 14 10:22:28 2023 -0300

    Merge branch 'main' into fix/disable-code-scanning-alerts

commit 7431a54568746a2fa4db1b23e1359984335df41e
Author: Joyce <joycebrum@google.com>
Date:   Tue Jun 13 18:15:21 2023 -0300

    Remove code scanning alerts scorecards.yml

Signed-off-by: Joyce <joycebrum@google.com>
Signed-off-by: Joyce Brum <joycebrum@google.com>
2 years agoMerge pull request #28036 from medhefgo/meson
Luca Boccassi [Wed, 14 Jun 2023 19:12:35 +0000 (20:12 +0100)] 
Merge pull request #28036 from medhefgo/meson

meson: Minor improvements

2 years agoactivate: rename to socket-activate 28038/head
Frantisek Sumsal [Wed, 14 Jun 2023 09:59:04 +0000 (11:59 +0200)] 
activate: rename to socket-activate

To make the naming consistent with the rest of the utils, i.e. binary
name minus the systemd- prefix.

2 years agotest: split TEST-04 into smaller chunks
Frantisek Sumsal [Wed, 14 Jun 2023 18:04:04 +0000 (20:04 +0200)] 
test: split TEST-04 into smaller chunks

2 years agotest: exit on first failing subtest
Frantisek Sumsal [Wed, 14 Jun 2023 18:14:25 +0000 (20:14 +0200)] 
test: exit on first failing subtest

Let's take a step back and revert back to the original behavior where we
exit on a first failing subtest. The current behavior makes fishing out the
failing test details quite unpleasant, and in certain situations the
journal may even be rotated away so we end up with no actionable logs.

2 years agomkfs-util: Hide /proc/self/mounts before running mkfs
Daan De Meyer [Wed, 14 Jun 2023 08:27:22 +0000 (10:27 +0200)] 
mkfs-util: Hide /proc/self/mounts before running mkfs

mkfs.btrfs refuses to operate on a block device with mounted
partitions, even if doing so is perfectly safe. An example when
this happens is when using systemd-repart with it's --image switch
to add a root partition to a /usr only image. As a workaround until
the issue is fixed, let's hide the information on mounted filesystems
from mkfs.btrfs so it doesn't fail and formats the new filesystem as
expected.

2 years agoresolvectl: fix double free issue
Lennart Poettering [Wed, 14 Jun 2023 12:59:54 +0000 (14:59 +0200)] 
resolvectl: fix double free issue

Follow-up for: #28012

Addresses these: https://github.com/systemd/systemd/pull/28012#issuecomment-1590889386

2 years agobootctl: warn if the ESP random seed is stored on a world-readable dir
Lennart Poettering [Tue, 13 Jun 2023 14:48:20 +0000 (16:48 +0200)] 
bootctl: warn if the ESP random seed is stored on a world-readable dir

This takes heavy inspiration from @zx2c4 (Jason A. Donenfeld)'s
PR #25531 but changes it considerably, but always going by fd instead of
paths, and only warning about the side file itself and the ESP mount
point, nothing else. This shuld be more than enough and should not be
brittle against concurrent path modifications.

Replaces: #25531

2 years agoMerge pull request #27946 from keszybz/ukify-genkey-verb
Zbigniew Jędrzejewski-Szmek [Wed, 14 Jun 2023 15:57:24 +0000 (17:57 +0200)] 
Merge pull request #27946 from keszybz/ukify-genkey-verb

Add 'genkey' verb to ukify

2 years agocoverage: fix build with g++
Frantisek Sumsal [Wed, 14 Jun 2023 08:01:15 +0000 (10:01 +0200)] 
coverage: fix build with g++

Guard the coverage-related shenanigans from g++ when building the one
C++ unit test we have, so we don't have to make it C++ compatible:

[1573/2109] Compiling C++ object test-bus-vtable-cc.p/src_libsystemd_sd-bus_test-bus-vtable-cc.cc.o
FAILED: test-bus-vtable-cc.p/src_libsystemd_sd-bus_test-bus-vtable-cc.cc.o
ccache c++ -Itest-bus-vtable-cc. ... -c ../src/libsystemd/sd-bus/test-bus-vtable-cc.cc
In file included from <command-line>:
../src/basic/coverage.h:17:15: error: ‘_Noreturn’ does not name a type
   17 | static inline _Noreturn void _coverage__exit(int status) {
      |               ^~~~~~~~~
../src/basic/coverage.h:46:29: error: conflicting declaration of ‘int _coverage_execveat(int, const char*, char* const*, char* const*, int)’ with ‘C’ linkage
   46 | #define execveat(d,p,a,e,f) _coverage_execveat(d, p, a, e, f)
      |                             ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:34:19: note: previous declaration with ‘C++’ linkage
   34 | static inline int _coverage_execveat(
      |                   ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:46:29: error: declaration of ‘int _coverage_execveat(int, const char*, char* const*, char* const*, int) noexcept’ has a different exception specifier
   46 | #define execveat(d,p,a,e,f) _coverage_execveat(d, p, a, e, f)
      |                             ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:34:19: note: from previous declaration ‘int _coverage_execveat(int, const char*, char* const*, char* const*, int)’
   34 | static inline int _coverage_execveat(
      |                   ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:58:24: error: conflicting declaration of ‘int _coverage_execvpe(const char*, char* const*, char* const*)’ with ‘C’ linkage
   58 | #define execvpe(f,a,e) _coverage_execvpe(f, a, e)
      |                        ^~~~~~~~~~~~~~~~~
../src/basic/coverage.h:48:19: note: previous declaration with ‘C++’ linkage
   48 | static inline int _coverage_execvpe(
      |                   ^~~~~~~~~~~~~~~~~
../src/basic/coverage.h:58:24: error: declaration of ‘int _coverage_execvpe(const char*, char* const*, char* const*) noexcept’ has a different exception specifier
   58 | #define execvpe(f,a,e) _coverage_execvpe(f, a, e)
      |                        ^~~~~~~~~~~~~~~~~
../src/basic/coverage.h:48:19: note: from previous declaration ‘int _coverage_execvpe(const char*, char* const*, char* const*)’
   48 | static inline int _coverage_execvpe(
      |                   ^~~~~~~~~~~~~~~~~
[1582/2109] Compiling C object test-event.p/src_libsystemd_sd-event_test-event.c.o
ninja: build stopped: subcommand failed.

2 years agomeson: Use build_tgt.name() 28036/head
Jan Janssen [Wed, 14 Jun 2023 14:10:55 +0000 (16:10 +0200)] 
meson: Use build_tgt.name()

2 years agomeson: Use fs module in more places
Jan Janssen [Wed, 14 Jun 2023 14:05:52 +0000 (16:05 +0200)] 
meson: Use fs module in more places

2 years agosleep-config: add comment about security
Christoph Anton Mitterer [Sun, 26 Mar 2023 02:31:38 +0000 (04:31 +0200)] 
sleep-config: add comment about security

Adds information about attacks that might become possible when the hibernate
location is automatically determined.

2 years agoMerge pull request #28032 from poettering/mumumµ
Lennart Poettering [Wed, 14 Jun 2023 12:00:10 +0000 (14:00 +0200)] 
Merge pull request #28032 from poettering/mumumµ

deal with µ unicode ambiguities

2 years agoukify: make the certficate validity configurable 27946/head
Zbigniew Jędrzejewski-Szmek [Wed, 14 Jun 2023 10:38:37 +0000 (12:38 +0200)] 
ukify: make the certficate validity configurable

Requested in https://github.com/systemd/systemd/pull/27946/commits/4cc743319ae378d458050d6e0cfdeaa03addd379#r1228592001

2 years agoman/ukify: add structure to describe verbs, document genkey
Zbigniew Jędrzejewski-Szmek [Mon, 12 Jun 2023 10:22:32 +0000 (12:22 +0200)] 
man/ukify: add structure to describe verbs, document genkey

This just adds two paragraphs of text, but moves a lot of the text
one level down into a subsection.

2 years agotest_ukify: skip test requiring cryptography
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jun 2023 08:05:02 +0000 (10:05 +0200)] 
test_ukify: skip test requiring cryptography

I'll add the dep in Fedora spec so it does get tested at least
in some cases.

2 years agoman: add example how to configure automatic signing
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 19:31:17 +0000 (21:31 +0200)] 
man: add example how to configure automatic signing

Fixes #978.

2 years agotest_ukify: cleanups suggested by pylint
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 19:07:58 +0000 (21:07 +0200)] 
test_ukify: cleanups suggested by pylint

2 years agoukify: add 'genkey' verb
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 19:06:20 +0000 (21:06 +0200)] 
ukify: add 'genkey' verb

The idea is to make it easy to generate all the signing key and certs
that can be used for local signing. The verb is the modeled after
'mkosi genkey', but there are some important differences: we generate
the keys to the paths where they will be read from, both pcr signing
keys and the SecureBoot certificate+key.

If any of the outputs exist, operation is refused. Maybe we could add a
--force option in the future, but this operation should be rare, so I think
it's better to refuse to overwrite anything initially.

I'm only doing a token man page change here.
https://github.com/systemd/systemd/pull/27621 reworks the man page,
and the changes done here would conflict heavily with that work. I'll
submit a follow-up patch later.

2 years agobootctl: fix docs/--help to say that "bootctl random-seed" not just initializes but...
Lennart Poettering [Tue, 13 Jun 2023 14:47:36 +0000 (16:47 +0200)] 
bootctl: fix docs/--help to say that "bootctl random-seed" not just initializes but also refreshes ESP random seeds

2 years agoMerge pull request #28012 from poettering/resolvectl-dump-cache
Lennart Poettering [Wed, 14 Jun 2023 08:33:13 +0000 (10:33 +0200)] 
Merge pull request #28012 from poettering/resolvectl-dump-cache

add "resolvectl show-cache" call and IPC backend for that

2 years agotree-wide: when in doubt use greek small letter mu rather than micro symbol 28032/head
Lennart Poettering [Wed, 14 Jun 2023 08:13:08 +0000 (10:13 +0200)] 
tree-wide: when in doubt use greek small letter mu rather than micro symbol

Doesn't really matter since the two unicode symbols are supposedly
equivalent, but let's better follow the unicode recommendations to
prefer greek small letter mu, as per:

https://www.unicode.org/reports/tr25

2 years agotime-util,socket: accept both kinds of unicode µ symbols
Lennart Poettering [Wed, 14 Jun 2023 08:09:22 +0000 (10:09 +0200)] 
time-util,socket: accept both kinds of unicode µ symbols

Apparently there are two µ symbols, accept both when parsing.

One is the greek small letter mu (μ) the other is the micro sign (µ).
Unicode recommendation considers both equivalent, and says use of greek
small letter mu is preferred. See:

https://www.unicode.org/reports/tr25

Hence accept both when parsing.

Inspired by: #28029

2 years agoMerge pull request #26728 from keszybz/meson-update
Lennart Poettering [Tue, 13 Jun 2023 21:38:41 +0000 (23:38 +0200)] 
Merge pull request #26728 from keszybz/meson-update

Meson version update

2 years agoFix scorecard version comment format (#28027)
Joyce [Tue, 13 Jun 2023 21:36:32 +0000 (18:36 -0300)] 
Fix scorecard version comment format (#28027)

* Update scorecards.yml version comments

Signed-off-by: Joyce <joycebrum@google.com>
2 years agoMerge pull request #27846 from keszybz/link-mode-generation
Lennart Poettering [Tue, 13 Jun 2023 21:03:51 +0000 (23:03 +0200)] 
Merge pull request #27846 from keszybz/link-mode-generation

Autogenerate list of link modes

2 years agopo: Translated using Weblate (Korean)
김인수 [Tue, 13 Jun 2023 20:18:12 +0000 (22:18 +0200)] 
po: Translated using Weblate (Korean)

Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: 김인수 <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main

2 years agoudev-node: optimize device node symlink creation
Yu Watanabe [Fri, 13 Jan 2023 04:25:43 +0000 (13:25 +0900)] 
udev-node: optimize device node symlink creation

If multiple devices requested the same device node symlink with the same
priority, then previously we read O(N^2) of files saved in
/run/udev/links.

This makes if the requested symlink already exists with equal or higher
priority, then the symlink is kept, and skip to read all existing files,
except for one related to the current device node, in /run/udev/links.
Hence, the total amount of file read becomes O(N).

This improves performance of testcase_simultaneous_events_2 added by the
previous commit about 30%.
Before (32.8 sec):
```
 ## 3 iterations start: 11:13:44.690953163
 ## 3 iterations end: 11:14:17.493974927
```
After (23.8 sec):
```
 ## 3 iterations start: 11:17:53.869938387
 ## 3 iterations end: 11:18:17.624268345
```

This is based on the idea and analysis by Franck Bui.

Replaces #25839.

Co-authored-by: Franck Bui <fbui@suse.com>
2 years agoit.po: minor updates
Daniele Medri [Mon, 5 Jun 2023 16:06:41 +0000 (18:06 +0200)] 
it.po: minor updates

2 years agoMerge pull request #28020 from DaanDeMeyer/followups
Lennart Poettering [Tue, 13 Jun 2023 20:14:33 +0000 (22:14 +0200)] 
Merge pull request #28020 from DaanDeMeyer/followups

Followups

2 years agoMerge pull request #27952 from mrc0mmand/drop-TEST-61
Luca Boccassi [Tue, 13 Jun 2023 20:13:14 +0000 (21:13 +0100)] 
Merge pull request #27952 from mrc0mmand/drop-TEST-61

test: merge TEST-61-UNITTESTS-QEMU with TEST-02-UNITTESTS

2 years agoMerge pull request #27977 from DaanDeMeyer/update-mkosi
Daan De Meyer [Tue, 13 Jun 2023 14:56:54 +0000 (16:56 +0200)] 
Merge pull request #27977 from DaanDeMeyer/update-mkosi

Update mkosi

2 years agoman: document "s" is default --vacuum-time= suffix
Anatoli Babenia [Sun, 30 Oct 2022 14:06:38 +0000 (17:06 +0300)] 
man: document "s" is default --vacuum-time= suffix

2 years agorm-rf: Fix assertion 28020/head
Daan De Meyer [Tue, 13 Jun 2023 14:01:17 +0000 (16:01 +0200)] 
rm-rf: Fix assertion

This doesn't cover every case but cases where people try to do
rm_rf(dir_fd, ".") are covered by unlinkat() simply failing.

2 years agofd-util: Add extra shortcut to path_is_root_at()
Daan De Meyer [Tue, 13 Jun 2023 13:54:21 +0000 (15:54 +0200)] 
fd-util: Add extra shortcut to path_is_root_at()

2 years agobtrfs-util: Drop redundant parentheses
Daan De Meyer [Tue, 13 Jun 2023 13:53:15 +0000 (15:53 +0200)] 
btrfs-util: Drop redundant parentheses

2 years agorepart: Store dm_name in DecryptedPartitionTarget
Daan De Meyer [Tue, 13 Jun 2023 13:52:03 +0000 (15:52 +0200)] 
repart: Store dm_name in DecryptedPartitionTarget

This means we don't have to do a fallible allocation in the
DecryptedPartitionTarget destructor. Also use log_warning_error_errno()
for the failure we ignore in the destructor.

2 years agomkosi: Remove explicit /testok check 27977/head
Daan De Meyer [Thu, 8 Jun 2023 15:50:05 +0000 (17:50 +0200)] 
mkosi: Remove explicit /testok check

vsock should work properly after the latest release of mkosi. But
to make sure it works, let's exit with 123 in case of success and
check for that in Github Actions.

2 years agomkosi: Update to latest
Daan De Meyer [Thu, 8 Jun 2023 15:49:21 +0000 (17:49 +0200)] 
mkosi: Update to latest

We update our configuration to replace the removed
RepositoryDirectories= option with the new PackageManagerTrees=
option.

2 years agomkosi: Make sure we build custom kernels with EROFS support
Daan De Meyer [Thu, 8 Jun 2023 14:33:00 +0000 (16:33 +0200)] 
mkosi: Make sure we build custom kernels with EROFS support

2 years agomkosi: Add bpftool to final image
Daan De Meyer [Mon, 12 Jun 2023 12:40:54 +0000 (14:40 +0200)] 
mkosi: Add bpftool to final image

Useful for debugging bpf.

2 years agomkosi: Add socat to the final image
Daan De Meyer [Thu, 8 Jun 2023 14:32:24 +0000 (16:32 +0200)] 
mkosi: Add socat to the final image

Useful for debugging vsock stuff

2 years agoMerge pull request #28010 from DaanDeMeyer/vsock-type
Daan De Meyer [Tue, 13 Jun 2023 13:41:58 +0000 (15:41 +0200)] 
Merge pull request #28010 from DaanDeMeyer/vsock-type

Vsock improvements

2 years agoudevadm-control: fix error message
David Tardon [Tue, 13 Jun 2023 13:31:20 +0000 (15:31 +0200)] 
udevadm-control: fix error message

Extracted from #25523 by Lennart.

2 years agosd-daemon: Add vsock fallback to SOCK_STREAM 28010/head
Daan De Meyer [Tue, 13 Jun 2023 08:26:00 +0000 (10:26 +0200)] 
sd-daemon: Add vsock fallback to SOCK_STREAM

SOCK_SEQPACKET is only supported on recent kernels. Let's add a
fallback to SOCK_STREAM if it is not supported.

To accomodate SOCK_STREAM, we also modify
pid_notify_with_fds_internal() to do sendmsg() in a loop as with
SOCK_STREAM, sendmsg() is not guaranteed to write all data in a single
syscall or fail otherwise.

2 years agosd-daemon: Use socket type from vsock address if set
Daan De Meyer [Mon, 12 Jun 2023 16:21:08 +0000 (18:21 +0200)] 
sd-daemon: Use socket type from vsock address if set

If a socket type is explicitly provided in the vsock address, let's
make sure we try only that socket type.

2 years agosocket-util: Allow specifying socket type in vsock address
Daan De Meyer [Tue, 13 Jun 2023 08:03:44 +0000 (10:03 +0200)] 
socket-util: Allow specifying socket type in vsock address

2 years agosocket: bump listen() backlog to INT_MAX everywhere
Lennart Poettering [Tue, 13 Jun 2023 08:15:59 +0000 (10:15 +0200)] 
socket: bump listen() backlog to INT_MAX everywhere

This is a rework of #24764 by Cristian Rodríguez
<crodriguez@owncloud.com>, which stalled.

Instead of assigning -1 we'll use a macro defined to INT_MAX however.

2 years agoMerge pull request #28014 from bluca/portable_fixes
Lennart Poettering [Tue, 13 Jun 2023 11:19:02 +0000 (13:19 +0200)] 
Merge pull request #28014 from bluca/portable_fixes

portabled fixes

2 years agoMerge pull request #28017 from poettering/link-tmpfile-flags
Lennart Poettering [Tue, 13 Jun 2023 11:18:42 +0000 (13:18 +0200)] 
Merge pull request #28017 from poettering/link-tmpfile-flags

teach link_tmpfile_at() to properly sync

2 years agoportable: make sure to fsync after extracting/copying 28014/head
Luca Boccassi [Mon, 12 Jun 2023 22:51:51 +0000 (23:51 +0100)] 
portable: make sure to fsync after extracting/copying

Just in case we are on a flimsy filesystem/disk

2 years agotest: re-enable TEST-02 on ppc64le 27952/head
Frantisek Sumsal [Mon, 12 Jun 2023 13:43:54 +0000 (15:43 +0200)] 
test: re-enable TEST-02 on ppc64le

2 years agotest: make sure ping works for unprivileged users
Frantisek Sumsal [Mon, 12 Jun 2023 12:13:25 +0000 (14:13 +0200)] 
test: make sure ping works for unprivileged users

2 years agotest: copy file xattrs (if any) as well
Frantisek Sumsal [Mon, 12 Jun 2023 11:21:11 +0000 (13:21 +0200)] 
test: copy file xattrs (if any) as well

2 years agotest: merge TEST-61-UNITTESTS-QEMU with TEST-02-UNITTESTS
Frantisek Sumsal [Wed, 7 Jun 2023 11:51:02 +0000 (13:51 +0200)] 
test: merge TEST-61-UNITTESTS-QEMU with TEST-02-UNITTESTS

The test was originally introduced for Ubuntu CI, as it uses
PREFER_NSPAWN=1, but it was subsequently disabled two years ago [0], so
it was pretty much useless. Let's merge it into TEST-02 and tweak it a
bit to run only certain tests under QEMU when $TEST_PREFER_NSPAWN is
set.

[0] b152adbfa9b708dade8559b9962241902bf2eb7c

2 years agoproc-cmdline: parse the whole /proc/cmdline
Frantisek Sumsal [Mon, 12 Jun 2023 19:05:30 +0000 (21:05 +0200)] 
proc-cmdline: parse the whole /proc/cmdline

The kernel command line may contain newlines which kernel happily
accepts, but we'd ignore everything past the first newline. Let's fix
that by replacing read_one_line_file() with read_full_file().

2 years agotree-wide: start properly syncing at various places we so far didn't 28017/head
Lennart Poettering [Tue, 13 Jun 2023 07:49:50 +0000 (09:49 +0200)] 
tree-wide: start properly syncing at various places we so far didn't

Let's better be safe than sorry, and install files fully safely now that
is is easy.

2 years agocoredump: port over code to new LINK_TMPFILE_SYNC flag
Lennart Poettering [Tue, 13 Jun 2023 07:49:35 +0000 (09:49 +0200)] 
coredump: port over code to new LINK_TMPFILE_SYNC flag

2 years agotmpfile-util: add new LINK_TMPFILE_SYNC flag for syncing properly before/after linkin...
Lennart Poettering [Tue, 13 Jun 2023 07:45:39 +0000 (09:45 +0200)] 
tmpfile-util: add new LINK_TMPFILE_SYNC flag for syncing properly before/after linking in the file

This syncs the data before linking it in, and both data + dir once done.
This should give us proper semantics for installing files safely into
the fs.

2 years agotmpfile-util: turn last parameter of link_tmpfile() into a proper flags
Lennart Poettering [Tue, 13 Jun 2023 07:40:53 +0000 (09:40 +0200)] 
tmpfile-util: turn last parameter of link_tmpfile() into a proper flags

This changes a boolean param into a proper bitflag field.

Given this only defines a single flag for now this doesn't look like
much of an improvement. But we'll add another flag shortly, where it
starts to make more sense.

2 years agoportable: do not extract empty unit files
Luca Boccassi [Mon, 12 Jun 2023 22:47:03 +0000 (23:47 +0100)] 
portable: do not extract empty unit files

Bare minimum sanity check, an empty unit is an invalid unit so
skip it early.

2 years agoupdate TODO
Lennart Poettering [Mon, 12 Jun 2023 21:00:47 +0000 (23:00 +0200)] 
update TODO

2 years agoresolvectl: add resolvectl command for dumping cache contents 28012/head
Lennart Poettering [Mon, 12 Jun 2023 14:46:04 +0000 (16:46 +0200)] 
resolvectl: add resolvectl command for dumping cache contents

A wrapper around the new varlink call, showing the data either in its
native JSON or in a more human readable textual form.

2 years agoresolved: add DNS_RESOURCE_KEY_TO_STRING() macro helper
Lennart Poettering [Mon, 12 Jun 2023 14:45:25 +0000 (16:45 +0200)] 
resolved: add DNS_RESOURCE_KEY_TO_STRING() macro helper

This does the usual compound init trick to get formatted strings of
stuff.

We should probably port various pieces of code over to using this.

2 years agoresolved: add dns_resource_key_from_json() helper
Lennart Poettering [Mon, 12 Jun 2023 14:44:40 +0000 (16:44 +0200)] 
resolved: add dns_resource_key_from_json() helper

It reverse what dns_resource_key_to_json(), i.e. turns JSON data into a
parsed DnsResourceKey object.

Ultimately this just moves a client-side local wrapper into generic
code. Nothing truly new here.

2 years agoresolved: add DumpCache varlink call for acquiring a complete dump of all of resolved...
Lennart Poettering [Mon, 12 Jun 2023 14:40:59 +0000 (16:40 +0200)] 
resolved: add DumpCache varlink call for acquiring a complete dump of all of resolved's RR caches

This adds a simple varlink call io.systemd.Resolve.Monitor.DumpCache to
the existing io.systemd.Resolve.Monitor service. It compiles a JSON
object containing the per-scope cache entries and returns it.

Replaces: #20053 #19104

Fixes: #14796
2 years agoboot: Unify protocol opening
Jan Janssen [Mon, 12 Jun 2023 13:12:05 +0000 (15:12 +0200)] 
boot: Unify protocol opening

We are using HandleProtocol everywhere except in these few cases. This
unifies on HandleProtocol as it is simpler to use and equivalent to
OpenProtocol.

The only difference between the two is that OpenProtocol attributes the
opened protocol to a firmware-owned handle instead of our image handle.
This has no real use for regular UEFI applications as any protocols
opened via BY_HANDLE or GET_PROTOCOL is not required to be closed. In
fact, when a protocol is uninstalled it will do nothing more than reduce
the open count for these.

2 years agojson: add json_dispatch_variant_noref() helper
Lennart Poettering [Mon, 12 Jun 2023 14:37:37 +0000 (16:37 +0200)] 
json: add json_dispatch_variant_noref() helper

This is identical to json_dispatch_variant() but doesn't increase the
ref counter of the variant. This is useful for taking JSON objects apart
locally without the intention to keep any component pinned for longer
than the local stack frame.

2 years agoman: explain timesyncd epoch mtime touch files in a bit more detail
Lennart Poettering [Mon, 12 Jun 2023 12:06:10 +0000 (14:06 +0200)] 
man: explain timesyncd epoch mtime touch files in a bit more detail

Let's mention what /usr/lib/clock-epoch precisely does, and underline we
only *advance* the time based on it.

Inspired by Darkdragon-001's #23214.

Replaces #23214

2 years agoMerge pull request #27989 from poettering/message-append-string-set
Lennart Poettering [Mon, 12 Jun 2023 12:12:05 +0000 (14:12 +0200)] 
Merge pull request #27989 from poettering/message-append-string-set

common helpers for serializing Set of strings into bus message

2 years agobus-util: add bus_property_get_string_set() helper 27989/head
Lennart Poettering [Fri, 9 Jun 2023 19:45:31 +0000 (21:45 +0200)] 
bus-util: add bus_property_get_string_set() helper

This is a common implementation of a property getter for a Set of
strings.

2 years agobus-util: add bus_message_append_string_set() helper
Lennart Poettering [Fri, 9 Jun 2023 17:12:51 +0000 (19:12 +0200)] 
bus-util: add bus_message_append_string_set() helper

This new helper adds all strings from a Set object as a string array to
a message.

Various places where we have similar code are then ported over to this.

2 years agoukify: move verb mangling to finalize_options()
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jun 2023 07:10:49 +0000 (09:10 +0200)] 
ukify: move verb mangling to finalize_options()

This simplifies the logic: finalize_options() is the step that does the
checks and the mangling. The checks for consistency are done in more places,
so we need to pass a verb (we only have 'build', but once we add other verbs,
any would do).

2 years agoukify: split out iteration over phase path groups and keys
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 19:03:10 +0000 (21:03 +0200)] 
ukify: split out iteration over phase path groups and keys

In preparation for future changes.

2 years agoman,test: root or hardware is not needed for ukify
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 18:32:33 +0000 (20:32 +0200)] 
man,test: root or hardware is not needed for ukify

2 years agoukify: fix synopsis in --help
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 18:27:48 +0000 (20:27 +0200)] 
ukify: fix synopsis in --help

Missed in a3b227d28a823d59e3281109f5369d0f63b40f62.