Commit Graph
4927 Commits
Author SHA1 Message Date
Daan De Meyer 92ea9584c6 test-namespace: Migrate to new assertion macros 2025-10-30 13:36:05 +01:00
Yu Watanabe 687bb9e2ce test: sort libraries in test-dlopen-so 2025-10-25 14:03:13 +09:00
Yu Watanabe d0520b1ee7 module-util: drop 'sym_' prefix from cleanup functions 2025-10-25 11:12:16 +09:00
Daniel Hast 101dd41cb4 tree-wide: add basic validation of --background argument
Check whether the argument of the `--background` option of
`systemd-run`, `run0`, `systemd-nspawn`, `systemd-vmspawn`, and
`systemd-pty-forward` is either empty or looks like an ANSI color code,
and reject invalid values when parsing arguments.

We consider a string to look like an ANSI color code if it consists of
one or more sequences of ASCII digits separated by semicolons. This
permits every valid ANSI color code, and should reject anything that
results in garbled output.
2025-10-25 09:56:31 +09:00
Yu Watanabe 9b414a38fa tree-wide: drop unused libcap dependencies 2025-10-24 01:52:59 +09:00
Yu Watanabe 2bf880892e test: use have_inheritable_cap() in test_apply_ambient_caps()
This also make the test case use ASSERT_XYZ() macros.
2025-10-24 01:52:59 +09:00
Yu Watanabe 96f2255637 test: replace cap_to_text() with capability_get() and capability_set_to_string() 2025-10-24 01:52:59 +09:00
Yu Watanabe aa8ab67a6d capability-util: introduce capability_apply() and use it in capability_ambient_set_apply() 2025-10-24 01:52:59 +09:00
Yu Watanabe 7de349c1ed test: use CAP_LIMIT at one more place 2025-10-24 01:52:56 +09:00
Yu Watanabe 4c0cdc4a2c capability-util: tighten requirement for CAP_LAST_CAP off by one
Otherwise, we cannot use UINT64_MAX as 'unset'.
2025-10-24 01:52:18 +09:00
Yu Watanabe 2a6b084cc6 capability-list: make capability_list_length() return unsigned 2025-10-23 23:46:49 +09:00
Lennart Poettering 757887d01d rereadpt: implement userspace-based BLKRRPART re-implementation 2025-10-22 22:56:01 +02:00
Lennart Poettering 524ebfe28a blockdev-util: split out partition device node generation from dissect-util.c 2025-10-22 22:56:01 +02:00
Yu Watanabe 97d38155db Several preparations for supporting new coredump interface (#39350) 2025-10-20 20:44:22 +09:00
Yu Watanabe 20332d7caf network/dhcp-server: several follow-ups for domain option (#39380)
Follow-ups for 3eb7b881bd (#39260).
2025-10-20 20:17:59 +09:00
Lennart Poettering e5dc5821ff dns-domain: make dns_name_change_suffix() work with an empty/null suffix 2025-10-20 10:35:23 +02:00
Yu Watanabe c6d97d9e08 test: add unit test for dns_name_parent() 2025-10-20 12:01:22 +09:00
Yu Watanabe 64595f1cb3 hostname-setup: introduce pidref_gethostname_full() 2025-10-19 10:01:46 +09:00
Luca Boccassi d0a066a1a4 test: avoid divide-by-zero coverity warning
CID#1587762
2025-10-17 16:44:15 +01:00
Daan De Meyer 06d73c5046 implement ExecContext for io.systemd.Unit.List (#38212) 2025-10-16 19:06:46 +02:00
Govind Venugopal 48c64813ec varlink: omit empty parameters field in JSON messages (#38922)
When varlink parameters are empty, omit the "parameters" field entirely
rather than sending "parameters":{}. This reduces message size and
follows varlink specification which allows parameters to be omitted.

The implementation supports three equivalent representations for empty
parameters: field omission, JSON null, and empty object {}. All three
are accepted on input for backward compatibility.

Fixes: #38474
2025-10-16 17:06:17 +02:00
Daan De Meyer f102bc3e5f tree-wide: Introduce sd-forward.h and shared-forward.h headers
Let's not leak details from src/shared and src/libsystemd into
src/basic, even though you can't actually do anything useful with
just forward declarations from src/shared.

The sd-forward.h header is put in src/libsystemd/sd-common as we
don't have a directory for shared internal headers for libsystemd
yet.

Let's also rename forward.h to basic-forward.h to keep things
self-explanatory.
2025-10-16 17:00:29 +02:00
Ivan Kruglov 3de607b48b basic: secure_bits_to_strv() 2025-10-16 03:29:14 -07:00
Yu Watanabe d1893390e5 test-kernel-install: support the case when custom default locale is specified
This also makes 'diff' command output to stderr, otherwise the
difference is eaten by meson by default, so hard to debug.
2025-10-13 10:31:43 +02:00
Frantisek Sumsal 937f609b41 test: build the crashing test binary outside of the test
So we don't have to pull in gcc and other stuff into it.

Also, make the test itself a bit more robust and debug-able.
2025-10-11 22:37:33 +02:00
Lennart Poettering ed1c2d1541 test-varlink-idl: add all missing IDL fragments
Let's also order the output alphabetically
2025-10-08 11:31:59 +02:00
Zbigniew Jędrzejewski-Szmek ea44302b29 meson: using f-strings in meson
Those were added before 0.61 which is our minimum version.

Dots were dropped from the end of some messages. Most messages did not have the
trailing dot.

0.63 added support for multi-line f-strings. We can't use those yet.
2025-10-03 21:21:52 +02:00
Yu Watanabe 8431368668 tree-wide: stop assigning colon prefixed timezone to $TZ
glibc (and also musl, though we do not officially support it yet)
silently ignores colon prefix in $TZ. Let's always not prefix the
timezone.

tzset(3) states:
> A nonempty value of TZ can be one of two formats, either of which can
> be preceded by a colon which is ignored.

Addresses https://github.com/systemd/systemd/pull/38876#discussion_r2384347594.
2025-09-28 11:14:00 +09:00
Yu Watanabe 7d6f1d695c timedatectl,test: use SAVE_TIMEZONE at more places 2025-09-28 10:10:47 +09:00
Yu Watanabe 514fa9d39a time-util: fix issues in parse_timestamp() and optimize performance
Previously, an input string ends with short timezone spec e.g. WET,
was parsed by setting $TZ environment variable to the timezone.
But the timezone might be different from the original local timezone,
thus the result might not follow the timezone change in the original
local timezone.

This makes the check of the short timezone spec with tzname[] earlier,
then it is not necessary to load another timezone file for e.g. WET,
and provides expected time.

This also make it use SAVE_TIMEZONE macro and drop use of forking
process. This makes greatly improve performance when parsing string
that contains timezone different from the current local timezone.

Unfortunately, there is still one corner case that our test fails.
When tzdata is built with rearguard enabled, then at least
Africa/Windhoek timezone does not provide correct time, but time shifted
1 hour from the original.
2025-09-27 11:52:24 +09:00
Yu Watanabe 23407c1806 time-util: introduce parse_gmtoff() helper function 2025-09-27 11:52:24 +09:00
Yu Watanabe e3f561a624 time-util: introduce SAVE_TIMEZONE macro 2025-09-27 11:51:06 +09:00
Daan De Meyer 4feade85d7 dissect: Add more debug logging (#39125) 2025-09-26 11:53:35 +02:00
Lennart Poettering bd4c39a384 mute console kernel log/pid1 status output while firstboot is running (#39101)
This is also preparation for the installer later, split out of #38764.
It makes the experience a lot nicer if our nice little tools aren't
constantly interrupted by log spew from the kernel.

Fixes: #34448
2025-09-26 11:12:24 +02:00
Lennart Poettering 83b6ef9b62 libselinux: turn into dlopen() dep 2025-09-26 11:12:04 +02:00
Lennart Poettering ac63a04bd6 mute-console: add simple varlink service that can disable log/status spew to kernel console
For "wizard" style interactive tools it's very annoying if they are
interrupted by kernel log output or PID1's status output. let's add some
infra to disable this temporarily. I decided to implement this as an IPC
service so that we can make this robust: if the client request the
muting dies we can automatically unmute again.

This is hence a tiny varlink service, but it can also be started
directly from the cmdline.
2025-09-26 09:42:13 +02:00
Yu Watanabe e8a5cda471 core/bpf-firewall: replace unnecessary unit_setup_cgroup_runtime() with unit_get_cgroup_runtime()
Except for the test, bpf_firewall_compile() is only called by the following:
  cgroup_context_apply() -> cgroup_apply_firewall() -> bpf_firewall_compile()
and in the early stage of cgroup_context_apply(), it checks if the cgroup
runtime exists. Hence, it is not necessary to try to allocate the
runtime in bpf_firewall_compile().
2025-09-26 09:28:12 +09:00
Lennart Poettering b3243f4bee libmount: make dlopen() dependency 2025-09-26 08:29:37 +09:00
Lennart Poettering aaca6bd5d9 libseccomp: turn into dlopen() dependency 2025-09-26 03:30:11 +09:00
Daan De Meyer 946cc446c0 gpt: Introduce function to convert verity hash or sig to data partition
Let's rename the existing partition_verity_to_data() to
partition_verity_hash_to_data() and make a new partition_verity_to_data() that
handles both verity hash and verity signature partitions.

Rename other functions to match the new naming.
2025-09-25 20:06:11 +02:00
Lennart Poettering c349edfe49 libblkid: turn into dlopen() based dep 2025-09-24 18:13:10 +02:00
Lennart Poettering d71f2899bd meson: drop libblkid dep from components not using it directly 2025-09-24 18:11:12 +02:00
Lennart Poettering 74b8ab014b glyph-util: add more emojis 2025-09-24 15:45:28 +02:00
Lennart Poettering 7c3a7f925f acl: turn libacl dep into a dlopen() one
I initially didn't think it would be worth doing this, but I changed my
mind. People out there quite successfully build systemd without ACL
support, and that suggests life without it is quite possible. Moreover
we only use it as very specific places:

1. in udev/logind for "uaccess" mgmt
2. in tmpfiles to implement explicitly configured acl changes
3. in journald/coredump/pstore to manage access to unpriv users
4. in pid1 to manage access to credential files
5. when shifting UIDs of container trees

I specific container environments it should be entirely fine to live without all
of these, hence let's pull this in on demand only.
2025-09-24 09:47:41 +02:00
Lennart Poettering ab2b430487 tree-wide: drop deps on libacl
test-shift-uid.c doesn't actually use anything from libacl. It all goes
through shared/, and the dep there is enough.

Same for the coredump stuffi, logind and core/.

And pstore doesn't use it at all, neither directly or indirectly.
2025-09-24 09:47:30 +02:00
Lennart Poettering 882c9ce040 pam: make libpam a dlopen() based dependency 2025-09-20 08:41:20 +02:00
Lennart Poettering 6aaff2d532 repart: some smaller tweaks (#38995) 2025-09-19 17:43:52 +02:00
Lennart Poettering 2f5fb752a6 repart: tweak byte value output
So far, when outputing information about copy progress we'd suppress the
digit after the dot if it is zero. That makes the progress bar a bit
"jumpy", because sometimes there are two more character cells used than
other times. Let's just always output one digit after the dot here
hence, to avoid this.
2025-09-19 16:46:07 +02:00
Lennart Poettering 4d8c5c657a build: make libaudit dep dlopen() 2025-09-19 16:30:13 +02:00
Daan De Meyer 8796164189 tree-wide: Remove unused includes (#39023) 2025-09-19 16:07:04 +02:00