]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
16 months agologin/user-runtime-dir: free ignored sd_bus_error, avoid triggering assertion 33391/head
Mike Yuan [Tue, 18 Jun 2024 14:32:14 +0000 (16:32 +0200)] 
login/user-runtime-dir: free ignored sd_bus_error, avoid triggering assertion

Fixes #33388

16 months agologin/user-runtime-dir: use STRLEN where appropriate
Mike Yuan [Tue, 18 Jun 2024 14:31:12 +0000 (16:31 +0200)] 
login/user-runtime-dir: use STRLEN where appropriate

Also, add missing trailing / to paths used in STRLEN/sizeof.

16 months agostrv: replace always-true condition with assertion
Yu Watanabe [Tue, 18 Jun 2024 09:12:39 +0000 (18:12 +0900)] 
strv: replace always-true condition with assertion

Follow-up for aca093018c5d2cd8a63129cab67941fe1b8fd850.
Fixes CID#1547105.

16 months agoMerge pull request #33386 from yuwata/journal-timestamp 33380/head
Luca Boccassi [Tue, 18 Jun 2024 15:27:36 +0000 (16:27 +0100)] 
Merge pull request #33386 from yuwata/journal-timestamp

journal: fix _SOURCE_MONOTONIC_TIMESTAMP field

16 months agorepart: fix memory leak
Antonio Alvarez Feijoo [Tue, 18 Jun 2024 12:07:50 +0000 (14:07 +0200)] 
repart: fix memory leak

16 months agomkosi: restrict noble-backports to noble builds
Luca Boccassi [Tue, 18 Jun 2024 12:35:32 +0000 (13:35 +0100)] 
mkosi: restrict noble-backports to noble builds

Follow-up for c01cb8cbff8512b65b7903b55f78c8d12661b8d7

16 months agoMerge pull request #33383 from poettering/tmpfiles-limit-purge
Luca Boccassi [Tue, 18 Jun 2024 14:44:32 +0000 (15:44 +0100)] 
Merge pull request #33383 from poettering/tmpfiles-limit-purge

tmpfiles: make --purge more restrictive, and various other tweaks

16 months agoinstall: allow removing symlinks even for units that are gone
Luca Boccassi [Fri, 7 Jun 2024 20:39:45 +0000 (21:39 +0100)] 
install: allow removing symlinks even for units that are gone

If a symlink is leftover, still allow cleaning it up via 'disable'. This
happens when a unit is stopped and removed, but not disabled, and a reload
has already happened. At that point, cleaning up the old symlinks becomes
impossible through the APIs, and needs to be done manually. Always allow
cleaning up symlinks, if they exist, by only erroring out if there is an
OOM.

Follow-up for f31f10a6207efc9ae9e0b1f73975b5b610914017

16 months agoman: suffix tmpfiles.d with /, as per coding style 33383/head
Lennart Poettering [Tue, 18 Jun 2024 08:27:06 +0000 (10:27 +0200)] 
man: suffix tmpfiles.d with /, as per coding style

16 months agotmpfiles: mention that --create also adjusts files/directories in --help text
Lennart Poettering [Tue, 18 Jun 2024 08:00:16 +0000 (10:00 +0200)] 
tmpfiles: mention that --create also adjusts files/directories in --help text

16 months agotmpfiles: suffix --replace= properly with = in comment
Lennart Poettering [Tue, 18 Jun 2024 07:56:49 +0000 (09:56 +0200)] 
tmpfiles: suffix --replace= properly with = in comment

16 months agotmpfiles: make --tldr help text symmetric to --cat-config
Lennart Poettering [Tue, 18 Jun 2024 07:56:36 +0000 (09:56 +0200)] 
tmpfiles: make --tldr help text symmetric to --cat-config

16 months agotmpfiles: improve debug logging around O_NOATIME fallback
Lennart Poettering [Tue, 18 Jun 2024 07:55:48 +0000 (09:55 +0200)] 
tmpfiles: improve debug logging around O_NOATIME fallback

16 months agotmpfiles: remove pointless empty line
Lennart Poettering [Tue, 18 Jun 2024 07:55:32 +0000 (09:55 +0200)] 
tmpfiles: remove pointless empty line

