]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
16 months agoci: add small test case for /dev/urandom as source for CopyBlocks= 33003/head
Lennart Poettering [Tue, 25 Jun 2024 08:24:47 +0000 (10:24 +0200)] 
ci: add small test case for /dev/urandom as source for CopyBlocks=

16 months agorepart: show progress bar when initializing partition via CopyBlocks=
Lennart Poettering [Fri, 24 May 2024 12:00:21 +0000 (14:00 +0200)] 
repart: show progress bar when initializing partition via CopyBlocks=

This might take a while, hence make it pretty.

16 months agorepart: allow reading from char device for CopyBlocks=
Lennart Poettering [Fri, 24 May 2024 11:57:56 +0000 (13:57 +0200)] 
repart: allow reading from char device for CopyBlocks=

Sometimes it is useful to allow initializing a partition with randomized
data, hence allow reading from a char device as source for CopyBlocks=

16 months agorepart: make prefix argument to clear_progress_bar() optional
Lennart Poettering [Fri, 24 May 2024 11:56:47 +0000 (13:56 +0200)] 
repart: make prefix argument to clear_progress_bar() optional

In this case, let's try to override the whole line, not just the first
few chars.

16 months agoMerge pull request #33461 from poettering/boot-measured-flag-rework
Lennart Poettering [Tue, 25 Jun 2024 07:48:38 +0000 (09:48 +0200)] 
Merge pull request #33461 from poettering/boot-measured-flag-rework

stub: rework how we combine the "measured" flags in sd-stub

16 months agoMerge pull request #33454 from YHNdnzj/user-service-working-dir-relax
Luca Boccassi [Mon, 24 Jun 2024 22:48:37 +0000 (00:48 +0200)] 
Merge pull request #33454 from YHNdnzj/user-service-working-dir-relax

core: verify WorkingDirectory= is outside of API VFS only under mount namespacing

16 months agostub: fix reporting of dtb measurement 33461/head
Lennart Poettering [Mon, 24 Jun 2024 10:52:57 +0000 (12:52 +0200)] 
stub: fix reporting of dtb measurement

Let's properly return the measurement flag tristate, rather than a
boolean. Otherwise we'll mistake "nothing to measure" as "not measured",
which are two different things, and means we'll miscombine the flag
later, claiming to userspace that we measured no dtb data even if there
was.

16 months agostub: unify how we combine 'measured' flags
Lennart Poettering [Mon, 24 Jun 2024 10:44:32 +0000 (12:44 +0200)] 
stub: unify how we combine 'measured' flags

We have the same non-trivial ternary op expression at various places,
let's unify it in one call, to make this easier to read and remove
duplication.

16 months agouefi: drop redundant local variable
Lennart Poettering [Mon, 24 Jun 2024 15:38:29 +0000 (17:38 +0200)] 
uefi: drop redundant local variable

16 months agouefi: drop ill-placed empty line
Lennart Poettering [Mon, 24 Jun 2024 10:52:38 +0000 (12:52 +0200)] 
uefi: drop ill-placed empty line

Let's not place empty lines between function calls and their immediate
error handling.

16 months agologin: Add a new SecureAttentionKey dbus signal when Ctrl+Alt+Shift+Esc is pressed
nerdopolis [Tue, 12 Mar 2024 02:09:07 +0000 (22:09 -0400)] 
login: Add a new SecureAttentionKey dbus signal when Ctrl+Alt+Shift+Esc is pressed

16 months agoMerge pull request #33042 from poettering/machined-unpriv
Luca Boccassi [Mon, 24 Jun 2024 18:45:37 +0000 (20:45 +0200)] 
Merge pull request #33042 from poettering/machined-unpriv

machined: unprivileged machine registration

16 months agoMerge pull request #33000 from poettering/ssh-proxy-machine
Luca Boccassi [Mon, 24 Jun 2024 18:35:07 +0000 (20:35 +0200)] 
Merge pull request #33000 from poettering/ssh-proxy-machine

systemd-ssh-proxy: look for VSOCK CIDs in machined

16 months agoMerge pull request #33466 from YHNdnzj/open-file-graceful-log
Yu Watanabe [Mon, 24 Jun 2024 18:26:04 +0000 (03:26 +0900)] 
Merge pull request #33466 from YHNdnzj/open-file-graceful-log

core/exec-invoke: clean up OpenFile= logging

