]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 months agostatic-destruct: Reduce transitive includes 37364/head
Daan De Meyer [Mon, 5 May 2025 12:28:08 +0000 (14:28 +0200)] 
static-destruct: Reduce transitive includes

6 months agoiovec-util: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 12:15:47 +0000 (14:15 +0200)] 
iovec-util: Reduce transitive includes

6 months agorm-rf: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 12:13:11 +0000 (14:13 +0200)] 
rm-rf: Reduce transitive includes

6 months agoconf-parser: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 12:09:05 +0000 (14:09 +0200)] 
conf-parser: Reduce transitive includes

6 months agodevice-util: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 11:32:55 +0000 (13:32 +0200)] 
device-util: Reduce transitive includes

6 months agostrv: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 11:27:39 +0000 (13:27 +0200)] 
strv: Reduce transitive includes

6 months agopath-util: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 10:18:39 +0000 (12:18 +0200)] 
path-util: Reduce transitive includes

6 months agofs-util: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 08:50:25 +0000 (10:50 +0200)] 
fs-util: Reduce transitive includes

6 months agoaf-list: Remove transitive includes
Daan De Meyer [Tue, 6 May 2025 11:33:49 +0000 (13:33 +0200)] 
af-list: Remove transitive includes

6 months agotest-sd-login: add a "test" that just calls all sd_pid_get_* functions
Zbigniew Jędrzejewski-Szmek [Tue, 6 May 2025 11:42:27 +0000 (13:42 +0200)] 
test-sd-login: add a "test" that just calls all sd_pid_get_* functions

As a test, it just increases our code coverage in a fake way.
When run manually, it can be used to conveniently print what logind
thinks about various processes:

$ build/test-sd-login
sd_pid_get_session(0) → No data available
sd_pid_get_unit(0) → user@1000.service
sd_pid_get_user_unit(0) → app-ghostty-transient-5088.scope
sd_pid_get_machine_name(0) → No such file or directory
sd_pid_get_slice(0) → user-1000.slice
sd_pid_get_user_slice(0) → app.slice
sd_pid_get_owner_uid(0) → 1000
sd_pid_get_cgroup(0) → /user.slice/user-1000.slice/user@1000.service/app.slice/app-ghostty-transient-5088.scope/surfaces/556FAF50BA40.scope

$ build/test-sd-login cgroup 1
sd_pid_get_cgroup(1) → /init.scope

6 months agotest-sd-device: drop chunk added by mistake
Zbigniew Jędrzejewski-Szmek [Thu, 10 Apr 2025 14:00:59 +0000 (16:00 +0200)] 
test-sd-device: drop chunk added by mistake

I initially wrote it this way, but then decided to implement a loop
limit, but forgot to drop the first approach in one place.
Fixup for 74cb65e45fbf3468cf6b522e4b4fa568d95f12c6.

