Commit Graph

84748 Commits

Author SHA1 Message Date
Daan De Meyer
8bb6f4f164 stdio-bridge: Add --quiet option
When we use stdio-bridge via sd-bus to connect to a bus of a different
user, container or host, stdio-bridge should not log at error level but
at debug level as it's invoked by the sd-bus library and sd-bus should
generally not log above debug level.

We can't actually use the --quiet option yet as that would break connecting
to hosts running older versions of systemd but let's already add the option
now in preparation for a brighter future.
2025-11-13 14:45:51 +01:00
Daan De Meyer
0d91a204cb bus-wait-for-jobs: Make sure we always debug log
If we're not logging at a higher priority level, let's still log
at debug log level to help with debugging.
2025-11-13 14:45:51 +01:00
Daan De Meyer
164fc38888 shared: Forward declare InstallChange in shared-forward.h 2025-11-13 14:41:25 +01:00
Zbigniew Jędrzejewski-Szmek
00725c3c4f Make journal persistent by default (#39624)
See second commit for details.
2025-11-13 09:43:00 +01:00
Daan De Meyer
c50a8fc22f test: use new macros and move several test cases (#39708) 2025-11-13 09:42:12 +01:00
Mike Yuan
6dd412bc50 time-util: do not carry musl-specific fallback logic on glibc systems
Follow-up for 3ac4d68498

We have no sensible way to detect why strptime() fails, hence
the fallback path as it is now would fire on glibc systems too,
pointlessly. Let's guard it behind ifdeffery.
2025-11-13 09:40:20 +01:00
Yu Watanabe
4a028994df user-util: fix typo
Follow-up for b10fd796f5.
2025-11-13 15:36:47 +09:00
Yu Watanabe
e9c5af74ea test: move several test cases to test-tmpfile-util.c 2025-11-13 09:19:56 +09:00
Yu Watanabe
6300e2a9ee test: move several test cases to test-env-file.c 2025-11-13 09:19:56 +09:00
Yu Watanabe
cd62f9ad71 test-fileio: migrate to use new ASSER_OK() macro and friends
This also replaces fgets() with read_full_file().
2025-11-13 09:19:28 +09:00
Luca Boccassi
5b3874929a mkosi: update debian commit reference to efdd7a6377c7251011ca2c1a59115d482d25fe61
* efdd7a6377 Install new file for upstream build
* 9ebdc6099e d/rules: enable 10-systemd-logind-root-ignore-inhibitors.rules.example on Ubuntu
* 1255cc7663 initramfs-tools: only skip chzdev rules if zdev_early=0
* 4675b281ee d/t/boot-and-services: skip apparmor test on armhf
* 214d6e37b2 d/t/boot-and-services: run transient unit to check syslog messages
* f4e196aa26 d/t/boot-and-services: tweak test_rsyslog regex
* dbd366a43e Install new files for upstream build
* bb7f8ef532 Install new files for upstream build
* efa7cee8a7 Install new file for upstream build
* 95aa1d1685 Install new file for upstream build
* b770f0f01b kernel-install: skip 55-initrd.install when an initrd generator is configured
* af8d1e3134 Update changelog for 258.1-2 release
* 2d0e73cd14 d/libnss-systemd.postinst: Ensure module is enabled for all four databases
2025-11-12 23:39:45 +00:00
Zbigniew Jędrzejewski-Szmek
2eaceed0b1 journald: do not allow persistent journal storage in the initrd
If the user managed to configure persistent storage in the journal
in the initrd, e.g. by creating /var/log/journal with default of 'auto',
we could end up writing entries there. Let's make sure this doesn't
happen.
2025-11-13 00:08:31 +01:00
Zbigniew Jędrzejewski-Szmek
238bb65c0f meson: make persistent journal the default 2025-11-13 00:08:31 +01:00
Zbigniew Jędrzejewski-Szmek
7af88c1e1e journald: allow default storage mode to be configured
So far the idea was that the default is 'auto', and if appropriate, the
distribution will create /var/log/journal/ to tell journald to use persistent
mode. This doesn't work well with factory resets, because after a factory reset
obviously /var/log is gone. That old default was useful when journald was new
and people were reluctant to enable persistent mode and instead relied on
rsyslog and such for the persistent storage. But nowadays that is rarer, and
anyway various features like user journals only work with persistent storage,
so we want people to enable this by default. Add an option to flip the default
and distributions can opt in. The default default value remains unchanged.

(I also tested using tmpfiles to instead change this, since we already set
access mode for /var/log/journal through tmpfiles. Unfortunately, tmpfiles runs
too late, after journald has already started, so if tmpfiles creates the
directory, it'll only be used after a reboot. This probably could be made to
work by adding a new service to flush the journal, but that becomes complicated
and we lose the main advantage of simplicity.)

Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1387796.
2025-11-13 00:08:31 +01:00
Zbigniew Jędrzejewski-Szmek
7e9a787a86 man: stop inventing custom entity names for docbook
For some reason, the entity names configured in custom-entities.ent
used abbreviated names. This just creates unnecessary confusion, so update
to use the same name as the config dict.

Reword some surrounding sentences while at it.
2025-11-13 00:08:27 +01:00
Zbigniew Jędrzejewski-Szmek
e601bed945 meson: make journald.conf templated
A noop, in preparation for subsequent changes.
2025-11-13 00:07:12 +01:00
Zbigniew Jędrzejewski-Szmek
e1ddcb1125 man: fedora 43 is the latest stable 2025-11-12 23:01:48 +00:00
Zbigniew Jędrzejewski-Szmek
aff5c0af8b docs/BACKPORTS: update
We now keep stable branches in the main repo. Update the description
to match current practice.

Closes https://github.com/systemd/systemd/issues/35846.
2025-11-12 23:01:35 +00:00
Luca Boccassi
56d19b633d boot: coding style cleanups 2025-11-12 23:44:06 +01:00
Yu Watanabe
43e4c91fc0 musl: avoid conflict between fcntl.h and basic-forward.h
glibc defines AT_FDCWD as -100, but musl defines it as (-100).
In basic-forward.h, we also define AT_FDCWD as -100, hence musl's fcntl.h
conflicts with forward.h. This is for avoiding the conflict.
2025-11-12 23:28:01 +01:00
Yu Watanabe
fe6e6cb6a0 time-util: several fixlets/workarounds for supporting musl (#39688) 2025-11-13 05:18:25 +09:00
Yu Watanabe
d278d5bc3d sd-journal: fix relative path handling (#38681)
Fixes #38667.
2025-11-13 05:12:00 +09:00
Yu Watanabe
ca3933bf49 core/dbus-service: validate type of received ExecContext fds (#39680) 2025-11-13 05:11:07 +09:00
Yu Watanabe
7ebfcfc17b meson: add musl support (#39686) 2025-11-13 05:10:22 +09:00
Yu Watanabe
7dad0db2ee musl: meson: gracefully disable gshadow, nss, and idn support
- musl does not support gshadow, and does not provide gshadow.h,
- musl does not support nss, and does not provide nss.h which is necessary
  for each nss modules,
- musl does not provide NI_IDN.
2025-11-13 04:44:32 +09:00
Yu Watanabe
17e343b58b musl: meson: check existence of renameat2()
musl-1.2.5 does not provide renameat2(). Note, it is added by
05ce67fea9,
hence hopefully it will be provided by musl-1.2.6 or newer.
2025-11-13 04:44:00 +09:00
Yu Watanabe
0736854da9 musl: meson: make musl not define wchar_t in their header
Otherwise, musl defines wchar_t as int, which conflicts with the
assumption by sd-boot, i.e. wchar_t is 2 bytes.

Fixes the following build error:
```
In file included from ../src/boot/efi-log.h:4,
                 from ../src/boot/linux_x86.c:13:
../src/boot/efi.h:19:24: error: conflicting types for 'wchar_t'; have 'short unsigned int'
   19 | typedef __WCHAR_TYPE__ wchar_t;
      |                        ^~~~~~~
In file included from /usr/include/stddef.h:19,
                 from ../src/boot/efi.h:9:
/usr/include/bits/alltypes.h:10:13: note: previous declaration of 'wchar_t' with type 'wchar_t' {aka 'int'}
   10 | typedef int wchar_t;
      |             ^~~~~~~
```
2025-11-13 04:44:00 +09:00
Yu Watanabe
fb33d20c07 musl: meson: explicitly set _LARGEFILE64_SOURCE
glibc sets it when _GNU_SOURCE is defined, however, musl does not.
Let's explicitly define it to make getdents64() and struct dirent64
available even when building with musl.
2025-11-13 04:44:00 +09:00
Yu Watanabe
bd19ffd9cb musl: meson: explicitly link with libintl when necessary
On some musl based distributions dgettext() may be provided by libintl.so.
Hence, we need to add dependency in that case.
2025-11-13 04:44:00 +09:00
Yu Watanabe
a4c45279a7 musl: meson: allow to choose libc implementation
This also introduces skeleton directories for storing musl specific code.
2025-11-13 04:44:00 +09:00
Daan De Meyer
e182d66faa test-varlink: Migrate to new assertion macros 2025-11-12 19:59:05 +01:00
Daan De Meyer
3150c34270 run0: Never ask --empower sessions for polkit auth
A --empower session is effectively root without being UID 0, so it
doesn't make sense to enforce polkit authentication in those. Let's
add the empower group, add --empower sessions to that group and ship
a polkit rule to skip authentication for all users in the empower
group.

(As a side-effect this will also allow users to add themselves to this
group outside of 'run0 --empower' to mimick NOPASSWD from sudo)
2025-11-12 19:55:35 +01:00
Yu Watanabe
f8a3ae1be6 musl: test-time-util: skip parsing back when currently unused timezone is set 2025-11-13 03:13:59 +09:00
Yu Watanabe
8d5b306bb9 musl: time-util: skip tm.tm_wday check
musl does not set tm_wday when it is explicitly requested.
The check is not necessary at all, it is just for safety.
Let's skip it when built with musl.
2025-11-13 03:13:59 +09:00
Yu Watanabe
6431f2e072 musl: time-util: introduce get_tzname() helper function
musl leaves the DST timezone name unset if there is no DST.
The helper function maps that back to no DST.
2025-11-13 03:13:55 +09:00
Yu Watanabe
3ac4d68498 musl: time-util: make parse_gmtoff() accept extended timezone offset format
musl v1.2.5 does not support %z specifier in strptime(). Since
fced99e93d
%z is supported, but it only supports strict RFC-822/ISO 8601 format,
that is, 4 digits with sign (e.g. +0900 or -1400), but does not support
extended format: 2 digits or colon separated 4 digits (e.g. +09 or -14:00).
Let's add fallback logic to make it support the extended timezone spec.
2025-11-13 02:40:32 +09:00
Daan De Meyer
d82d500b40 Migrate various tests to new assertion macros (#39691)
Split out of #39608
2025-11-12 16:17:38 +01:00
Mike Yuan
8be3780699 core/dbus-service: validate type of received ExecContext fds 2025-11-12 15:44:51 +01:00
Mike Yuan
51bb3a0932 logind-session-dbus: use fd_vet_accmode() where appropriate 2025-11-12 15:44:50 +01:00
Mike Yuan
2c5d73660e test-fd-util: add unit test for fd_vet_accmode()
Co-authored-by: Chris Down <chris@chrisdown.name>
2025-11-12 15:44:50 +01:00
Mike Yuan
7cf4f07567 fd-util: introduce fd_vet_accmode()
Inspired by #39674
2025-11-12 15:44:50 +01:00
Yu Watanabe
733c5c98ad sd-journal: resolve paths passed to sd_journal_open_files() and friends
Fixes #38667.
2025-11-12 15:18:40 +01:00
Yu Watanabe
09811f99f4 sd-journal: use -EBADF for invalidated file descriptor 2025-11-12 15:18:40 +01:00
Daan De Meyer
e81dc81a5c test-rm-rf: Migrate to new assertion macros 2025-11-12 14:24:14 +01:00
Daan De Meyer
13027e040a test-bus-chat: Migrate to TEST() and new assertion macros
- Also contains various other small cleanups
2025-11-12 14:24:14 +01:00
Daan De Meyer
e59ed77e13 test-bus-watch-bind: Migrate to new assertion macros 2025-11-12 14:24:14 +01:00
Daan De Meyer
0fd7280fbc test-bus-server: Migrate to new assertion macros 2025-11-12 14:24:14 +01:00
Daan De Meyer
4fd7bec2c9 test-bus-peersockaddr: Migrate to new assertion macros 2025-11-12 14:24:12 +01:00
Daan De Meyer
491706368b test-bus-objects: Migrate to new assertion macros 2025-11-12 14:20:24 +01:00
Daan De Meyer
6b136bcd02 test-event: Migrate to new assertion macros 2025-11-12 14:20:24 +01:00