16 months agotmpfiles: move --purge to command section in --help text where it belongs
Lennart Poettering [Tue, 18 Jun 2024 07:56:15 +0000 (09:56 +0200)] 
tmpfiles: move --purge to command section in --help text where it belongs

Also, make contrast between --remove and --purge clearer: one deletes
files marked for deletion, the other deletes files marked for creation.

16 months agotmpfiles: insist on at least one configuration file being specified on --purge
Lennart Poettering [Tue, 18 Jun 2024 07:55:20 +0000 (09:55 +0200)] 
tmpfiles: insist on at least one configuration file being specified on --purge

Also, extend the man page explanation substantially, matching more
closely what --create says.

Fixes: #33349
16 months agoAdd OrangePi NEO Scancodes
Derek J. Clark [Mon, 17 Jun 2024 18:49:30 +0000 (11:49 -0700)] 
Add OrangePi NEO Scancodes

Adds scancodes for the OrangePi NEO Handheld Gaming computer. This
device ships with an AT Translated Set 2 Keyboard device that
provides two buttons, ~~LC (Top Left) and RC (Top Right)~~
Home (front, bottom left) and Gamepad (front, bottom right). The
scancodes do not properly map in Linux. This change maps these
scancodes to ensure the hardware behaves as the OEM expects.

16 months agoNEWS: fix typo
Carlo Teubner [Tue, 18 Jun 2024 08:41:59 +0000 (09:41 +0100)] 
NEWS: fix typo

16 months agologs-show: use _SOURCE_MONOTONIC_TIMESTAMP when _SOURCE_BOOTTIME_TIMESTAMP field... 33386/head
Yu Watanabe [Tue, 18 Jun 2024 09:00:33 +0000 (18:00 +0900)] 
logs-show: use _SOURCE_MONOTONIC_TIMESTAMP when _SOURCE_BOOTTIME_TIMESTAMP field exists

With the previous commit, now the _SOURCE_MONOTONIC_TIMESTAMP field is
usable but only when _SOURCE_BOOTTIME_TIMESTAMP exists.

16 months agojournal: introduce _SOURCE_BOOTTIME_TIMESTAMP field
Yu Watanabe [Tue, 18 Jun 2024 08:36:51 +0000 (17:36 +0900)] 
journal: introduce _SOURCE_BOOTTIME_TIMESTAMP field

Then, fix the monotonic timestamp.

The _SOURCE_MONOTONIC_TIMESTAMP field is already used in other projects.
Hence, we cannot remove the field. But, let's store the correct value.
The existence of the new _SOURCE_BOOTTIME_TIMESTAMP field can indicate
that the monotonic timestamp field is reliable or not.

16 months agosd-journal: realign flags
Yu Watanabe [Tue, 18 Jun 2024 08:24:47 +0000 (17:24 +0900)] 
sd-journal: realign flags

16 months agologs-show: do not use _SOURCE_MONOTONIC_TIMESTAMP field
Yu Watanabe [Tue, 18 Jun 2024 08:55:31 +0000 (17:55 +0900)] 
logs-show: do not use _SOURCE_MONOTONIC_TIMESTAMP field

The timestamp is not in CLOCK_MONOTONIC, but CLOCK_BOOTTIME,
while header monotonic timestamp is in CLOCK_MONOTONIC. Hence, we cannot
adjust timestamp by comparing with header monotonic timestamp and
_SOURCE_MONOTONIC_TIMESTAMP field.

Fixes a regression caused by affde1d7e79a634ee6053dbd4a57b3b51b74c170.
Fixes #33293.

16 months agotmpfiles: honour --dry-run when removing directories
Lennart Poettering [Tue, 18 Jun 2024 07:54:33 +0000 (09:54 +0200)] 
tmpfiles: honour --dry-run when removing directories

16 months agotmpfiles: sort needs_purge line list in same order as enum defines them
Lennart Poettering [Tue, 18 Jun 2024 08:15:02 +0000 (10:15 +0200)] 
tmpfiles: sort needs_purge line list in same order as enum defines them

16 months agoupdate TODO
Lennart Poettering [Tue, 18 Jun 2024 07:27:57 +0000 (09:27 +0200)] 
update TODO

