Commit Graph
83809 Commits
Author SHA1 Message Date
Yu Watanabe d88ecd2bca libacl → turn into dlopen() dependency (#39087) 2025-09-24 18:25:20 +09:00
Yu Watanabe a359d92547 measure: strip tpm 1.x remnants and make GetActivePcrBanks() work (#39089)
Let's never bother with old TPM 1.x structures, they are not mentioned
in the TCG for TPM2 spec at all. However, the spec does say we should
check the Size field of the relevant structs, before accessing them,
hence do that.

Use that to determine the version of the protocol, before accessing
GetActiveBanks().

Alternative to: #39034
Fixes: #38932
Follow-up to: 6eab4cd44c
2025-09-24 18:14:09 +09:00
Yu Watanabe 01598d644f udev-builtin-net_id: Add DeviceTree-based names for WLAN devices (#39060)
Add support for generating names like wldN based on DeviceTree aliases.

DeviceTree alias names follow de facto conventions. As of writing, there
are so far two ways WLAN devices are represented in DeviceTree aliases
in upstream Linux DTS files:

- Firstly, as wifi0, used for example in t600x-j314-j316.dtsi
- Secondly, as ethernet0 or ethernet1, used for example in
sun8i-q8-common.dtsi, with a comment saying the reason is to "Make
u-boot set mac-address for wifi without an eeprom"

So we need to handle both while generating names. Refactor most of the
logic in names_devicetree() into a helper
names_devicetree_alias_prefix() that takes an alias_prefix instead of
hardcoding "ethernet", and, in the new names_devicetree():

- For prefix "en", use alias_prefix "ethernet"
- For prefix "wl", try alias_prefix "wifi" first, and if that was not
found, fall back to alias_prefix "ethernet"

Since this is a naming scheme change, also gate this behind
NAMING_DEVICETREE_ALIASES_WLAN and NAMING_V259, and document this
change.
2025-09-24 18:10:27 +09: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 31a66a1126 cleanup: add cleanup func macro that renames the function
This is useful when having to add a "sym_" prefix to functions
2025-09-24 09:41:21 +02:00
Lennart Poettering b388fa20c7 boot: check protocol version before assuming GetActiveBanks() exists
Alternative to: #39034
Fixes: #38932
Follow-up to: 6eab4cd44c
2025-09-24 08:57:11 +02:00
Lennart Poettering 496489c2a7 measure: strip tpm 1.x remnants
Let's never bother with old TPM 1.x structures, they are not mentioned
in the TCG for TPM2 spec at all. However, the spec does say we should
check the Size field of the relevant structs, before accessing them,
hence do that.
2025-09-24 08:49:23 +02:00
Luca Boccassi 696b1263dc fs-util: prefer glibc's fchmodat() if possible
Since v2.39 glibc's fchmodat() will call into the kernel's fchmodat2()
if flags are passed:

https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=65341f7bbea824d2ff9d37db15d8be162df42bd3;hp=c52c2c32db15aba8bbe1a0b4d3235f97d9c1a525

On older versions, if the flag is anything other than AT_SYMLINK_NOFOLLOW,
it returns EINVAL, so we can detect it and call the kernel syscall directly
ourselves.

Using the glibc wrappers when possible is prefereable so that programs
like fakeroot can intercept its calls and redirect them.

Follow-up for adecfb3bc0
2025-09-24 08:48:42 +02:00
Lennart Poettering 264608e8c3 docs: add a governance document
Since there have been disagreements on certain aspects of the technical
direction, let's clear things up, and introduce a governance document,
taking inspiration from:

https://github.com/uapi-group/uapi-group.github.io/blob/main/content/_index.md#governance
2025-09-24 08:48:17 +02:00
Luca Boccassi 2183d881b9 mkosi: update debian commit reference to 49dd9371a0c0dd08c7847c5885722eab88ac279f
* 49dd9371a0 d/rules: Ubuntu moved vmlinux.h too
* c81ce364eb Install new files for upstream build
* 35abaf33bc Override more Lintian warnings about appstream
* a3d3690c45 Override Lintian warning for appstream-metadata-missing-modalias-provide
* 1bcda1fd90 Override Lintian warning for binaries-have-file-conflict
* c597c00ffc Drop versioned conflicts added for bullseye upgrades
* 9cd845af25 Override lintian warnings for conflicts-with-version
* 359da95d09 Override Lintian warning for spare-manual-page
* 3ef8c31cb2 Override Lintian warning for groff-message
* dbe51582a9 Update changelog for 258-1 release
* ffd971a27d autopkgtest: ensure /usr/sbin is in the PATH for unit-tests job
* f086b8e881 autopkgtest: enable debug logs for unit-tests job
* 02142b9eae autopkgest: install dosfstools for test-loop-block
* 0319d890bd salsa-ci: enable ppc64el builds
* 645b1fa318 autopkgtest: use -20 instead of -22 for zstd compression
* b8dc9b0ce7 salsa-ci: switch to recommended entry point yml
* 152a2b3140 autopkgtest: set default_device_timeout_sec=240
* 6d46436878 autopkgtest: manually compress logs on failure
* c6c70bbb0c Update changelog for 258~rc4-1 release
* 2695112df7 Update changelog for 258~rc3-1 release
* 2c293cb2be systemd-boot: update version for rm_conffile
2025-09-24 00:38:40 +01:00
dramforever 20693ffcd8 udev-builtin-net_id: Add DeviceTree-based names for WLAN devices
Add support for generating names like wldN based on DeviceTree aliases.

DeviceTree alias names follow de facto conventions. As of writing, there
are so far two ways WLAN devices are represented in DeviceTree aliases
in upstream Linux DTS files:

- Firstly, as wifi0, used for example in t600x-j314-j316.dtsi
- Secondly, as ethernet0 or ethernet1, used for example in
  sun8i-q8-common.dtsi, with a comment saying the reason is to "Make
  u-boot set mac-address for wifi without an eeprom"

Therefore for prefix "wl", try alias_prefix "wifi" first, and if that
was not found, fall back to alias_prefix "ethernet"

Since this is a naming scheme change, also gate this behind
NAMING_DEVICETREE_ALIASES_WLAN and NAMING_V259, and document this
change.
2025-09-24 03:13:32 +08:00
dramforever d096f80b27 udev-builtin-net_id: Refactor names_devicetree() to avoid hardcoding
Refactor most of the logic in names_devicetree() into a helper
names_devicetree_alias_prefix() that takes an alias_prefix instead of
hardcoding "ethernet".

The return value names_devicetree_alias_prefix() will be used in further
commits to allow for alias_prefix fallback.
2025-09-24 03:13:26 +08:00
Yu Watanabe e2c5e9c011 test: use relative paths to executables
This also makes shebang always use env command, and drops unnecessary
'bash -c' or 'sh -c' when a signle command is invoked in the shell,
like sleep or echo.
2025-09-23 15:48:53 +01:00
Lennart Poettering daf99b00b5 udev,login: update ACL on static device nodes (#39071)
Fixes regression caused by #36444.
Fixes #39043.
2025-09-23 14:27:36 +02:00
Yu Watanabe 2c762d90cf login: update ACL on static device nodes again
In the commit c960ca2be1, the logic of
updating ACL on device node was moved from logind to udevd, but at that
time, mistakenly removed the logic for static nodes.

Fixes a regression caused by c960ca2be1 (v258).
Fixes #39043.
2025-09-23 19:57:25 +09:00
Yu Watanabe 41c4a69653 udev: move devnode_acl() back to libshared
This effectively reverts 1abb592f2f.
No functional change, preparation for the next commit.
2025-09-23 19:53:39 +09:00
Igor Opaniuk 64376936c7 boot: add support for overriding key enrollement timeout
Currently, a 15-second timeout is hardcoded for the key enrollment
process while waiting for user confirmation. Make this value configurable
to allow the option of disabling user input, such as during automatic key
provisioning at the factory.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
2025-09-23 12:13:10 +02:00
Joshua Krusell e216876fc6 Fix sd_bus_can_send signature in manpage 2025-09-23 11:04:42 +01:00
Lennart Poettering 4d74637310 repart: add a very basic varlink interface (#39072)
This is split out of https://github.com/systemd/systemd/pull/38764.

It adds a very basic Varlink API to repart. Not the actual
repartitioning APIs, but simply a call to get a list of candidate
devices.

A very basic test case is added too.

Other commits from #38764 add the repartitioning API, but let's do that
in a separate PR.
2025-09-23 10:46:50 +02:00
Lennart Poettering 347a3c925c test: add simple testcase for io.systemd.Repart.ListCandidateDevices 2025-09-23 09:25:11 +02:00
Lennart Poettering ba793df4b9 blockdev-list,repart: optionally hide zero-size block devices
Block devices with removable media (e.g. SD card readers) indicate a
missing medium with a zero size. Optionally ignore such block devices
that carry no medium currently.
2025-09-23 09:25:11 +02:00
Lennart Poettering ed90a0cdc9 blockdev-list,repart: optionally, filter list of candidate block device and remove OS root disk 2025-09-23 09:23:55 +02:00
Lennart Poettering 19f2baccce repart: add basic Varlink support, for now only with a ListCandidateDevices() call 2025-09-23 09:22:04 +02:00
Lennart Poettering e863e2dbb5 blockdev-list: also pick up block device size 2025-09-23 09:18:21 +02:00
Lennart Poettering 9f6b2745ea blockdev-list: optionally return finds as list instead of writing it to stdout 2025-09-23 09:13:13 +02:00
Lennart Poettering cb06a80482 sd-device: add device_get_sysattr_u64() helper 2025-09-23 09:13:13 +02:00
Luca Boccassi 4f21c3d9b7 Two follow-ups for dlopen()-ification (#39078) 2025-09-23 00:13:13 +01:00
Mike Yuan 278953167d core/systemd.pc: do not add new non-underscored vars
Follow-up for 346b7b6b49

The old style was deprecated in
4908de44b0.
2025-09-23 03:46:55 +09:00
Mike Yuan 1fbe44d013 pam-util,libaudit-util: strip "lib" prefix from dlopen "feature" field
As per our usual coding style.
2025-09-22 20:08:45 +02:00
Mike Yuan f497a3f1c3 pam-util: fix build without PAM
Follow-up for 882c9ce040
Prompted by #39077

Note that HAVE_PAM ifdeffery in pam-util.c is removed,
since its build as a whole is conditioned out if
!HAVE_PAM in shared/meson.build.
2025-09-22 20:08:44 +02:00
Yu Watanabe 6c3c7a8bb7 journal: fix two recent regressions in config handling (#39069)
Fixes #39046.
Fixes #39057.
2025-09-23 02:43:03 +09:00
Antonio Alvarez Feijoo f784a63cfa libaudit-util: fix build with audit disabled
```
In file included from ../src/test/test-dlopen-so.c:21:
../src/test/test-dlopen-so.c: In function ‘run’:
../src/test/test-dlopen-so.c:53:23: error: implicit declaration of function ‘dlopen_libaudit’; did you mean ‘dlopen_libfido2’? [-Werror=implicit-function-declaration]
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |                       ^~~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-dlopen-so.c:53:9: note: in expansion of macro ‘ASSERT_DLOPEN’
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |         ^~~~~~~~~~~~~
../src/test/test-dlopen-so.c:53:23: warning: nested extern declaration of ‘dlopen_libaudit’ [-Wnested-externs]
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |                       ^~~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-dlopen-so.c:53:9: note: in expansion of macro ‘ASSERT_DLOPEN’
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |         ^~~~~~~~~~~~~

```

Follow-up for 4d8c5c657a
2025-09-22 18:17:52 +01:00
Yu Watanabe b5fdfedf72 journal: make JournalConfig.set_audit as enum
In systemd <= 257, each set_audit tristate value had special meaning,
- true: enable the kernel audit subsystem,
- false: disable the kernel audit subsystem,
- negative: keep the current kernel audit subsystem state.

And the default is true, rather than negative. So, users sometimes
explicitly pass an empty string to Audit= setting to keep the state.

But since f48cf2a96d (v258), the negative
value is mistakenly used as 'really unspecified' even if an empty string
is explicitly specified.

This makes negative values handled as unspecified as usual, and assign a new
positive value AUDIT_KEEP for when an empty string is explicitly specified.
Also, make the Audit= setting accept "keep" setting, and suggest to use "keep"
rather than an empty string.

Fixes a regression caused by f48cf2a96d (v258).
Fixes #39057.
2025-09-22 23:07:06 +09:00
Yu Watanabe adacdfd9d6 journal: add missing initialization
Otherwise, SplitMode= in journald.conf is always ignored.

Fixes a regression caused by f48cf2a96d (v258).
Fixes #39046.
2025-09-22 23:00:59 +09:00
Markus Boehme 346b7b6b49 pkgconf: expose variables for system-alloc-{uid,gid}-min
Expose variables for system-alloc-uid-min and system-alloc-gid-min
similar to the UID/GID ranges already exposed for the respective
maximums, and other UID/GID ranges.
2025-09-22 12:02:28 +01:00
Aleksandr Mezin c3d5f5f165 nspawn: don't try to connect to D-Bus when it's not necessary (#39045)
`runtime_bus` is only used if `!arg_keep_unit`.

`system_bus` is additionally used if `arg_register`.

So for `!arg_register && arg_keep_unit`, none of them should be
necessary, and nspawn should be able to work without any D-Bus
connections.

Fixes https://github.com/systemd/systemd/issues/39044

Follow-up for f2f26f1527
2025-09-22 11:59:38 +01:00
雪叶 c4d708c3aa zsh-completion: add completion for freeze, thaw, condstop 2025-09-22 11:55:29 +01:00
Christian Hesse 9f8c4bc65a man/systemd-notify: add a note on return value
The options `--booted` is compared with the command `systemctl
is-system-running`, but the return values have differnt meanings and it
is not a drop-in.
2025-09-22 08:47:57 +02:00
Lennart Poettering 3d97db8f3c ptyfwd: reset tty when exiting
Let's do a "soft" reset of the TTY when a ptyfwd session ends. This is a
good idea, in order to reset changes to the scrolling window that code
inside the session might have made. A "soft" reset will undo this.

While we are at it, make sure to output the ansi sequences for this
*after* terminating any half-written line, as that is still somewhat
contents of the session, even if it's augmented.
2025-09-22 14:39:05 +09:00
Lennart Poettering e6a05af50b glyph-util: add missing ascii represenations of some emojis 2025-09-22 14:38:43 +09:00
Lennart Poettering 341bccdf1e dissect-image: simplification 2025-09-22 14:38:31 +09:00
Yu Watanabe 5c7be92494 Follow-ups for recent changes to creds (#39040) 2025-09-22 04:54:57 +09:00
Yu Watanabe 43cea09f95 machine: fix crash on update from older than v258
UID entry in the machine state file is introduced in v258,
hence when a host is upgraded to v258, the field does not exist in the
file, thus the variable 'uid' is NULL.

Follow-up for 276d200186.
Fixes #39061.
2025-09-22 04:53:57 +09:00
Mike Yuan 1419e8d324 core/exec-credential: don't enable graceful for load_credential()
Follow-up for 4be269563d

This contradicts the logic described in commit msg.
2025-09-21 17:16:52 +02:00
Mike Yuan f4fc2c3fc9 core/exec-credential: log about errno 2025-09-21 17:16:52 +02:00
Mike Yuan edb9a2870f creds: uniformly use varlink error table
Follow-up for ffd4b38096
2025-09-21 17:16:51 +02:00
anthisfan 9b89aee4af sd-device: use RET_GATHER() in device_tag_index() (#39053)
Replace manual error collection with RET_GATHER() macro.
2025-09-21 21:39:35 +09:00
Lennart Poettering 49e5c6462e meson: fix type in comment
As per https://github.com/systemd/systemd/pull/38999#discussion_r2363704203
2025-09-20 08:41:58 +02:00
Lennart Poettering 882c9ce040 pam: make libpam a dlopen() based dependency 2025-09-20 08:41:20 +02:00