1
0
mirror of https://github.com/systemd/systemd synced 2025-10-06 00:13:24 +02:00

83979 Commits

Author SHA1 Message Date
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
Mike Yuan
4f8c1de213 core/manager: honor show_status_overridden in manager_watch_jobs_next_time()
Prompted by #39029
2025-09-20 00:01:54 +02:00
Yu Watanabe
e66b233e83 run: include sys/stat.h again
This partially reverts 9adb4685df.

For the case that sys/stat.h is not included indirectly by other headers.
Fixes the following error:
```
../src/run/run.c: In function 'fchown_to_capsule':
../src/run/run.c:2128:21: error: storage size of 'st' isn't known
 2128 |         struct stat st;
      |                     ^~
```
2025-09-19 22:56:49 +02:00
Yu Watanabe
4bbd7ece53 libaudit-util: fix typo
Follow-up for 4d8c5c657a.
2025-09-20 05:14:25 +09:00
Yu Watanabe
99e04eacbd Various smaller tweaks to bootctl (#38996) 2025-09-20 04:28:00 +09:00
Mike Yuan
d25c8ee7f9 core: console status fixes (#39029) 2025-09-19 20:30:11 +02:00
Lennart Poettering
de5d773ddf small refactorings of the machine-credential code (#38982)
This is ultimately preparation for #38764, but makes a lot of sense on
its own.
2025-09-19 18:28:39 +02:00
Lennart Poettering
a86a366eb0 bootctl: split out auto-enroll cert load code into function of its own 2025-09-20 00:47:46 +09:00
Lennart Poettering
407139ae92 bootctl: output a more precise log message when updating existing EFI vars 2025-09-20 00:47:46 +09:00
Lennart Poettering
7dd55c83b8 bootctl: don't update $ESP/EFI/BOOTX64.EFI twice
We update BOOTX64.EFI explicitly once (because we know that it's the
main entry point of UEFI) and then a second time when we update
everything in $ESP/EFI/*.EFI. That's redundant and pretty ugly/confusing
in the log output. Hence exclude the file we already updated explicitly
from the 2nd run.
2025-09-20 00:47:46 +09:00
Lennart Poettering
b6f4f85c39 bootctl: downgrade messages about foreign EFI files
Given that we iterate through $ESP/EFI/BOOT/*.EFI these days this is a
pretty common case, hence it's not really noteworthy, hence downgrade
these log messages from LOG_NOTICE to LOG_INFO.
2025-09-20 00:47:46 +09:00
Lennart Poettering
c95d72913a bootctl: split out varlink setup into a helper call of its own 2025-09-20 00:47:46 +09:00
Lennart Poettering
83d0b6597c bootctl: normalize some enum definitions 2025-09-20 00:47:46 +09:00
Lennart Poettering
f757022294 bootctl: use RET_GATHER() all over the place 2025-09-20 00:47:46 +09:00
Lennart Poettering
5c396a0110 bootctl: switch a few getenv() calls to secure_getenv()
Following the rule that we should always prefer the secure flavour over
the regular one unless there's a clear reason for the regular one, let's
switch this over. Better safe than sorry.
2025-09-20 00:47:46 +09:00
Lennart Poettering
6aaff2d532 repart: some smaller tweaks (#38995) 2025-09-19 17:43:52 +02:00
Lennart Poettering
597eed0aa8 dlopen() libaudit (#38998)
Split out of #38861
2025-09-19 17:43:33 +02:00
Lennart Poettering
9ecc969855 core: fix status output suppression
This fixes two things: first of all it ensures we take the override
status output field properly into account, instead of going directly to
the regular one.

Moreover, it ensures that we bypass auto for both notice + emergency,
since both have the same "impact", and, don't limit this for notice
only.
2025-09-19 17:32:48 +02:00
Lennart Poettering
8e9b722b4a unit: line-break overly long parameter list + add assert() 2025-09-19 17:32:48 +02:00
Lennart Poettering
84ba8721de job: shorten code 2025-09-19 17:32:48 +02:00
Lennart Poettering
9b72c358d4 machine-credential: add low-level machine_credential_add() as common back-end for machine_credential_set() + machine_credential_load() 2025-09-19 17:08:03 +02:00
Lennart Poettering
9dd33dce76 machine-credential: replace machine_credentials_contains() by machine_credential_find() 2025-09-19 17:07:50 +02:00
Lennart Poettering
0dc73c5253 machine-credential: include the high-level not the low-level string-util.h 2025-09-19 16:48:41 +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
222dcf3bc2 repart: add some line breaks 2025-09-19 16:36:34 +02:00
Lennart Poettering
bc54521855 repart: never use a grain size below sector size 2025-09-19 16:36:34 +02:00
Lennart Poettering
6db162492b openssl-util: make openssl_load_private_key()'s ret_ui parameter optional 2025-09-19 16:36:34 +02:00
Lennart Poettering
722d3f712a audit: shortcut some audit syscalls if we are compiled without audit support anyway 2025-09-19 16:30:13 +02:00
Lennart Poettering
4d8c5c657a build: make libaudit dep dlopen() 2025-09-19 16:30:13 +02:00
Daan De Meyer
93ed79c0b0 core: Expose oom kills and managed oom kills as properties (#38906)
It can be useful for users to know this information so let's expose it
as properties so it can be queried.
2025-09-19 16:19:19 +02:00
Daan De Meyer
8796164189 tree-wide: Remove unused includes (#39023) 2025-09-19 16:07:04 +02:00