16 months agohwdb: add scancodes for AYANEO devices (#33378)
Derek J. Clark [Tue, 18 Jun 2024 00:19:30 +0000 (17:19 -0700)] 
hwdb: add scancodes for AYANEO devices (#33378)

AYANEO has multiple models that all use the same AT Translated Set
2 Keyboard device with 3-4 buttons available. Starting with the
AYANEO 2 there was a change to the IMU programming they were using
that caused the scancodes to no longer present the correct values
in Linux. This change adds a blanket scancode mapping to present
the correct keycodes as designed by the OEM.

In some cases a kernel bug will cause the AT Translated Set 2
Keyboard to present as an AT Raw Set 2 keyboard. I have also
adjusted the scancodes for this scenario as well so they are
in line with expected behavior. Currently only the Kun is still
experiencing this bug.

Example userspace tool refs:
https://github.com/ShadowBlip/InputPlumber/blob/main/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb
https://github.com/ShadowBlip/HandyGCCS/blob/main/usr/lib/udev/hwdb.d/59-handygccs-ayaneo.hwdb
https://github.com/hhd-dev/hhd/tree/master/usr/lib/udev/hwdb.d

16 months agovarlink-idl: fix typo
Yu Watanabe [Tue, 18 Jun 2024 00:11:48 +0000 (09:11 +0900)] 
varlink-idl: fix typo

Follow-ups for fbb69c0306d434153ca85b227c7d42b9c92872e4.

16 months agocatalog: fix typo
Yu Watanabe [Tue, 18 Jun 2024 00:09:26 +0000 (09:09 +0900)] 
catalog: fix typo

Follow-up for d6518003f8ebbfb6f85dbf227736ae05b0961199.

16 months agoMerge pull request #33376 from yuwata/strv_sort_uniq
Luca Boccassi [Mon, 17 Jun 2024 23:22:19 +0000 (00:22 +0100)] 
Merge pull request #33376 from yuwata/strv_sort_uniq

strv: introduce strv_sort_uniq()

16 months agoMerge pull request #33359 from bluca/test_apparmor_unpriv
Luca Boccassi [Mon, 17 Jun 2024 23:13:15 +0000 (00:13 +0100)] 
Merge pull request #33359 from bluca/test_apparmor_unpriv

mkosi: enable unprivileged user ns for integration tests

16 months agoMerge pull request #32724 from bluca/dynamic_user_no_private_tmp
Luca Boccassi [Mon, 17 Jun 2024 23:11:11 +0000 (00:11 +0100)] 
Merge pull request #32724 from bluca/dynamic_user_no_private_tmp

core: do not imply PrivateTmp with DynamicUser, create a private tmpfs instead

16 months agoMerge pull request #33377 from yuwata/strbuf-cleanups
Luca Boccassi [Mon, 17 Jun 2024 19:08:22 +0000 (20:08 +0100)] 
Merge pull request #33377 from yuwata/strbuf-cleanups

strbuf: several cleanups

16 months agoMerge pull request #33375 from yuwata/trivial-follow-ups
Luca Boccassi [Mon, 17 Jun 2024 19:06:46 +0000 (20:06 +0100)] 
Merge pull request #33375 from yuwata/trivial-follow-ups

Trivial follow ups for recent PRs

16 months agoMerge pull request #33374 from YHNdnzj/coverity-fixes-1
Luca Boccassi [Mon, 17 Jun 2024 19:05:58 +0000 (20:05 +0100)] 
Merge pull request #33374 from YHNdnzj/coverity-fixes-1

core: a few more fixes for serialization

16 months agoMerge pull request #32559 from poettering/varlink-comments
Luca Boccassi [Mon, 17 Jun 2024 17:53:11 +0000 (18:53 +0100)] 
Merge pull request #32559 from poettering/varlink-comments

varlink: add nice commenting to our varlink IDL data

16 months agoMerge pull request #32872 from YHNdnzj/pidref-inode
Mike Yuan [Mon, 17 Jun 2024 16:47:44 +0000 (18:47 +0200)] 
Merge pull request #32872 from YHNdnzj/pidref-inode

pidref: record pidfd inode number in PidRef struct

16 months agomkosi: bump to latest 33359/head
Luca Boccassi [Mon, 17 Jun 2024 14:40:10 +0000 (15:40 +0100)] 
mkosi: bump to latest

16 months agoCI: disable secure boot in mkosi GHA runs
Luca Boccassi [Mon, 17 Jun 2024 16:40:28 +0000 (17:40 +0100)] 
CI: disable secure boot in mkosi GHA runs

Booting a guest with secure boot is broken in Azure due to a hypervisor
bug. Disable it for now. Given there's no option, need to edit
the configuration on the fly.

16 months agoportable: drop explicit PrivateTmp=yes from profiles 32724/head
Luca Boccassi [Wed, 8 May 2024 19:16:05 +0000 (20:16 +0100)] 
portable: drop explicit PrivateTmp=yes from profiles

It is already implied by DynamicUser=yes if not set, but dropping it
allows users to instead define TemporaryFileSystem=/tmp/ /var/tmp/
in their portable services, which has fewer side effects.

16 months agocore: do not imply PrivateTmp with DynamicUser, create a private tmpfs instead
Luca Boccassi [Wed, 8 May 2024 19:12:57 +0000 (20:12 +0100)] 
core: do not imply PrivateTmp with DynamicUser, create a private tmpfs instead

DynamicUser= enables PrivateTmp= implicitly to avoid files owned by reusable uids
leaking into the host. Change it to instead create a fully private tmpfs instance
instead, which also ensures the same result, since it has less impactful semantics
with respect to PrivateTmp=yes, which links the mount namespace to the host's /tmp
instead. If a user specifies PrivateTmp manually, let the existing behaviour
unchanged to ensure backward compatibility is not broken.

16 months agotree-wide: replace strv_sort() + strv_uniq() -> strv_sort_uniq() 33376/head
Yu Watanabe [Mon, 17 Jun 2024 15:06:59 +0000 (00:06 +0900)] 
tree-wide: replace strv_sort() + strv_uniq() -> strv_sort_uniq()

16 months agostrbuf: use _cleanup_ attribute at one more place 33377/head
Yu Watanabe [Wed, 12 Jun 2024 15:24:38 +0000 (00:24 +0900)] 
strbuf: use _cleanup_ attribute at one more place

16 months agostrbuf: several cleanups
Yu Watanabe [Wed, 12 Jun 2024 15:20:26 +0000 (00:20 +0900)] 
strbuf: several cleanups

- use FOREACH_ARRAY(),
- add one missing assertion,
- reduce indentation.

16 months agostrbuf: use CMP() macro
Yu Watanabe [Wed, 12 Jun 2024 15:17:20 +0000 (00:17 +0900)] 
strbuf: use CMP() macro

strbuf_child_entry.c is uint8_t, so using CMP() is safer.

This also adds missing assertions.

16 months agostrv: introduce strv_sort_uniq()
Yu Watanabe [Mon, 17 Jun 2024 14:52:14 +0000 (23:52 +0900)] 
strv: introduce strv_sort_uniq()

We often call strv_sort() and strv_uniq(). If a strv is already sorted.
uniquifying can be faster.

Prompted by https://github.com/systemd/systemd/pull/33012#discussion_r1636633627.

16 months agotest-network: mention that the captive portal option is supported since v2.20 33375/head
Yu Watanabe [Mon, 17 Jun 2024 15:09:03 +0000 (00:09 +0900)] 
test-network: mention that the captive portal option is supported since v2.20

The current latest release is v2.19, hence the test is typically skipped now.

16 months agojson: const char *func() -> const char* func()
Yu Watanabe [Mon, 17 Jun 2024 14:10:18 +0000 (23:10 +0900)] 
json: const char *func() -> const char* func()

Follow-up for 309a747fa6cfeac0a0165543f23a924866727c9b.

16 months agocore/mount: suffix function name with paren
Yu Watanabe [Mon, 17 Jun 2024 14:08:36 +0000 (23:08 +0900)] 
core/mount: suffix function name with paren

Follow-up for 88188e1ff1ffa2a4a41c9b8ee127f75cc03bc18d.

16 months agologind: tweaklets
Lennart Poettering [Mon, 27 May 2024 12:33:22 +0000 (14:33 +0200)] 
logind: tweaklets

16 months agopretty-print: take console glyph width into account when drawing progress bar
Lennart Poettering [Fri, 24 May 2024 11:56:10 +0000 (13:56 +0200)] 
pretty-print: take console glyph width into account when drawing progress bar

So far this used string length, not character width. Fix that.

16 months agocore/service: fix accept-socket deserialization 33374/head
Mike Yuan [Mon, 17 Jun 2024 05:47:20 +0000 (07:47 +0200)] 
core/service: fix accept-socket deserialization

Follow-up for 45b1017488cef2a5bacdf82028ce900a311c9a1c

16 months agocore: cast ignored retval of deserialize_* to void
Mike Yuan [Mon, 17 Jun 2024 05:21:43 +0000 (07:21 +0200)] 
core: cast ignored retval of deserialize_* to void

Fixes CID#1547098

16 months agocore/socket: use FOREACH_ARRAY at one more place
Mike Yuan [Mon, 17 Jun 2024 14:39:59 +0000 (16:39 +0200)] 
core/socket: use FOREACH_ARRAY at one more place

16 months agotest: use 'auto' instead of 'uefi' for automated fallback
Luca Boccassi [Mon, 17 Jun 2024 14:37:43 +0000 (15:37 +0100)] 
test: use 'auto' instead of 'uefi' for automated fallback

mkosi will prefer UEFI if the architecture supports it, but fallback
to 'linux' if it doesn't.

16 months agotest: support TEST_NO_QEMU in mkosi integration wrapper
Luca Boccassi [Mon, 17 Jun 2024 13:09:40 +0000 (14:09 +0100)] 
test: support TEST_NO_QEMU in mkosi integration wrapper

Same as the old integration test suite, allow skipping tests that
require qemu.
ppc64el's vsock support doesn't appear to work, so we'll skip it,
as it is already done in the legacy framework.

16 months agotest: support TEST_NO_KVM
Luca Boccassi [Sun, 16 Jun 2024 18:15:24 +0000 (19:15 +0100)] 
test: support TEST_NO_KVM

The shell integration suite allows to manually deselect KVM, so
suppor the same env var for the same purpose in python.

16 months agotest: drop obsolete comment
Luca Boccassi [Sun, 16 Jun 2024 18:21:32 +0000 (19:21 +0100)] 
test: drop obsolete comment

We want to keep various logic here instead of mkosi, so drop the
temporary comment

16 months agohwdb: add support for AIPTEK Media Tablet Ultimate (#33371)
reDBo0n [Mon, 17 Jun 2024 14:05:23 +0000 (16:05 +0200)] 
hwdb: add support for AIPTEK Media Tablet Ultimate (#33371)

The "AIPTEK Media Tablet Ultimate", detected as "Waltop International Corp. Batteryless Tablet",
is missing the resolution of the x-/y-axes.

Adding a new rule to 60-evdev.hwdb with the same values as another entry
"WALTOP International Corp. Batteryless Tablet" just with another matching string makes the
device usable.

Fixes #33362.

16 months agotest: drop unneeded firmware: uefi setting
Luca Boccassi [Sun, 16 Jun 2024 15:08:57 +0000 (16:08 +0100)] 
test: drop unneeded firmware: uefi setting

These tests no longer need this, as they are running in nspawn, drop it

16 months agotest: check the skip condition before installing additional files
Luca Boccassi [Sun, 16 Jun 2024 12:41:50 +0000 (13:41 +0100)] 
test: check the skip condition before installing additional files

16 months agomkosi: install EFI packages only on EFI architectures
Luca Boccassi [Sun, 16 Jun 2024 19:42:12 +0000 (20:42 +0100)] 
mkosi: install EFI packages only on EFI architectures

sbsigntool, systemd-boot and systemd-boot-efi do not  exist on other
architectures

16 months agomkosi: use ports.ubuntu.com for non-x86 backports
Luca Boccassi [Sun, 16 Jun 2024 14:28:56 +0000 (15:28 +0100)] 
mkosi: use ports.ubuntu.com for non-x86 backports

Follow-up for 46368556afee7a1f3a1685609942438ef2d9d6c1

16 months agomkosi: enable unprivileged user ns for integration tests
Luca Boccassi [Sun, 16 Jun 2024 10:16:21 +0000 (11:16 +0100)] 
mkosi: enable unprivileged user ns for integration tests

Ubuntu disables them by default in Noble, ship a sysctl to turn them back on
so that tests can use them

16 months agoMerge pull request #33355 from YHNdnzj/shutdown-cad
Luca Boccassi [Mon, 17 Jun 2024 08:19:08 +0000 (09:19 +0100)] 
Merge pull request #33355 from YHNdnzj/shutdown-cad

shutdown: re-enable CAD handling in kernel at start, several other cleanups

16 months agoupdate TODO 32559/head
Lennart Poettering [Mon, 29 Apr 2024 13:47:17 +0000 (15:47 +0200)] 
update TODO

16 months agocreds: add comments to credential encryption/decryption method calls
Lennart Poettering [Fri, 26 Apr 2024 15:44:12 +0000 (17:44 +0200)] 
creds: add comments to credential encryption/decryption method calls

16 months agovarlink: parse comments too
Lennart Poettering [Mon, 29 Apr 2024 13:33:02 +0000 (15:33 +0200)] 
varlink: parse comments too

16 months agovarlink: add concept for embedding comments into IDL structures
Lennart Poettering [Fri, 26 Apr 2024 15:43:21 +0000 (17:43 +0200)] 
varlink: add concept for embedding comments into IDL structures

16 months agostrv: add new helper strv_rebreak_lines() with a simple line breaking algorithm
Lennart Poettering [Fri, 26 Apr 2024 15:40:32 +0000 (17:40 +0200)] 
strv: add new helper strv_rebreak_lines() with a simple line breaking algorithm

16 months agoutf8: export utf8_char_console_width()
Lennart Poettering [Fri, 26 Apr 2024 15:40:54 +0000 (17:40 +0200)] 
utf8: export utf8_char_console_width()

16 months agoMerge pull request #33363 from YHNdnzj/service-serialization-cleanup
Luca Boccassi [Sun, 16 Jun 2024 22:01:35 +0000 (23:01 +0100)] 
Merge pull request #33363 from YHNdnzj/service-serialization-cleanup

core/service: several cleanups for serialization logic

16 months agoMerge pull request #33364 from YHNdnzj/utf8-modernization
Luca Boccassi [Sun, 16 Jun 2024 21:33:08 +0000 (22:33 +0100)] 
Merge pull request #33364 from YHNdnzj/utf8-modernization

basic/utf8: some modernizations

16 months agostring-util: introduce string_is_safe_ascii helper 33364/head
Mike Yuan [Thu, 9 May 2024 14:01:07 +0000 (22:01 +0800)] 
string-util: introduce string_is_safe_ascii helper

16 months agobasic/utf8: modernize ascii_is_valid_n, make ascii_is_valid static inline
Mike Yuan [Thu, 9 May 2024 13:58:36 +0000 (21:58 +0800)] 
basic/utf8: modernize ascii_is_valid_n, make ascii_is_valid static inline

16 months agobasic/utf8: modernize utf8_is_valid_n a bit
Mike Yuan [Thu, 9 May 2024 13:55:09 +0000 (21:55 +0800)] 
basic/utf8: modernize utf8_is_valid_n a bit

16 months agocore/service: use r to store parsed int values 33363/head
Mike Yuan [Sun, 16 Jun 2024 16:58:42 +0000 (18:58 +0200)] 
core/service: use r to store parsed int values

16 months agocore/service: drop unused bus_name_owner
Mike Yuan [Sun, 16 Jun 2024 16:40:39 +0000 (18:40 +0200)] 
core/service: drop unused bus_name_owner

Follow-up for fc67a943d989d5e74577adea9676cdc7928b08fc

After the mentioned comment, we no longer need to record
the owner to restore the previous bus owner state.
Therefore, bus_name_owner is effectively unused. Kill it.

16 months agocore/service: also serialize/dump status_errno
Mike Yuan [Sun, 16 Jun 2024 16:34:27 +0000 (18:34 +0200)] 
core/service: also serialize/dump status_errno

16 months agocore/service: use serialize_usec where appropriate, drop redundant debug log
Mike Yuan [Sun, 16 Jun 2024 16:16:23 +0000 (18:16 +0200)] 
core/service: use serialize_usec where appropriate, drop redundant debug log

16 months agoMerge pull request #33214 from keszybz/system-clock-epoch
Mike Yuan [Sun, 16 Jun 2024 15:42:47 +0000 (17:42 +0200)] 
Merge pull request #33214 from keszybz/system-clock-epoch

Rework the setting and description of system clock to the epoch

16 months agoMerge pull request #33352 from YHNdnzj/freeconp-void
Luca Boccassi [Sat, 15 Jun 2024 18:57:13 +0000 (19:57 +0100)] 
Merge pull request #33352 from YHNdnzj/freeconp-void

Trivial follow-ups for recent PRs

16 months agoshutdown: re-enable CAD handling in kernel at start 33355/head
Mike Yuan [Wed, 5 Jun 2024 15:57:07 +0000 (17:57 +0200)] 
shutdown: re-enable CAD handling in kernel at start

16 months agoshutdown: clean up sync_with_progress a bit
Mike Yuan [Wed, 5 Jun 2024 15:53:27 +0000 (17:53 +0200)] 
shutdown: clean up sync_with_progress a bit

Also, ignore the error on caller's side.

16 months agostring-util: modernize first_word a bit
Mike Yuan [Wed, 5 Jun 2024 14:54:29 +0000 (16:54 +0200)] 
string-util: modernize first_word a bit

16 months agocore/manager: correct alignment in manager_handle_ctrl_alt_del
Mike Yuan [Wed, 12 Jun 2024 13:48:06 +0000 (15:48 +0200)] 
core/manager: correct alignment in manager_handle_ctrl_alt_del

16 months agoman,units: drop "temporary" from description of systemd-tmpfiles
Mike Yuan [Sat, 15 Jun 2024 15:27:33 +0000 (17:27 +0200)] 
man,units: drop "temporary" from description of systemd-tmpfiles

Historically, systemd-tmpfiles was designed to manager temporary
files, but nowadays it has become a generic tool for managing
all kinds of files. To avoid user confusion, let's remove "temporary"
from the tool's description.

As discussed in #33349

16 months agoman: describe setting of the clock by systemd and systemd-timesyncd 33214/head
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2024 12:15:21 +0000 (14:15 +0200)] 
man: describe setting of the clock by systemd and systemd-timesyncd

The setting of systemd clock is important and deserves an accurate description,
see for example:
https://discussion.fedoraproject.org/t/f38-to-f39-40-dnf-system-upgrade-can-fail-on-raspberry-pi/92403
https://bugzilla.redhat.com/show_bug.cgi?id=2242759

The meat of the description was in systemd-timesyncd.service(8), but
actually it's systemd that sets the clock. In particular, systemd-timesyncd
doesn't know anything about /usr/lib/clock-epoch, and since systemd sets
the clock to the epoch when initializing, systemd-timesyncd would only
get to advance the clock to the epoch under special circumstances.
Also, systemd-timesyncd is an optional component, so we can't even rely
on its man page being installed in all circumstances. The description needs
to be moved to systemd(1).

The description is updated to describe the changes that were made in
previous commits.

16 months agomanager: add structured log message about clock bump
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jun 2024 09:55:14 +0000 (11:55 +0200)] 
manager: add structured log message about clock bump

Requested in https://github.com/systemd/systemd/pull/33214#discussion_r1630251308.
Also, reword error messages a bit. When /usr/lib/clock-epoch was introduced,
"build time" stopped being acurate. Just say "epoch" instead.

The same message ID is used in the manager and timesyncd. The event is
essentially equivalent for the user, and it seems reasonable that to search for
both at the same time.

The catalog entry is dropped. It provided almost no additional information above
the message. When the same message ID is now applied to messages from PID1 and
timesyncd, and the clock can be both advanced and rewound, it becomes very hard
to make the catalog entry provide something useful, because catalog entries don't
allow conditionalization.

16 months agotimesyncd: simplify handling of timestamps
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2024 11:31:07 +0000 (13:31 +0200)] 
timesyncd: simplify handling of timestamps

We would attempt to take the built-in epoch twice. Since
advance_tstamp() is only called from one place, we don't need to do that.
Also, just pass usec_t instead of a pointer to stat buf.

Don't say we set the clock to "recorded timestamp" if we just set it
to the built-in epoch. Also, consistently say "advance" to make it clear
that we'll not attempt to rewind the clock here.

16 months agomanager: apply clock epoch on updates too
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2024 11:21:45 +0000 (13:21 +0200)] 
manager: apply clock epoch on updates too