16 months agoFix typo in CAP_BPF description (#33464)
Eugeny Shcheglov [Mon, 24 Jun 2024 18:23:50 +0000 (21:23 +0300)] 
Fix typo in CAP_BPF description (#33464)

description_good and description_bad are mixed up. Disabling CAP_BPF results in the inability to load BPF, not the other way around.

16 months agohwdb: fix keyboard of RedmiBook Pro 15 2022 (#33465)
oldherl [Mon, 24 Jun 2024 18:22:37 +0000 (04:22 +1000)] 
hwdb: fix keyboard of RedmiBook Pro 15 2022 (#33465)

Fix two problems of the keyboard of RedmiBook Pro 15 2022.
- Enter key in the main area was mapped to KP_Enter.
- When Fn is locked (to use F1-F12 without pressing Fn),
  Right Ctrl was mapped to Menu. Keeping it as Right Ctrl is more useful.

16 months agocore/exec-invoke: clean up OpenFile= logging 33466/head
Mike Yuan [Mon, 24 Jun 2024 16:30:00 +0000 (18:30 +0200)] 
core/exec-invoke: clean up OpenFile= logging

Make collect_open_file_fds() the only logging function,
and downgrade various usual errors to debug level
if OPENFILE_GRACEFUL is set.

Fixes #33458

16 months agocore/exec-invoke: reopen OpenFile= fds with O_NOCTTY
Mike Yuan [Mon, 24 Jun 2024 16:26:15 +0000 (18:26 +0200)] 
core/exec-invoke: reopen OpenFile= fds with O_NOCTTY

16 months agouefi: emphasize a bit that EV_IPL event logs is the past, EV_EVENT_TAG the future
Lennart Poettering [Mon, 24 Jun 2024 10:18:03 +0000 (12:18 +0200)] 
uefi: emphasize a bit that EV_IPL event logs is the past, EV_EVENT_TAG the future

16 months agocore: verify WorkingDirectory= is outside of API VFS only under mount namespacing 33454/head
Mike Yuan [Sun, 23 Jun 2024 16:12:33 +0000 (18:12 +0200)] 
core: verify WorkingDirectory= is outside of API VFS only under mount namespacing

The purpose of the check is to prevent leaking API VFS fds
from host into a mount namespace/container. When mountns
is not used at all, the check is pointless and causes
inconvenience. E.g. file managers might need to be spawned
under those directories, and they surely won't run in mountns.

Suggested in https://github.com/systemd/systemd/pull/33454#issuecomment-2186351467
Fixes #33361

16 months agocore/load-fragment: use ASSERT_PTR where appropriate
Mike Yuan [Sun, 23 Jun 2024 16:29:29 +0000 (18:29 +0200)] 
core/load-fragment: use ASSERT_PTR where appropriate

16 months agoMerge pull request #33401 from yuwata/journal-revert-source-boottime-timestamp
Mike Yuan [Mon, 24 Jun 2024 13:34:16 +0000 (15:34 +0200)] 
Merge pull request #33401 from yuwata/journal-revert-source-boottime-timestamp

journal: partially revert recent changes

16 months agoMerge pull request #33456 from yuwata/terminal-util
Mike Yuan [Mon, 24 Jun 2024 13:29:36 +0000 (15:29 +0200)] 
Merge pull request #33456 from yuwata/terminal-util

terminal-util: use colon as separator for specifying color

16 months agovmspawn: define QEMU_MACHINE_TYPE for loongarch64
Robin Lee [Mon, 24 Jun 2024 05:48:32 +0000 (13:48 +0800)] 
vmspawn: define QEMU_MACHINE_TYPE for loongarch64

Use ["virt"](https://www.qemu.org/docs/master/system/loongarch/virt.html) as a commonly used generic platform on loongarch64.

16 months agoterminal-util: several cleanups for ColorMode 33456/head
Yu Watanabe [Sun, 23 Jun 2024 19:18:04 +0000 (04:18 +0900)] 
terminal-util: several cleanups for ColorMode

- introduce or rename usual enum values _MAX and _INVALID,
- introduce and use string table lookup functions,
- split out implementation of get_color_mode() to _impl(),
- add tests for get_color_mode().

16 months agoterminal-util: merge COLOR_ON with COLOR_24BIT
Yu Watanabe [Sun, 23 Jun 2024 19:12:45 +0000 (04:12 +0900)] 
terminal-util: merge COLOR_ON with COLOR_24BIT

Currently, we assume that there is no restriction on coloring when
COLOR_24BIT. Let's merge the two values.

Follow-up for a5efbf468c96190c9562bc8121eda32310dfd112.

16 months agoterminal-util: use colon as separator for specifying color
Yu Watanabe [Mon, 24 Jun 2024 08:55:17 +0000 (17:55 +0900)] 
terminal-util: use colon as separator for specifying color

Then, terminal will safely ignore unsupported features, like colored
underline.

Fixes a regression caused by 891abc9cf1d3d7afd7b740b4077551dcfb5f8e16.
Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074073.
Fixes #33449.

16 months agoMerge pull request #33452 from bluca/repart_pkg
Luca Boccassi [Sun, 23 Jun 2024 12:19:30 +0000 (13:19 +0100)] 
Merge pull request #33452 from bluca/repart_pkg

mkosi: install new split-out systemd packages

16 months agomkosi: bump Debian Salsa commit to latest 33452/head
Luca Boccassi [Sun, 23 Jun 2024 09:20:27 +0000 (10:20 +0100)] 
mkosi: bump Debian Salsa commit to latest

16 months agomkosi: install new split-out systemd packages
Luca Boccassi [Sun, 23 Jun 2024 09:10:26 +0000 (10:10 +0100)] 
mkosi: install new split-out systemd packages

repart and cryptsetup tools were moved out of the main package
to reduce dependencies.

16 months agobus-unit-util: add PrivateTmpEx to bus_append_execute_property()
Mike Yuan [Sat, 22 Jun 2024 10:28:08 +0000 (12:28 +0200)] 
bus-unit-util: add PrivateTmpEx to bus_append_execute_property()

Follow-up for 9d50d053f327e5471a514bc36487bfc3358c15d8

16 months agohwdb: Fix Logitech G915 TKL (Bluetooth) appearing as a mouse
Stuart Hayhurst [Sat, 22 Jun 2024 19:25:21 +0000 (20:25 +0100)] 
hwdb: Fix Logitech G915 TKL (Bluetooth) appearing as a mouse

16 months agoman: fix double is typo in systemd-tmpfiles
Diego Viola [Sat, 22 Jun 2024 02:46:32 +0000 (23:46 -0300)] 
man: fix double is typo in systemd-tmpfiles

Signed-off-by: Diego Viola <diego.viola@gmail.com>
16 months agotree-wide: fix type of read() return variable at a couple of places
Lennart Poettering [Fri, 21 Jun 2024 07:41:43 +0000 (09:41 +0200)] 
tree-wide: fix type of read() return variable at a couple of places

read() returns ssize_t (i.e. 64bit typically). We assigned it to int
variables in some cases (i.e. 32bit typically). Let's not be so sloppy,
and not accidentally drop 32bit on the floor.

(of course, this is not an issue IRL since we'll not have allocations
above 2^32 ever we could read into, but still, let's clean this up)

16 months agovarlink: yet another fix around handling of IDL comments
Lennart Poettering [Fri, 21 Jun 2024 15:05:26 +0000 (17:05 +0200)] 
varlink: yet another fix around handling of IDL comments

Skip over them when validating a message against the IDL.

Add test case that tests this.

16 months agoMerge pull request #33439 from YHNdnzj/private-tmp-followup
Yu Watanabe [Sat, 22 Jun 2024 07:34:55 +0000 (16:34 +0900)] 
Merge pull request #33439 from YHNdnzj/private-tmp-followup

core: several follow-ups for recent changes to PrivateTmp

16 months agoMerge pull request #33408 from poettering/install-change-fix
Yu Watanabe [Sat, 22 Jun 2024 07:24:47 +0000 (16:24 +0900)] 
Merge pull request #33408 from poettering/install-change-fix

install: some follow-up fixes to #33254

16 months agoupdate TODO 33042/head
Lennart Poettering [Mon, 27 May 2024 14:43:13 +0000 (16:43 +0200)] 
update TODO

16 months agounits: register vmspawn VMs started via systemd-vmspawn@.service by default with...
Lennart Poettering [Mon, 27 May 2024 11:32:02 +0000 (13:32 +0200)] 
units: register vmspawn VMs started via systemd-vmspawn@.service by default with machined

16 months agovmspawn: by default, let machined register a cgroup for VMs
Lennart Poettering [Mon, 27 May 2024 11:30:31 +0000 (13:30 +0200)] 
vmspawn: by default, let machined register a cgroup for VMs

This mimics what we do in nspawn: if registration is enabled we'll let
machined allocate a scope unit for us. When --keep-unit is used we'll
register without creating a new scope.

This brings behaviour more inline with what nspawn does, exposing the
same sets of options.

16 months agonspawn: machine registration is now available unpriv
Lennart Poettering [Mon, 27 May 2024 11:30:11 +0000 (13:30 +0200)] 
nspawn: machine registration is now available unpriv

16 months agomachined: support allocating a scope for machines if needed via varlink
Lennart Poettering [Mon, 13 May 2024 13:07:09 +0000 (07:07 -0600)] 
machined: support allocating a scope for machines if needed via varlink

On dbus we have two apis: one for registering a new machne when the
client already has a cgroup (RegisterMachine()) and one where it doesn't
and machined shall create it (CreateMachine()).

Let's add the same for the varlink api. To simplify things we just
implement it via a boolean flag to the existign RegisterMachine()
varlink call, since the differences are mostly minor otherwise.

16 months agomachined: allow unprivileged registration of VMs/containers
Lennart Poettering [Sat, 11 May 2024 18:18:56 +0000 (20:18 +0200)] 
machined: allow unprivileged registration of VMs/containers

Now that we have a concept of unprivileged VMs and containers, let's
allow unprivileged clients to register with machined too – subject to
Polkit permissions.

16 months agocore: expose PrivateTmp=disconnected 33439/head
Mike Yuan [Tue, 18 Jun 2024 14:18:56 +0000 (16:18 +0200)] 
core: expose PrivateTmp=disconnected

As discussed in https://github.com/systemd/systemd/pull/32724#discussion_r1638963071

I don't find the opposite reasoning particularly convincing.
We have ProtectHome=tmpfs and friends, and those can be
pretty much trivially implemented through TemporaryFileSystem=
too. The new logic brings many benefits, and is completely generic,
hence I see no reason not to expose it. We can even get more tests
for the code path if we make it public.

16 months agotest: add some superficial integration tests 33000/head
Lennart Poettering [Thu, 23 May 2024 21:19:12 +0000 (23:19 +0200)] 
test: add some superficial integration tests

16 months agossh-proxy: add support for connecting to VMs by AF_VSOCK via "machine/…" host specs
Lennart Poettering [Sat, 11 May 2024 17:56:10 +0000 (19:56 +0200)] 
ssh-proxy: add support for connecting to VMs by AF_VSOCK via "machine/…" host specs

With this one can type "ssh machine/foobar" to connect to locally
registered machine "foobar" via SSH-over-AF_VSOCK.

16 months agomachined: add simple varlink API for listing machines
Lennart Poettering [Sat, 11 May 2024 17:55:15 +0000 (19:55 +0200)] 
machined: add simple varlink API for listing machines

16 months agojson: teach json_build() to serialize dual_timestamp structures reasonably
Lennart Poettering [Fri, 24 May 2024 12:43:12 +0000 (14:43 +0200)] 
json: teach json_build() to serialize dual_timestamp structures reasonably

16 months agocore/namespace: add assertion for PRIVATE_TMP_CONNECTED
Mike Yuan [Tue, 18 Jun 2024 14:14:46 +0000 (16:14 +0200)] 
core/namespace: add assertion for PRIVATE_TMP_CONNECTED

16 months agocore/exec-invoke: respect needs_sandboxing for PrivateTmp
Mike Yuan [Tue, 18 Jun 2024 13:56:45 +0000 (15:56 +0200)] 
core/exec-invoke: respect needs_sandboxing for PrivateTmp

Follow-up for 0e551b04efb911d38b586cca1a6a462c87a2cb1b

16 months agocore/dbus-util: move dbus setter/getter for PrivateTmp to dbus-execute
Mike Yuan [Tue, 18 Jun 2024 13:35:43 +0000 (15:35 +0200)] 
core/dbus-util: move dbus setter/getter for PrivateTmp to dbus-execute

As with all other properties for ExecContext

16 months agovarlink: yet another fix around handling of IDL comments 33440/head
Lennart Poettering [Fri, 21 Jun 2024 15:05:26 +0000 (17:05 +0200)] 
varlink: yet another fix around handling of IDL comments

Skip over them when validating a message against the IDL.

Add test case that tests this.

16 months agocore/dbus-execute: use FOREACH_ARRAY more, drop bus_ prefix for static funcs
Mike Yuan [Tue, 18 Jun 2024 13:19:52 +0000 (15:19 +0200)] 
core/dbus-execute: use FOREACH_ARRAY more, drop bus_ prefix for static funcs

16 months agoman/org.freedesktop.systemd1: Status{Bus,Varlink}Error belongs to Service, not Scope
Mike Yuan [Thu, 20 Jun 2024 21:14:38 +0000 (23:14 +0200)] 
man/org.freedesktop.systemd1: Status{Bus,Varlink}Error belongs to Service, not Scope

Follow-up for 9c025022d98787d7ad4e46b57f709434531e55a1

Ugh, shouldn't have done this bit when I was sleepy...

16 months agoinstall: shorten code a bit 33408/head
Lennart Poettering [Tue, 18 Jun 2024 15:09:34 +0000 (17:09 +0200)] 
install: shorten code a bit

This changes behaviour a bit, since we now keep track of OOM errors in
install_changes_add(). Which I'd argue is a good thing.

16 months agoinstall: collect more install_changes_add() errors
Lennart Poettering [Tue, 18 Jun 2024 15:09:21 +0000 (17:09 +0200)] 
install: collect more install_changes_add() errors

We so far collected most unexpected errors from install_changes_add()
and propagated them – but for some invocations we forgot to do that. Add
that, and take care we only propagated unexpected errors (i.e. ENOMEM
and such), but treat expected errors as before.

Follow-up for 5163c9b1e56293b1bb2803420613c5b374570892

16 months agocryptsetup: minor coding style tweaks
Lennart Poettering [Fri, 21 Jun 2024 10:10:51 +0000 (12:10 +0200)] 
cryptsetup: minor coding style tweaks

Don't cram function calls and assignment into if condition checks. It's
not how we usually do things.

Also, define variables at innermost scope.

16 months agotest: skip test-cgroup-id on ENOSYS from cg_cgroupid_open
Nick Rosbrook [Thu, 20 Jun 2024 15:27:03 +0000 (11:27 -0400)] 
test: skip test-cgroup-id on ENOSYS from cg_cgroupid_open

Most container managers will block open_by_handle_at with seccomp to
mitigate a container escape attack. LXD in particular returns ENOSYS
rather than e.g. EPERM like nspawn. Skip this test if we get ENOSYS
from open_by_handle_at via cg_cgroupid_open.

16 months agoMerge pull request #33424 from poettering/machined-gc-rework
Yu Watanabe [Thu, 20 Jun 2024 23:26:30 +0000 (08:26 +0900)] 
Merge pull request #33424 from poettering/machined-gc-rework

machined: clean up GC logic

16 months agomeson: bpf: propagate 'sysroot' for cross compilation
Johannes Schneider [Thu, 20 Jun 2024 10:32:18 +0000 (12:32 +0200)] 
meson: bpf: propagate 'sysroot' for cross compilation

During cross-compilation of systemd, the compiler used to build the bpf's needs
to be pointed at the correct include searchpath. Which can be done by passing
the corresponding directory in through the cflags; for example in yocto/bitbake
this would work: CFLAGS += "--sysroot=${STAGING_DIR_TARGET}"

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
16 months agoMerge pull request #33430 from YHNdnzj/buserror-notify
Lennart Poettering [Thu, 20 Jun 2024 21:05:32 +0000 (23:05 +0200)] 
Merge pull request #33430 from YHNdnzj/buserror-notify

core/service: store BUSERROR= & VARLINKERROR= received and show them through systemctl status

16 months agoMerge pull request #33425 from poettering/json-enum-easier
Lennart Poettering [Thu, 20 Jun 2024 21:05:08 +0000 (23:05 +0200)] 
Merge pull request #33425 from poettering/json-enum-easier

json: make serializing/deserializing systemd-style enums easier in Varlink

16 months agoMerge pull request #33428 from poettering/graceful-varlinkctl
Lennart Poettering [Thu, 20 Jun 2024 21:04:45 +0000 (23:04 +0200)] 
Merge pull request #33428 from poettering/graceful-varlinkctl

varlinkctl: add new --graceful= switch for treating selected errors like a success

16 months agomachined: watch leader PID's lifetime via pidfd 33424/head
Lennart Poettering [Mon, 27 May 2024 13:36:44 +0000 (15:36 +0200)] 
machined: watch leader PID's lifetime via pidfd

If we have a pidfd, we might as well track the machine's leader PID's
lifetime, and enqueue the machine for a GC run.

(This is similar to what we are already doing for logind's session
leaders)

16 months agomachined: GC machines during runtime too
Lennart Poettering [Mon, 27 May 2024 13:37:51 +0000 (15:37 +0200)] 
machined: GC machines during runtime too

One major omission in machine's logic so far was that the GC was only
run at startup and on the check-idle timeout, which is really slow.

Let's make this more like the GC logic in homed or logind: make sure we
run it in a close-by event loop cycle.

16 months agoTEST-80-NOTIFYACCESS: introduce test for ERRNO= + BUS/VARLINKERROR= 33430/head
Mike Yuan [Thu, 20 Jun 2024 16:39:52 +0000 (18:39 +0200)] 
TEST-80-NOTIFYACCESS: introduce test for ERRNO= + BUS/VARLINKERROR=

16 months agobusctl: send BUSERROR= to caller via sd_notify() protocol
Lennart Poettering [Thu, 20 Jun 2024 14:22:32 +0000 (16:22 +0200)] 
busctl: send BUSERROR= to caller via sd_notify() protocol

varlinkctl has this nice feature that it sends the varlink error it gets
via sd_notify() to the caller. With previous commits this information
is collected and exposed in "systemctl status".

Let's make sure we can provide the same in busctl: also propagate errors
the same way.

With this we can comprehensively close #6073

16 months agosystemctl-show: show Status{Bus,Varlink}Error in status
Mike Yuan [Thu, 9 May 2024 16:25:16 +0000 (00:25 +0800)] 
systemctl-show: show Status{Bus,Varlink}Error in status

16 months agocore/service: store BUSERROR= & VARLINKERROR= received through notification
Mike Yuan [Thu, 9 May 2024 14:05:22 +0000 (22:05 +0800)] 
core/service: store BUSERROR= & VARLINKERROR= received through notification

Closes #6073

16 months agosd-bus/bus-error: inline iterator var, use assert_return
Mike Yuan [Thu, 9 May 2024 13:18:10 +0000 (21:18 +0800)] 
sd-bus/bus-error: inline iterator var, use assert_return

16 months agojson: make it easy to dispatch our enums 33425/head
Lennart Poettering [Thu, 20 Jun 2024 07:39:51 +0000 (09:39 +0200)] 
json: make it easy to dispatch our enums

This does the opposite of the previous patch: it undoes the "-" → "_"
mapping of enum values when we try to parse enums again.

16 months agojson: make it easy to serialize our enums to json
Lennart Poettering [Thu, 20 Jun 2024 07:24:18 +0000 (09:24 +0200)] 
json: make it easy to serialize our enums to json

Most of our enums are mapped to strings that use dashes ("-") as word
separators, i.e. "foo-bar-baz". However, Varlink enums do not allow "-"
as separator, see:

https://varlink.org/Interface-Definition

Hence, let's add some simple glue to automatucally turn "-" into "_" for
use when serializing our enums.

16 months agoci: test new --graceful= switch of varlinkctl 33428/head
Lennart Poettering [Thu, 20 Jun 2024 10:23:53 +0000 (12:23 +0200)] 
ci: test new --graceful= switch of varlinkctl

16 months agovarlinkctl: add --graceful= option for optionally marking some errors as successes
Lennart Poettering [Mon, 27 May 2024 20:32:51 +0000 (22:32 +0200)] 
varlinkctl: add --graceful= option for optionally marking some errors as successes

This is generally useful, but in some cases particularly: when
implementing enumeration calls that use the "more" flag to return
multiple replies then for the first reply we need to return an error in
case the list of objects to enumerate is empty, usually so form of
"NoSuchXYZ" error. In many cases this shouldn't really be treated as
error, as an empty list probably more than not is as valid as a list
with one, two or more entries.

16 months agovarlink: add helper that validates a qualified Varlink symbol name
Lennart Poettering [Mon, 27 May 2024 20:31:09 +0000 (22:31 +0200)] 
varlink: add helper that validates a qualified Varlink symbol name

Qualified Varlink symbol names are the combination of an interface name,
followed by a dot, followed by a symbol name. It's a primary concept,
after all it's what we send over the wire for method calls and get back
for error returns.

hence, let's add an explicit validator for it.

16 months agoMerge pull request #33426 from aafeijoo-suse/conf-parser-parse-size-log
Yu Watanabe [Thu, 20 Jun 2024 14:56:59 +0000 (23:56 +0900)] 
Merge pull request #33426 from aafeijoo-suse/conf-parser-parse-size-log

conf-parser: print why config_parse_iec_uint64() fails

16 months agologind: implement maintenance time
Ludwig Nussel [Mon, 6 May 2024 13:55:16 +0000 (15:55 +0200)] 
logind: implement maintenance time

Update frameworks that work automatically in the background
occasionally need to schedule reboots. Systemd-logind already
provides a nice mechanism to schedule shutdowns, send notfications
and block logins short before the time. Systemd has a framework for
calendar events, so we may conveniently use logind to define a
maintenance time for reboots.

The existing ScheduleShutdown DBus method in logind expects a usec_t
with an absolute time. Passing USEC_INFINITY as magic value now tells
logind to take the time from the configured maintenance time if set.

"shutdown -r" leverages that and uses the maintenance time
automatically if configured. The one minute default is still used if
nothing was specified.

Similarly the new 'auto' setting for the --when parameter of systemctl
uses the maintenance time if configured or a one minute timer like the
shutdown command.

16 months agocryptenroll: support for enrolling FIDO2 tokens in manual mode
Kamil Szczęk [Fri, 7 Jun 2024 11:22:49 +0000 (13:22 +0200)] 
cryptenroll: support for enrolling FIDO2 tokens in manual mode

systemd-cryptsetup supports a FIDO2 mode with manual parameters, where
the user provides all the information necessary for recreating the
secret, such as: credential ID, relaying party ID and the salt. This
feature works great for implementing 2FA schemes, where the salt file
is for example a secret unsealed from the TPM or some other source.
While the unlocking part is quite straightforward to set up, enrolling
such a keyslot - not so easy. There is no clearly documented
way on how to set this up and online resources are scarce on this topic
too. By implementing a straightforward way to enroll such a keyslot
directly from systemd-cryptenroll we streamline the enrollment process
and reduce chances for user error when doing such things manually.

16 months agoconf-parser: print why config_parse_iec_uint64() fails 33426/head
Antonio Alvarez Feijoo [Thu, 20 Jun 2024 10:54:32 +0000 (12:54 +0200)] 
conf-parser: print why config_parse_iec_uint64() fails

Print the same output as `config_parse_iec_size()` and
`config_parse_si_uint64()` if `parse_size()` fails, not only the `rvalue`.

16 months agoconf-parser: set standard pointer alignment
Antonio Alvarez Feijoo [Thu, 20 Jun 2024 10:53:08 +0000 (12:53 +0200)] 
conf-parser: set standard pointer alignment

16 months agoMerge pull request #33407 from poettering/varlink-idl-comment-fix
Lennart Poettering [Thu, 20 Jun 2024 10:13:59 +0000 (12:13 +0200)] 
Merge pull request #33407 from poettering/varlink-idl-comment-fix

varlink: make comments on enum entries work

16 months agobootctl: add comments to Varlink interface 33407/head
Lennart Poettering [Wed, 19 Jun 2024 11:54:47 +0000 (13:54 +0200)] 
bootctl: add comments to Varlink interface

This is mostly intended as test case for the early enum comment bugfix,
as this Varlink IDL description now contains such comments, and
test-varlink-idl will process it forth and back aleady.

16 months agobootctl: normalize how we report no boot entries found
Lennart Poettering [Wed, 19 Jun 2024 11:54:35 +0000 (13:54 +0200)] 
bootctl: normalize how we report no boot entries found

This normalizes how we report an empty list of boot entries in
ListBootEntries(). Our usual pattern is to return one item per method
call, but when there is none we usually return a NoSuchXYZ error. Do so
here too.

Before this we'd return a null item instead here, and only here.

This is a minor compat break, but given that this IPC interface is very
new and probably not used so far (we don't use it in our code at least,
and google doesn#t find any other use) I think this normalization is OK
at this point.

16 months agovarlink: correctly format comments for enums too
Lennart Poettering [Wed, 19 Jun 2024 08:46:27 +0000 (10:46 +0200)] 
varlink: correctly format comments for enums too

I apparently never tested comments on enum values and hence they didn#t
work. Fix that.

16 months agobootctl: add --random-seed=yes/no
Ludwig Nussel [Wed, 17 Apr 2024 09:30:03 +0000 (11:30 +0200)] 
bootctl: add --random-seed=yes/no

16 months agoMerge pull request #33420 from poettering/build-with-object
Yu Watanabe [Thu, 20 Jun 2024 04:04:32 +0000 (13:04 +0900)] 
Merge pull request #33420 from poettering/build-with-object

sd-json: add sd_json_build() flavour that implies we are building an object

16 months agoman: fix typo in systemd-tmpfiles
Diego Viola [Thu, 20 Jun 2024 00:15:38 +0000 (21:15 -0300)] 
man: fix typo in systemd-tmpfiles

Signed-off-by: Diego Viola <diego.viola@gmail.com>
16 months agoMerge pull request #33419 from YHNdnzj/install-report-symlink
Yu Watanabe [Thu, 20 Jun 2024 04:00:44 +0000 (13:00 +0900)] 
Merge pull request #33419 from YHNdnzj/install-report-symlink

shared/install: several fixes for change reporting

16 months agocore/namespace: ensure private tmpfs is mounted earlier
Yu Watanabe [Wed, 19 Jun 2024 16:33:51 +0000 (01:33 +0900)] 
core/namespace: ensure private tmpfs is mounted earlier

And drop spurious assertion.

Fortunately, the previous logic worked, as /run/systemd/unit-private-tmp
is ordered earlier than /tmp or /var/tmp. But, let's ensure the tmpfs
mounted earlier to make the logic clearer.

Follow-up for 0e551b04efb911d38b586cca1a6a462c87a2cb1b.

16 months agoMerge pull request #33410 from poettering/sd-json-log-level-clean-up
Yu Watanabe [Thu, 20 Jun 2024 03:59:06 +0000 (12:59 +0900)] 
Merge pull request #33410 from poettering/sd-json-log-level-clean-up

sd-json: clean up SD_JSON_WARNING/SD_JSON_DEBUG definition and comments

16 months agoupdate TODO 33420/head
Lennart Poettering [Wed, 19 Jun 2024 14:55:13 +0000 (16:55 +0200)] 
update TODO

16 months agotree-wide: port over to new builder apis
Lennart Poettering [Tue, 18 Jun 2024 15:08:49 +0000 (17:08 +0200)] 
tree-wide: port over to new builder apis

16 months agosd-json: add sd_json_build() wrapper macro that implies SD_JSON_BUILD_OBJECT()
Lennart Poettering [Tue, 18 Jun 2024 10:21:31 +0000 (12:21 +0200)] 
sd-json: add sd_json_build() wrapper macro that implies SD_JSON_BUILD_OBJECT()

In 99% of uses of sd_json_build() we want to build an object as
outermost construct. Let's shorten this most common case a bit, by
adding sd_json_buildo() that implies this. This allows us to shorten
much of our code, all across the tree.

16 months agoupdate TODO 33410/head
Lennart Poettering [Tue, 18 Jun 2024 09:46:41 +0000 (11:46 +0200)] 
update TODO

16 months agosd-json: add comment clarifying that _SD_JSON_BUILD* enums are not to be used directly
Lennart Poettering [Tue, 18 Jun 2024 09:47:06 +0000 (11:47 +0200)] 
sd-json: add comment clarifying that _SD_JSON_BUILD* enums are not to be used directly

16 months agosd-json.h: reword SD_JSON_WARNING/SD_JSON_DEBUG comments
Lennart Poettering [Tue, 18 Jun 2024 09:43:58 +0000 (11:43 +0200)] 
sd-json.h: reword SD_JSON_WARNING/SD_JSON_DEBUG comments

Even though we don't export json_log() in the public API, let's
officially make the SD_JSON_WARNING/SD_JSON_DEBUG that control its
effect in the public API.

After all, for our own dispatcher functions they have a nice effect, and
they are trivially reimplemented in user code independently.

(We might eventually consider exporting json_log() as public API, but
this is quite involved, given its use of macros/inline functions and
iternal logging API).

This mostly just swaps around the bit flags and cleans up comments.

16 months agotest-install-root: introduce test case for #33411 33419/head
Mike Yuan [Wed, 19 Jun 2024 19:28:05 +0000 (21:28 +0200)] 
test-install-root: introduce test case for #33411

16 months agoshared/install: correctly report changes in install_info_symlink_alias()
Mike Yuan [Wed, 19 Jun 2024 16:45:14 +0000 (18:45 +0200)] 
shared/install: correctly report changes in install_info_symlink_alias()

Follow-up for b2751cf0394d36c24590b5f7b33e9f864b57ba0d

Also make the conditions consistent for install_info_symlink_wants().

Fixes #33411

16 months agoshared/install: propagate all errors in install_info_apply()
Mike Yuan [Wed, 19 Jun 2024 16:59:15 +0000 (18:59 +0200)] 
shared/install: propagate all errors in install_info_apply()

Currently, install_info_apply() only updates r if it's 0,
meaning that if one of the earlier install_info_symlink_alias/wants()
calls returns > 0, errors generated by later calls will be discarded.
Fix that.

16 months agoshared/install: drop unneeded initialization
Mike Yuan [Wed, 19 Jun 2024 16:44:26 +0000 (18:44 +0200)] 
shared/install: drop unneeded initialization