6 months agoReword descriptions of RestrictAddressFamilies= and SystemCallFilter= (#37367)
Yu Watanabe [Wed, 7 May 2025 06:34:25 +0000 (15:34 +0900)] 
Reword descriptions of RestrictAddressFamilies= and SystemCallFilter= (#37367)

6 months agostring-table: annotate _to_string and _from_string with _const_ and _pure_, respectively
Mike Yuan [Tue, 6 May 2025 17:28:48 +0000 (19:28 +0200)] 
string-table: annotate _to_string and _from_string with _const_ and _pure_, respectively

Follow-up for c94f6ab1bf659963bd040301cfe24c991b8db069

6 months agoman/systemd.exec: reword description of RestrictAddressFamilies= 37367/head
Zbigniew Jędrzejewski-Szmek [Tue, 6 May 2025 18:59:59 +0000 (20:59 +0200)] 
man/systemd.exec: reword description of RestrictAddressFamilies=

The text is reordered and broken into more paragraphs.
A recommendation to combine RestrictAddressFamilies= with
SystemCallFilter=@service is added.

6 months agoman/systemd.exec: reword description of SystemCallFilter=
Zbigniew Jędrzejewski-Szmek [Tue, 6 May 2025 19:04:00 +0000 (21:04 +0200)] 
man/systemd.exec: reword description of SystemCallFilter=

The existing text grew organically as features were added and was
not very organized. Reorder it and break into paragraphs grouped
by topic. The description of the :errno syntax is replaced by a short
reference to the SystemCallErrorNumber= setting. This makes the
text shorter and makes it easier to explain how the two settings combine.

6 months agoReplace reference URLs with working ones
damnkiwi6120 [Tue, 6 May 2025 18:53:32 +0000 (02:53 +0800)] 
Replace reference URLs with working ones

The linuxfoundation.org entry at L50 goes 404, so I replace it with a working one from kernel.org.

Both links are checked with archive.org.
https://web.archive.org/web/20231114104223/https://lists.linuxfoundation.org/pipermail/virtualization/2015-August/030331.html
https://web.archive.org/web/20230503084037/https://docs.kernel.org/s390/pci.html

6 months agocore/service: minor cleanups (#37362)
Yu Watanabe [Tue, 6 May 2025 17:09:19 +0000 (02:09 +0900)] 
core/service: minor cleanups (#37362)

Split out from #37071

6 months agorun0: disable IgnoreSIGPIPE= for transient unit
Mike Yuan [Tue, 15 Apr 2025 19:19:25 +0000 (21:19 +0200)] 
run0: disable IgnoreSIGPIPE= for transient unit

6 months agoBugprone argument comments - round 3 (#37356)
Yu Watanabe [Tue, 6 May 2025 16:38:34 +0000 (01:38 +0900)] 
Bugprone argument comments - round 3 (#37356)

Follow up from https://github.com/systemd/systemd/pull/37346

6 months agodocs: fix typos
Salim B [Tue, 6 May 2025 15:33:54 +0000 (17:33 +0200)] 
docs: fix typos

6 months agotree-wide: Get rid of prefix_roota() in favor of path_join()
Daan De Meyer [Mon, 5 May 2025 10:05:15 +0000 (12:05 +0200)] 
tree-wide: Get rid of prefix_roota() in favor of path_join()

We deprecated prefix_roota() in favor of chase() and path_join().
Let's finish the removal by replacing the few remaining call sites
with path_join().

6 months agotree-wide: Remove strv_from_stdarg_alloca()
Daan De Meyer [Mon, 5 May 2025 10:42:08 +0000 (12:42 +0200)] 
tree-wide: Remove strv_from_stdarg_alloca()

It's trivial to replace all uses of this function with STRV_MAKE()
and strv_new_ap() so let's get rid of this variant.

6 months agomacro: implement ABS via __builtin_imaxabs()
Mike Yuan [Tue, 6 May 2025 12:41:17 +0000 (14:41 +0200)] 
macro: implement ABS via __builtin_imaxabs()

6 months agoboot: make console_key_read() return param optional
Lennart Poettering [Tue, 6 May 2025 13:05:05 +0000 (15:05 +0200)] 
boot: make console_key_read() return param optional

Inspired by #36684

6 months agoAdd missing alloc-util.h to string-util.h
Daan De Meyer [Tue, 6 May 2025 13:48:49 +0000 (15:48 +0200)] 
Add missing alloc-util.h to string-util.h

Used by strndupa_safe() and strdupa_safe().

Follow up for 02207b54d5edceb11fc1deea7553ff83ccb5acf6

6 months agocore: prefer American spelling of canceled 37356/head
Jelle van der Waa [Tue, 6 May 2025 14:24:42 +0000 (16:24 +0200)] 
core: prefer American spelling of canceled

6 months agolibsystemd-network: correct argument comment
Jelle van der Waa [Tue, 6 May 2025 11:26:06 +0000 (13:26 +0200)] 
libsystemd-network: correct argument comment

6 months agotreewide: correct argument comments for show_boot_entry
Jelle van der Waa [Tue, 6 May 2025 11:11:40 +0000 (13:11 +0200)] 
treewide: correct argument comments for show_boot_entry

6 months agotest: correct argument comment expected
Jelle van der Waa [Tue, 6 May 2025 11:08:06 +0000 (13:08 +0200)] 
test: correct argument comment expected

6 months agotreewide: correct argument comments for event_reset_time_relative
Jelle van der Waa [Tue, 6 May 2025 11:06:00 +0000 (13:06 +0200)] 
treewide: correct argument comments for event_reset_time_relative

6 months agoshared: use implementation argument naming for dissect_loop_device
Jelle van der Waa [Tue, 6 May 2025 10:56:18 +0000 (12:56 +0200)] 
shared: use implementation argument naming for dissect_loop_device

6 months agotreewide: correct argument comments for sd_notify
Jelle van der Waa [Tue, 6 May 2025 10:53:13 +0000 (12:53 +0200)] 
treewide: correct argument comments for sd_notify

6 months agocore: correct argument comments
Jelle van der Waa [Tue, 6 May 2025 10:27:00 +0000 (12:27 +0200)] 
core: correct argument comments

6 months agocore/service: correct comment in service_deserialize_exec_command() 37362/head
Mike Yuan [Wed, 9 Apr 2025 13:22:37 +0000 (15:22 +0200)] 
core/service: correct comment in service_deserialize_exec_command()

The index of ExecCommand is serialized, not PID.

6 months agocore/service: drop duplicate ExecCommand check
Mike Yuan [Mon, 5 May 2025 20:12:09 +0000 (22:12 +0200)] 
core/service: drop duplicate ExecCommand check

It is verified in config_parse_exec() and bus_set_transient_exec_command()
already.

6 months agoalloc-util: Move strdupa_safe() and strndupa_safe() to string-util.h
Daan De Meyer [Mon, 5 May 2025 19:50:56 +0000 (21:50 +0200)] 
alloc-util: Move strdupa_safe() and strndupa_safe() to string-util.h

6 months agosd-varlink: sd_varlink_dispatch rename table to dispatch_table
Jelle van der Waa [Tue, 6 May 2025 09:52:24 +0000 (11:52 +0200)] 
sd-varlink: sd_varlink_dispatch rename table to dispatch_table

Follow the argument style used throughout the codebase.

6 months agostring-util: Remove utf8.h and alloc-util.h includes
Daan De Meyer [Sun, 4 May 2025 15:43:09 +0000 (17:43 +0200)] 
string-util: Remove utf8.h and alloc-util.h includes

6 months agocleanup: bugprone argument issues (#37346)
Yu Watanabe [Tue, 6 May 2025 09:56:07 +0000 (18:56 +0900)] 
cleanup: bugprone argument issues (#37346)

Follow up from https://github.com/systemd/systemd/pull/37281

6 months agoVarious preparatory changes from #37344 (#37348)
Daan De Meyer [Tue, 6 May 2025 09:23:15 +0000 (11:23 +0200)] 
Various preparatory changes from #37344 (#37348)

6 months agohashmap: Drop debug params 37348/head
Daan De Meyer [Sun, 4 May 2025 11:31:07 +0000 (13:31 +0200)] 
hashmap: Drop debug params

Passing in the func, file and line information complicates the
interface. On top of that, it prevents forward declaring Hashmap in
strv.h, as we need to pass the macros everywhere that we allocate a
hashmap, which means we have to include the hashmap header everywhere
we have a function that allocates a hashmap instead of just having to
forward declare Hashmap.

Let's drop the file, func and line information from the debug information.
Instead, in the future we can add a description field to hashmaps like we
already have in various other structs to describe the purpose of the hashmap
which should be much more useful than having the file, line and function where
the hashmap was allocated.

6 months agomacro: Introduce ABS() macro and use it in header files
Daan De Meyer [Tue, 6 May 2025 07:53:56 +0000 (09:53 +0200)] 
macro: Introduce ABS() macro and use it in header files

abs() requires including the entirety of stdlib.h just for a single
trivial function. Let's introduce the ABS() macro and use it in header
files instead so we can get rid of stdlib.h transitive includes in header
files in a later commit.

6 months agostring-table: Move more implementation logic into functions
Daan De Meyer [Sat, 3 May 2025 15:59:19 +0000 (17:59 +0200)] 
string-table: Move more implementation logic into functions

Let's move some more implementation logic into functions. We keep
the logic that requires the macro in the macro and move the rest into
functions.

While we're at it, let's also make the parameter declarations of
all the string table macros less clausthrophobic.

6 months agomain-func: Reduce transitive includes
Daan De Meyer [Mon, 5 May 2025 20:06:17 +0000 (22:06 +0200)] 
main-func: Reduce transitive includes

Let's move some logic from _DEFINE_MAIN_FUNCTION() and other places
in main-func.h into functions that we implement in main-func.c to
allow moving some included headers from the header to the .c file.

6 months agoshared: fix leftover bool value from flags conversion 37346/head
Jelle van der Waa [Tue, 6 May 2025 07:31:50 +0000 (09:31 +0200)] 
shared: fix leftover bool value from flags conversion

Follow-up for 5c48335ef4cc1c930c86c6e893f3ab3e5472f7f6

6 months agohibernate-resume: automatically decrypt dissected swap (#37335)
Yu Watanabe [Tue, 6 May 2025 04:00:24 +0000 (13:00 +0900)] 
hibernate-resume: automatically decrypt dissected swap (#37335)

Closes https://github.com/systemd/systemd/issues/27247
(https://github.com/systemd/systemd/pull/35328,
https://github.com/systemd/systemd/issues/37330)

6 months agonetwork,udev: several improvements for logging (#37337)
Yu Watanabe [Tue, 6 May 2025 03:43:15 +0000 (12:43 +0900)] 
network,udev: several improvements for logging (#37337)

No functional changes. Continuation of #37269.

6 months agoprioq: coding style fixes
Yu Watanabe [Mon, 5 May 2025 13:28:16 +0000 (22:28 +0900)] 
prioq: coding style fixes

6 months agoshared: rename type to fstype
Jelle van der Waa [Mon, 5 May 2025 19:34:31 +0000 (21:34 +0200)] 
shared: rename type to fstype

Follow the argument comment naming already used.

6 months agonetwork: correct argument comments
Jelle van der Waa [Mon, 5 May 2025 17:47:49 +0000 (19:47 +0200)] 
network: correct argument comments

6 months agolibsystemd-network: fix typo in argument comment
Jelle van der Waa [Mon, 5 May 2025 17:38:18 +0000 (19:38 +0200)] 
libsystemd-network: fix typo in argument comment

6 months agohibernate-resume: automatically decrypt dissected swap if told so via autoSwap 37335/head
Mike Yuan [Sat, 3 May 2025 16:41:00 +0000 (18:41 +0200)] 
hibernate-resume: automatically decrypt dissected swap if told so via autoSwap

With the addition of /dev/disk/by-designator/ along with
ID_DISSECT_PART_DESIGNATOR attr, it is now trivial to tell
whether the swap device we hibernated into is the "auto" one.
Hence use that bit of info and generate cryptsetup unit
in hibernate-resume-generator if that's the case.

Ideally, gpt-auto should really just handle swap already
in initrd, which would save us a myriad of trouble and
the system behaves more consistently. But I don't see that
happening anytime soon. This is the second best option
we have I reckon.

Closes #27247 (#35328, #37330)

6 months agosleep: record whether the hibernation device is auto swap (with "swap" designator)
Mike Yuan [Sat, 3 May 2025 16:02:54 +0000 (18:02 +0200)] 
sleep: record whether the hibernation device is auto swap (with "swap" designator)

6 months agotreewide: correct argument comments for sd_notifyf
Jelle van der Waa [Mon, 5 May 2025 17:34:07 +0000 (19:34 +0200)] 
treewide: correct argument comments for sd_notifyf

6 months agoshared: fix typo in read_etc_hostname definition
Jelle van der Waa [Mon, 5 May 2025 17:32:52 +0000 (19:32 +0200)] 
shared: fix typo in read_etc_hostname definition

6 months agoresolve: update argument comments
Jelle van der Waa [Mon, 5 May 2025 17:31:13 +0000 (19:31 +0200)] 
resolve: update argument comments

6 months agoblockdev-util: don't use mixed style of retval in block_device_get_originating
Mike Yuan [Sat, 3 May 2025 19:01:54 +0000 (21:01 +0200)] 
blockdev-util: don't use mixed style of retval in block_device_get_originating

We have two typical styles of 'ret' param assignment + retval:

1) < 0 on actual error, 0 on nothing (ret == NULL), > 0 on something
2) recognizable errno on nothing, < 0 on other errors, >= 0 on something

but never use both at the same time.

6 months agocore/cgroup: block_get_originating() doesn't return > 0
Mike Yuan [Sat, 3 May 2025 19:00:15 +0000 (21:00 +0200)] 
core/cgroup: block_get_originating() doesn't return > 0

Follow-up for 612fc70fc0f5445817f3f5c033dd3d5b5fd058ea

6 months agomeson: Ensure that distribution packages own systemenvgeneratordir
Debarshi Ray [Fri, 2 May 2025 19:08:55 +0000 (21:08 +0200)] 
meson: Ensure that distribution packages own systemenvgeneratordir

Currently, Fedora's systemd RPM doesn't own systemenvgeneratordir
(ie., /usr/lib/systemd/system-environment-generators) [1] because it's
not created when systemd is installed.  In contrast, userenvgeneratordir
(ie., /usr/lib/systemd/user-environment-generators) is created, unless
the environment-d Meson option is explicitly disabled.

While this can be worked around elsewhere, it's better if the upstream
build system created the directories consistently.  It will avoid
repetition, and prevent silly bugs or deviations from creeping in.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2284085

6 months agomeson: Make sure check-filesystems.sh runs from the build directory
Daan De Meyer [Mon, 5 May 2025 15:00:24 +0000 (17:00 +0200)] 
meson: Make sure check-filesystems.sh runs from the build directory

run_command()'s working directory is documented as undefined but it
seems to be the current source directory as when the -ftime-trace
clang option is enabled, -.json is written to src/basic/meson.build
every time meson is run.

Let's make sure the command is executed in the build directory so that
any auxiliary files are written there as well.

6 months agounits: two tweaks for socket units (#37309)
Mike Yuan [Mon, 5 May 2025 13:13:00 +0000 (15:13 +0200)] 
units: two tweaks for socket units (#37309)

6 months agoudev/net: update log message 37337/head
Yu Watanabe [Sun, 4 May 2025 16:46:37 +0000 (01:46 +0900)] 
udev/net: update log message

6 months agoudev/net: mention which SR-IOV setting could not be applied in log message
Yu Watanabe [Sun, 4 May 2025 16:44:51 +0000 (01:44 +0900)] 
udev/net: mention which SR-IOV setting could not be applied in log message

6 months agonetwork/sriov: mention which setting could not be applied in log message
Yu Watanabe [Sun, 4 May 2025 16:36:40 +0000 (01:36 +0900)] 
network/sriov: mention which setting could not be applied in log message

6 months agonetwork: make log_link_message_full_errno() take format string
Yu Watanabe [Sun, 4 May 2025 16:33:05 +0000 (01:33 +0900)] 
network: make log_link_message_full_errno() take format string

6 months agonetwork/nexthop: split out nexthop_to_string()
Yu Watanabe [Sun, 4 May 2025 16:30:55 +0000 (01:30 +0900)] 
network/nexthop: split out nexthop_to_string()

6 months agonetwork/route: split out route_to_string() from log_route_debug()
Yu Watanabe [Sun, 4 May 2025 16:30:01 +0000 (01:30 +0900)] 
network/route: split out route_to_string() from log_route_debug()

6 months agohwdb: add HP 150 Wired Mouse (#37341)
madroach [Mon, 5 May 2025 12:34:33 +0000 (14:34 +0200)] 
hwdb: add HP 150 Wired Mouse (#37341)

6 months agoman/systemctl: add preposition for clarity
Alexander Stepchenko [Mon, 5 May 2025 10:48:30 +0000 (13:48 +0300)] 
man/systemctl: add preposition for clarity

6 months agoman/network: Note .link early boot caveat, and .network .netdev usage.
Tim Small [Fri, 2 May 2025 12:40:00 +0000 (13:40 +0100)] 
man/network: Note .link early boot caveat, and .network .netdev usage.

Document .link .network and .netdev file type distinctions in early
introductory text, and document distro-specific need to sync link files
with early-boot copies, see Debian bug 1005282:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005282 for an
example.

6 months agoVmspawn fixes (#37320)
Yu Watanabe [Sun, 4 May 2025 03:24:04 +0000 (12:24 +0900)] 
Vmspawn fixes (#37320)

Fixes
https://github.com/systemd/systemd/pull/36618#issuecomment-2844694845

and

```
qemu-kvm: -device vmgenid,guid=5f303a47-6fae-4dd7-969c-6c1ea61e816e: 'vmgenid' is not a valid device model name
```

6 months agocore: rename core-varlink -> varlink
Mike Yuan [Thu, 1 May 2025 20:48:01 +0000 (22:48 +0200)] 
core: rename core-varlink -> varlink

To make things consistent with dbus.[ch]

6 months agoVarious changes to prepare for running IWYU on the repository (#37319)
Daan De Meyer [Fri, 2 May 2025 11:41:31 +0000 (13:41 +0200)] 
Various changes to prepare for running IWYU on the repository (#37319)

These are various commits that were required to get things compiling
after running IWYU. I think all of them make sense on their own, hence
this split PR to merge them ahead of time.

6 months agovmspawn: fix grow_image: Assertion `path' failed. 37320/head
Arian van Putten [Thu, 1 May 2025 11:58:21 +0000 (11:58 +0000)] 
vmspawn: fix grow_image: Assertion `path' failed.

arg_image might be NULL (e.g. when booting a USI, or when passing -D)

6 months agovmspawn: don't use vmgenid on aarch64 as it's not supported
Arian van Putten [Thu, 1 May 2025 11:19:24 +0000 (13:19 +0200)] 
vmspawn: don't use vmgenid on aarch64 as it's not supported

fixes:

```
qemu-kvm: -device vmgenid,guid=5f303a47-6fae-4dd7-969c-6c1ea61e816e: 'vmgenid' is not a valid device model name
```

6 months agotest: Remove unused sources from tests 37319/head
Daan De Meyer [Thu, 1 May 2025 12:39:58 +0000 (14:39 +0200)] 
test: Remove unused sources from tests

6 months agosocket-util: Replace sockaddr length macros with functions
Daan De Meyer [Wed, 30 Apr 2025 20:09:37 +0000 (22:09 +0200)] 
socket-util: Replace sockaddr length macros with functions

There's no need for these to be macros, let's just make them regular
functions instead.

6 months agonetworkd-network-gperf.gperf: Add various missing includes
Daan De Meyer [Wed, 30 Apr 2025 20:39:07 +0000 (22:39 +0200)] 
networkd-network-gperf.gperf: Add various missing includes

We currently include these transitively but to allow using IWYU to
remove headers later, let's add these as direct includes so the IWYU
changes don't break compilation.

6 months agoshared: Make sure ip-protocol-xxx.h headers include <netinet/in.h>
Daan De Meyer [Wed, 30 Apr 2025 19:48:39 +0000 (21:48 +0200)] 
shared: Make sure ip-protocol-xxx.h headers include <netinet/in.h>

These headers use macros from <netinet/in.h> so let's make sure they
include the header.

6 months agoshared: Add blkid-util.c
Daan De Meyer [Wed, 30 Apr 2025 19:35:43 +0000 (21:35 +0200)] 
shared: Add blkid-util.c

IWYU analyzes source files and their corresponding header file so
let's add a source file blkid-util.c so blkid-util.h is analyzed as
well.

6 months agobasic: Add our own net/if_arp.h header
Daan De Meyer [Wed, 30 Apr 2025 19:11:07 +0000 (21:11 +0200)] 
basic: Add our own net/if_arp.h header

To avoid conflicts with <linux/if_arp.h>.

6 months agodaemon-util: Rename starting/stopping message constants
Daan De Meyer [Wed, 30 Apr 2025 10:20:40 +0000 (12:20 +0200)] 
daemon-util: Rename starting/stopping message constants

Currently, NOTIFY_READY from daemon-util.h conflicts with NOTIFY_READY
from NotifyState from service.h so let's rename the constants to avoid
the conflict.

6 months agosd-id128: Use static instead of _SD_ARRAY_STATIC in source files
Daan De Meyer [Wed, 30 Apr 2025 08:09:00 +0000 (10:09 +0200)] 
sd-id128: Use static instead of _SD_ARRAY_STATIC in source files

When compiling the source files, we know static is going to be available
so there's no need to use the macro from _sd-common.h and we can just use
static instead.

6 months agofundamental: Insert some missing conditional includes
Daan De Meyer [Fri, 25 Apr 2025 13:50:50 +0000 (15:50 +0200)] 
fundamental: Insert some missing conditional includes

IWYU can't insert these inside the correct condition itself so we
add these manually in a separate commit.

6 months agobuild(deps): bump softprops/action-gh-release from 2.2.1 to 2.2.2
dependabot[bot] [Thu, 1 May 2025 09:09:47 +0000 (09:09 +0000)] 
build(deps): bump softprops/action-gh-release from 2.2.1 to 2.2.2

Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda...da05d552573ad5aba039eaac05058a918a7bf631)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agobuild(deps): bump redhat-plumbers-in-action/gather-pull-request-metadata
dependabot[bot] [Thu, 1 May 2025 09:09:45 +0000 (09:09 +0000)] 
build(deps): bump redhat-plumbers-in-action/gather-pull-request-metadata

Bumps [redhat-plumbers-in-action/gather-pull-request-metadata](https://github.com/redhat-plumbers-in-action/gather-pull-request-metadata) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/redhat-plumbers-in-action/gather-pull-request-metadata/releases)
- [Commits](https://github.com/redhat-plumbers-in-action/gather-pull-request-metadata/compare/17821d3bc27c1efed339595898c2e622accc5a1b...5da2967931dd7c4b9ccd22f49b045e2c1f05165b)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/gather-pull-request-metadata
  dependency-version: 1.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agovarious: convert more readers of /proc/ to plain read_full_file() (#37299)
Yu Watanabe [Thu, 1 May 2025 06:28:34 +0000 (15:28 +0900)] 
various: convert more readers of /proc/ to plain read_full_file() (#37299)

Continuation of #36734

Apparently I was wrong about everything under `/proc/` being seq_file,
but at least there're some more to convert and we can leverage our
helper func while doing so.

6 months agoaudit-util: use read_full_virtual_file() 37299/head
Mike Yuan [Thu, 13 Mar 2025 15:03:42 +0000 (16:03 +0100)] 
audit-util: use read_full_virtual_file()

Conversely this one is "raw" file, but let's switch to
static inline helper for it.

6 months agorlimit-util: use read_full_file() for /proc/PID/limits
Mike Yuan [Thu, 13 Mar 2025 17:04:52 +0000 (18:04 +0100)] 
rlimit-util: use read_full_file() for /proc/PID/limits

This one uses "seq_file", i.e. normal FILE stream just works.

6 months agosd-bus/bus-creds: use plain read_full_file() for process cmdline
Mike Yuan [Thu, 13 Mar 2025 15:04:33 +0000 (16:04 +0100)] 
sd-bus/bus-creds: use plain read_full_file() for process cmdline

This one uses "seq_file", i.e. normal FILE stream just works.

6 months agoprocess-util: use procfs_file_get_field() where appropriate
Mike Yuan [Thu, 13 Mar 2025 14:46:03 +0000 (15:46 +0100)] 
process-util: use procfs_file_get_field() where appropriate

6 months agoprocess-util: introduce procfs_file_get_field() wrapper
Mike Yuan [Wed, 30 Apr 2025 17:34:23 +0000 (19:34 +0200)] 
process-util: introduce procfs_file_get_field() wrapper

which combines procfs_file_alloca() and get_proc_field()

6 months agoprocess-util: assert on pid in procfs_file_alloca(), use strjoina()
Mike Yuan [Wed, 30 Apr 2025 17:43:20 +0000 (19:43 +0200)] 
process-util: assert on pid in procfs_file_alloca(), use strjoina()

6 months agomountpoint-util: use get_proc_field()
Mike Yuan [Thu, 13 Mar 2025 15:09:55 +0000 (16:09 +0100)] 
mountpoint-util: use get_proc_field()

6 months agopidfd-util: use get_proc_field() for pidfd_get_pid_fdinfo()
Mike Yuan [Thu, 13 Mar 2025 13:54:04 +0000 (14:54 +0100)] 
pidfd-util: use get_proc_field() for pidfd_get_pid_fdinfo()

6 months agofileio: modernize get_proc_field()
Mike Yuan [Thu, 13 Mar 2025 13:49:13 +0000 (14:49 +0100)] 
fileio: modernize get_proc_field()

- Drop effectively unused "terminator" param, imply whitespace
- Make ret param optional
- Return ENODATA if the requested key is not found, rather than
  ENOENT
- Turn ENOENT -> ENOSYS if /proc/ is not mounted
- Don't skip whitespaces before ':', nothing needs this handling
  anyways
- Remove the special treatment for all "0"s. We don't actually
  use this for capabilities given pidref_get_capability() exists
- Switch away from read_full_virtual_file() - files using "field"
  scheme under /proc/ seem all to be "seq_file"s (refer to
  da65941c3ee03495541c3bffbccc9012c8d9a5f8 for details on file types)

6 months agosocket-activate: drop unused accept param for open_sockets()
Mike Yuan [Tue, 29 Apr 2025 15:35:10 +0000 (17:35 +0200)] 
socket-activate: drop unused accept param for open_sockets()

6 months agosd-stub: fix assertion failure when cleaning up initrd pages
Luca Boccassi [Wed, 30 Apr 2025 22:21:46 +0000 (23:21 +0100)] 
sd-stub: fix assertion failure when cleaning up initrd pages

When linux_exec() fails, the initrd pages cleanup attempts to run,
and an assertion is triggered:

../src/boot/linux.c:125@linux_exec: Error loading kernel image: Security violation
../src/boot/util.h:81@cleanup_pages: Error freeing pages: Not found
../src/boot/log.c:30@efi_assert: systemd-boot: Assertion 'r == EFI_SUCCESS' failed at ../src/boot/util.h:82@cleanup_pages, halting.

(log message is new)

This was introduced by https://github.com/systemd/systemd/pull/36715

Before that change, given the argument to xmalloc_pages() was passed as EFI_SIZE_TO_PAGES(n_pages), that's
what ended up in Pages.n_pages. After this change, n_pages gets assigned without being transformed by
EFI_SIZE_TO_PAGES, so the cleanup can find them again. That change causes the assertion failure to trigger.
Changing this to .n_pages = EFI_SIZE_TO_PAGES(n_pages) fixes the assertion.

Follow-up for c5a50467921f615846b3bbe3c3ff592953a6163a

6 months agoresolve: Simplify and optimize meson file
Daan De Meyer [Wed, 30 Apr 2025 14:20:15 +0000 (16:20 +0200)] 
resolve: Simplify and optimize meson file

We were compiling the same resolved sources over and over again (up to
10 times) which had a substantial effect on build times. Let's make sure
we only compile the resolved sources once by having one static library
containing the objects for all the resolved sources.

While we're at it, get rid of unnecessary variables and includes in the
resolve meson file and generally clean things up a bit.

Before (recorded with ClangBuildAnalyzer):

**** Time summary:
Compilation (1823 times):
  Parsing (frontend):          675.5 s
  Codegen & opts (backend):     81.6 s

After:

**** Time summary:
Compilation (1585 times):
  Parsing (frontend):          553.6 s
  Codegen & opts (backend):     70.7 s

6 months agomkosi: update debian commit reference to 9c54c974f07038bf6737fa02d78f20d340107f5c
Luca Boccassi [Thu, 1 May 2025 00:53:02 +0000 (01:53 +0100)] 
mkosi: update debian commit reference to 9c54c974f07038bf6737fa02d78f20d340107f5c

9c54c974f0 d/systemd-resolved.install: install new socket units for upstream profile