If we're updating on a system with an invalid clock, and we're installing
a newer system version with a higher update, adjust the clock. This
way the invariant that the clock is always later than
max(compile time, timestamp file, other timestamp file) is maintained.

Also, adjust the wording of messages. When /usr/lib/clock-epoch was
introduced, "build time" stopped being acurate. Just say "epoch" instead.

16 months agomanager: use max of: compile epoch, epoch file, timesyncd file
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2024 10:50:52 +0000 (12:50 +0200)] 
manager: use max of: compile epoch, epoch file, timesyncd file

Previously systemd would not use /var/lib/systemd/timesync/clock. This means
that even if /var/ is mounted when systemd is started and the file is
available, we would potentially make one time jump and than another time jump.
From a user's POV, this doesn't seem useful at all.

Also, we would always let /usr/lib/clock-epoch take priority over the built-in
epoch. But there is no guarantee that this file is actually fresh. In
particular, a user may touch /usr/lib/clock-epoch to work around a broken clock
during installation (as recommended in [1]), and then this file will grow stale
over time.

So just load the three timestamps and use the highest one as the epoch.

[1] https://discussion.fedoraproject.org/t/f38-to-f39-40-dnf-system-upgrade-can-fail-on-raspberry-pi/92403

16 months agoshared/clock-util: small modernization
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jun 2024 08:24:52 +0000 (10:24 +0200)] 
shared/clock-util: small modernization

16 months agorandom-util: add crypto_random_bytes_allocate_iovec()
Lennart Poettering [Thu, 6 Jun 2024 09:21:02 +0000 (11:21 +0200)] 
random-util: add crypto_random_bytes_allocate_iovec()

Just a simple helper that allocates some memory, initializes it
randomly, and places this in a struct iovec.

16 months agoimportd: unify setup of bus connectivity in one place
Lennart Poettering [Tue, 7 May 2024 15:44:31 +0000 (17:44 +0200)] 
importd: unify setup of bus connectivity in one place

16 months agoselinux-util: make type of cleanup func void 33352/head
Mike Yuan [Sat, 15 Jun 2024 10:55:45 +0000 (12:55 +0200)] 
selinux-util: make type of cleanup func void

Follow-up for 6623c64a02fae52103cdc9c80dfcabec9eeaf8ba

Return values are pointless for _cleanup_ functions, and
this matches what we do in DEFINE_TRIVIAL_CLEANUP_FUNC().

16 months agomissing_loop: add missing assertions for fallback values
Mike Yuan [Sat, 15 Jun 2024 10:55:21 +0000 (12:55 +0200)] 
missing_loop: add missing assertions for fallback values

16 months agomacro-fundamental: correct comment and remove trailing ';' for macro
Mike Yuan [Sat, 15 Jun 2024 10:54:44 +0000 (12:54 +0200)] 
macro-fundamental: correct comment and remove trailing ';' for macro

Follow-up for 3c2f2146f50c75662987541719bedc4aee9df939

16 months agoMerge pull request #33037 from keszybz/dlopen-open-code-definitions
Mike Yuan [Sat, 15 Jun 2024 10:49:59 +0000 (12:49 +0200)] 
Merge pull request #33037 from keszybz/dlopen-open-code-definitions

Make dlopen macros more explicit and drop mac_selinux_free()

16 months agojson: extend JsonDispatch flags with nullable and refuse-null flags
Lennart Poettering [Wed, 8 May 2024 07:42:12 +0000 (09:42 +0200)] 
json: extend JsonDispatch flags with nullable and refuse-null flags

currently when dispatching json objects into C structs we either insist
on the field type or we don't. Let's extend this model a bit: depending
on two new fields either allow or refuse null types in addition to the
specified type.

This is useful for example when dispatch enums as this allows us
explicitly refuse null in various scenarios where we allow multiple
types.

16 months agovarlink: handle NULL varlink server object gracefully in varlink_server_current_conne...
Lennart Poettering [Wed, 8 May 2024 08:40:48 +0000 (10:40 +0200)] 
varlink: handle NULL varlink server object gracefully in varlink_server_current_connections()

let's treat a NULL server as a server with zero connections, to make
things more convenient to use.