]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 months agonspawn: enable usrquota support on /tmp/ and /dev/shm/ 36036/head
Lennart Poettering [Tue, 14 Jan 2025 15:51:27 +0000 (16:51 +0100)] 
nspawn: enable usrquota support on /tmp/ and /dev/shm/

9 months agounits: enable usrquota support on /tmp/
Lennart Poettering [Tue, 14 Jan 2025 15:52:04 +0000 (16:52 +0100)] 
units: enable usrquota support on /tmp/

9 months agopid1: enable usrquota support on /dev/shm
Lennart Poettering [Tue, 14 Jan 2025 15:51:49 +0000 (16:51 +0100)] 
pid1: enable usrquota support on /dev/shm

9 months agoman: replace "-" with "none" in cryptsetup commands and crypttab
nl6720 [Sat, 18 Jan 2025 15:46:03 +0000 (17:46 +0200)] 
man: replace "-" with "none" in cryptsetup commands and crypttab

`none` is more explicit and harder to overlook than `-` which in certain
contexts could be misunderstood to mean standard input.

9 months agoTODO: fix typo
Yu Watanabe [Sat, 18 Jan 2025 19:25:19 +0000 (04:25 +0900)] 
TODO: fix typo

Follow-up for fb8d46cffeac5a9607f94022978ae6ce95e6b8dc.

9 months agoprocess-util: fix typo
Yu Watanabe [Sat, 18 Jan 2025 19:24:05 +0000 (04:24 +0900)] 
process-util: fix typo

Also rebreak comment.

Follow-up for 03b89cf213d5d1a60601ff158a6366718461fa4b.

9 months agologin: fix typo
Yu Watanabe [Sat, 18 Jan 2025 19:22:11 +0000 (04:22 +0900)] 
login: fix typo

Follow-up for a6ad410ffa5d63647ea9048932b7b459cbe55662.

9 months agopid1: when a password is requested during PAMName= processing, query it via the ask...
Lennart Poettering [Tue, 14 Jan 2025 23:24:29 +0000 (00:24 +0100)] 
pid1: when a password is requested during PAMName= processing, query it via the ask-password logic

9 months agoudev: add --verbose option for 'udevadm test' and add more verbose logs (#36021)
Yu Watanabe [Fri, 17 Jan 2025 21:12:31 +0000 (06:12 +0900)] 
udev: add --verbose option for 'udevadm test' and add more verbose logs (#36021)

split out of #35968.

9 months agotree-wide: switch various uses of mkdtemp() over to mkdtemp_malloc() (#36057)
Luca Boccassi [Fri, 17 Jan 2025 19:49:49 +0000 (19:49 +0000)] 
tree-wide: switch various uses of mkdtemp() over to mkdtemp_malloc() (#36057)

9 months agoescape: make 'bad' parameter optional
Lennart Poettering [Mon, 18 Nov 2024 22:10:38 +0000 (23:10 +0100)] 
escape: make 'bad' parameter optional

Treat a NULL bad parameter just like an empty one: do not escape any
additional characters except for the CC chars.

9 months agomeson: bump C std to gnu17
Mike Yuan [Thu, 16 Jan 2025 17:50:54 +0000 (18:50 +0100)] 
meson: bump C std to gnu17

GCC 8.4 (our baseline) defaults to gnu17 already.

9 months agoudev-rules: add trace logs for GOTO and parent conditions 36021/head
Yu Watanabe [Sun, 12 Jan 2025 20:18:25 +0000 (05:18 +0900)] 
udev-rules: add trace logs for GOTO and parent conditions

9 months agoudev-rules: update log messages
Yu Watanabe [Wed, 15 Jan 2025 14:47:05 +0000 (23:47 +0900)] 
udev-rules: update log messages

This also adds trace logs about token result, and skipping assignment
caused by final value already assigned.

9 months agoudev-rules: ignore whole command result if it is too long and does not contain newline
Yu Watanabe [Wed, 15 Jan 2025 14:43:37 +0000 (23:43 +0900)] 
udev-rules: ignore whole command result if it is too long and does not contain newline

9 months agoudev-rules: introduce udev_replace_chars_and_log()
Yu Watanabe [Wed, 15 Jan 2025 13:09:05 +0000 (22:09 +0900)] 
udev-rules: introduce udev_replace_chars_and_log()

And logs about replacement only when trace logging is enabled.

9 months agoudev-rules: add more trace logs for string match
Yu Watanabe [Sun, 12 Jan 2025 19:03:11 +0000 (04:03 +0900)] 
udev-rules: add more trace logs for string match

9 months agoudev-rules: logs result of format substitution
Yu Watanabe [Sat, 11 Jan 2025 15:12:52 +0000 (00:12 +0900)] 
udev-rules: logs result of format substitution

This also drops redundant token string in log message on truncation.

No functional change, but should improve debuggability.

9 months agoudev-rules: show original token string in log_event_error() and friends
Yu Watanabe [Sun, 12 Jan 2025 20:12:40 +0000 (05:12 +0900)] 
udev-rules: show original token string in log_event_error() and friends

This also makes
- make many loggers refactored,
- log_event_error() and friends UdevEvent object,
- introduces log_event_trace().

No functional change, just refactoring and preparation for later
commits.

9 months agoudevadm-test: introduce -v/--verbose option to show verbose log messages
Yu Watanabe [Sun, 12 Jan 2025 20:09:15 +0000 (05:09 +0900)] 
udevadm-test: introduce -v/--verbose option to show verbose log messages

Currently this does not show any extra log messages. In later commits,
more verbose log messages will be added.

9 months agohexdump: if size is SIZE_MAX, use strlen()
Lennart Poettering [Mon, 18 Nov 2024 11:32:24 +0000 (12:32 +0100)] 
hexdump: if size is SIZE_MAX, use strlen()

Similar how we do this as various places: if SIZE_MAX is specified as
size determine the size automatically via strlen().

9 months agonspawn: assorted coding style fixes 36057/head
Lennart Poettering [Fri, 17 Jan 2025 08:50:01 +0000 (09:50 +0100)] 
nspawn: assorted coding style fixes

9 months agotree-wide: switch various uses of mkdtemp() over to mkdtemp_malloc()
Lennart Poettering [Fri, 17 Jan 2025 08:49:17 +0000 (09:49 +0100)] 
tree-wide: switch various uses of mkdtemp() over to mkdtemp_malloc()

9 months agomkosi: update fedora commit reference
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jan 2025 21:26:30 +0000 (22:26 +0100)] 
mkosi: update fedora commit reference

c7fecc18eb Skip test_sysusers_defined on upstream builds
f257050ddd Add a .editorconfig file
aa5546e9ed Add a few mkosi artifact directories to .gitignore
01e5bc1c93 Set SBAT in sd-boot when building on OBS
a7eec4d33d Run upstream integration test suite with Fedora CI

9 months agoSeveral fixlets for GCC warnings (#36051)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jan 2025 21:41:31 +0000 (22:41 +0100)] 
Several fixlets for GCC warnings (#36051)

Replaces #36043 and #36039.

9 months agoTwo readme tweaks (#36053)
Lennart Poettering [Thu, 16 Jan 2025 21:40:07 +0000 (22:40 +0100)] 
Two readme tweaks (#36053)

9 months agoREADME: add sgx to list of required groups 36053/head
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jan 2025 20:18:11 +0000 (21:18 +0100)] 
README: add sgx to list of required groups

Follow-up for c9c4899f4444d9586e541b5e72597a37f949433a.

9 months agodocs/HACKING: use 'run0' to indicate which commands require privileges
Zbigniew Jędrzejewski-Szmek [Mon, 9 Dec 2024 19:24:34 +0000 (20:24 +0100)] 
docs/HACKING: use 'run0' to indicate which commands require privileges

9 months agoupdate TODO
Lennart Poettering [Thu, 16 Jan 2025 20:58:30 +0000 (21:58 +0100)] 
update TODO

9 months agoREADME: update requirements
Yu Watanabe [Thu, 16 Jan 2025 20:36:11 +0000 (05:36 +0900)] 
README: update requirements

9 months agoudev: set clock group for PTP and RTC devices
Miroslav Lichvar [Thu, 16 Jan 2025 14:34:47 +0000 (15:34 +0100)] 
udev: set clock group for PTP and RTC devices

Add a new group for clock devices to enable applications like linuxptp
to open clocks without root privileges.

9 months agofundamental-macro: conditionalize several gcc warning pragmas 36051/head
Yu Watanabe [Thu, 16 Jan 2025 19:27:36 +0000 (04:27 +0900)] 
fundamental-macro: conditionalize several gcc warning pragmas

This fixes the following error:

In file included from ../src/basic/macro.h:13,
                 from ../src/basic/env-util.h:9,
                 from ../src/nss-systemd/nss-systemd.c:7:
../src/fundamental/macro-fundamental.h:61:9: error: option ‘-Wzero-as-null-pointer-constant’ is valid for C++/ObjC++ but not for C [-Werror=pragmas]
   61 |         _Pragma("GCC diagnostic ignored \"-Wzero-as-null-pointer-constant\"")
      |         ^~~~~~~
../src/nss-systemd/nss-systemd.c:106:1: note: in expansion of macro ‘DISABLE_WARNING_ZERO_AS_NULL_POINTER_CONSTANT’
  106 | DISABLE_WARNING_ZERO_AS_NULL_POINTER_CONSTANT;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

9 months agonss-systemd: work around -Werror=zero-as-null-pointer-constant issue with PTHREAD_MUT...
Lennart Poettering [Thu, 16 Jan 2025 12:46:18 +0000 (13:46 +0100)] 
nss-systemd: work around -Werror=zero-as-null-pointer-constant issue with PTHREAD_MUTEX_INITIALIZER

This fixes builds on Fedora:

../src/nss-systemd/nss-systemd.c:105:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
  105 |         .mutex = PTHREAD_MUTEX_INITIALIZER,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/nss-systemd/nss-systemd.c:105:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
../src/nss-systemd/nss-systemd.c:109:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
  109 |         .mutex = PTHREAD_MUTEX_INITIALIZER,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/nss-systemd/nss-systemd.c:109:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
../src/nss-systemd/nss-systemd.c:113:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
  113 |         .mutex = PTHREAD_MUTEX_INITIALIZER,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/nss-systemd/nss-systemd.c:113:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
../src/nss-systemd/nss-systemd.c:117:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
  117 |         .mutex = PTHREAD_MUTEX_INITIALIZER,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/nss-systemd/nss-systemd.c:117:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
cc1: all warnings being treated as errors

9 months agofundamental: unify gcc warning pragmas at one place
Lennart Poettering [Thu, 16 Jan 2025 15:01:56 +0000 (16:01 +0100)] 
fundamental: unify gcc warning pragmas at one place

This also drops HAVE_WSTRINGOP_TRUNCATION as the corresponding option
was introduced in GCC 8, and our baseline is GCC 8.4.

9 months agotest: add link to Ubuntu autopkgtest status page in README
Luca Boccassi [Thu, 16 Jan 2025 13:47:14 +0000 (13:47 +0000)] 
test: add link to Ubuntu autopkgtest status page in README

Known issues will be listed there by the team managing the infra

9 months agoprocess-util: port pid_from_same_root_fs() to pidref + more (#35975)
Lennart Poettering [Thu, 16 Jan 2025 12:48:48 +0000 (13:48 +0100)] 
process-util: port pid_from_same_root_fs() to pidref + more (#35975)

Let's continue our move to PidRef.

9 months agoprocess-util: slightly update comment in freeze() 35975/head
Lennart Poettering [Wed, 15 Jan 2025 16:24:14 +0000 (17:24 +0100)] 
process-util: slightly update comment in freeze()

9 months agoprocess-util: port pid_from_same_root_fs() to pidref, and port three places over...
Lennart Poettering [Mon, 13 Jan 2025 10:09:49 +0000 (11:09 +0100)] 
process-util: port pid_from_same_root_fs() to pidref, and port three places over to it

9 months agotest-process-util: don't run rest of test suite in forked off child
Lennart Poettering [Mon, 13 Jan 2025 10:10:09 +0000 (11:10 +0100)] 
test-process-util: don't run rest of test suite in forked off child

We left the test suite running in the child after forking off a
temporary child for testing. That's bad. fix it.

9 months agoprocess-util: introduce new FORK_FREEZE flag for safe_fork()
Lennart Poettering [Mon, 13 Jan 2025 10:04:19 +0000 (11:04 +0100)] 
process-util: introduce new FORK_FREEZE flag for safe_fork()

Often we want to fork off a process that just hangs until we kill it,
let's add a simple flag to create one of this type, and use it at
various places.

9 months agopidref: various shortcuts to pidref_equal()
Lennart Poettering [Mon, 13 Jan 2025 10:06:27 +0000 (11:06 +0100)] 
pidref: various shortcuts to pidref_equal()

This adds some shortcuts to pidref_equal(), so that we don't have to
query the pidfs id if there's no need.

9 months agotree-wide: drop support for kernels without pidfd_open() and pidfd_send_signal()...
Lennart Poettering [Thu, 16 Jan 2025 10:37:17 +0000 (11:37 +0100)] 
tree-wide: drop support for kernels without pidfd_open() and pidfd_send_signal() (#35971)

9 months agonamespace-util: don't reset UID/GIDs in namespace_enter() unless we enter a userns
Lennart Poettering [Wed, 15 Jan 2025 22:18:39 +0000 (23:18 +0100)] 
namespace-util: don't reset UID/GIDs in namespace_enter() unless we enter a userns

The reset of UID/GID only really makes sense if we enter a userns, hence
let#s restrict it to that.

9 months agoshared/bus-util: add missing `set.h` include
Jan Macku [Wed, 15 Jan 2025 14:06:46 +0000 (15:06 +0100)] 
shared/bus-util: add missing `set.h` include

```
In file included from ../src/shared/bus-get-properties.c:4:
../src/shared/bus-message-util.h:22:60: error: unknown type name ‘Set’
   22 | int bus_message_append_string_set(sd_bus_message *m, const Set *s);
      |                                                            ^~~
../src/shared/bus-get-properties.c: In function ‘bus_property_get_string_set’:
../src/shared/bus-get-properties.c:178:9: error: unknown type name ‘Set’
  178 |         Set **s = ASSERT_PTR(userdata);
      |         ^~~
```

follow-up to https://github.com/systemd/systemd/commit/91080bc9733b5b2478bfc0ed58f6a7ae5da7e639

9 months agoshell-completions: add systemctl sleep
Duncan Overbruck [Thu, 16 Jan 2025 02:51:52 +0000 (03:51 +0100)] 
shell-completions: add systemctl sleep

9 months agomeson: enable -Wzero-as-null-pointer-constant (#36028)
Lennart Poettering [Thu, 16 Jan 2025 06:48:21 +0000 (07:48 +0100)] 
meson: enable -Wzero-as-null-pointer-constant (#36028)

Support for C added in gcc 15:

https://github.com/gcc-mirror/gcc/commit/236c0829ee21a179c81b83f0d7f112ca23c47a4d

9 months agopid1: add GracefulOptions= setting to .mount units (#36023)
Lennart Poettering [Thu, 16 Jan 2025 06:47:08 +0000 (07:47 +0100)] 
pid1: add GracefulOptions= setting to .mount units (#36023)

This new setting can be used to specify mount options that shall only be
added to the mount option string if the kernel supports them.

This shall be used for adding "usrquota" to tmp.mount without breaking
compat, but is generally be useful.

9 months agomeson: enable -Wzero-as-null-pointer-constant 36028/head
Mike Yuan [Wed, 15 Jan 2025 17:41:51 +0000 (18:41 +0100)] 
meson: enable -Wzero-as-null-pointer-constant

Support for C added in gcc 15:
https://github.com/gcc-mirror/gcc/commit/236c0829ee21a179c81b83f0d7f112ca23c47a4d

9 months agotree-wide: remove unnecessary gcc >= 7 version check
Mike Yuan [Wed, 15 Jan 2025 18:16:06 +0000 (19:16 +0100)] 
tree-wide: remove unnecessary gcc >= 7 version check

Our baseline is gcc 8.4.

9 months agoRevert "OBS: build Fedora/Debian/Ubuntu x86_64 packages on PRs"
Luca Boccassi [Thu, 16 Jan 2025 00:42:23 +0000 (00:42 +0000)] 
Revert "OBS: build Fedora/Debian/Ubuntu x86_64 packages on PRs"

This does not work yet, as we configure multiple git sources,
and the workflow service gets confused. We need to update one
(the actual code repo) and leave the recipe repos intact, but
this is not supported right now.

This reverts commit 01f05f0087204914e489057baf12317815325956.

9 months agoOBS: build Fedora/Debian/Ubuntu x86_64 packages on PRs
Luca Boccassi [Wed, 15 Jan 2025 23:45:32 +0000 (23:45 +0000)] 
OBS: build Fedora/Debian/Ubuntu x86_64 packages on PRs

Start with a subset of what is built from main, can be expanded as
needed

9 months agolog: check isempty for object_field and extra_field
hanjinpeng [Tue, 14 Jan 2025 17:10:06 +0000 (01:10 +0800)] 
log: check isempty for object_field and extra_field

9 months agopty_open_peer() follow-up (#36027)
Lennart Poettering [Wed, 15 Jan 2025 20:05:59 +0000 (21:05 +0100)] 
pty_open_peer() follow-up (#36027)

9 months agopid1: add GracefulOptions= setting to .mount units 36023/head
Lennart Poettering [Tue, 14 Jan 2025 15:49:52 +0000 (16:49 +0100)] 
pid1: add GracefulOptions= setting to .mount units

This new setting can be used to specify mount options that shall only be
added to the mount option string if the kernel supports them.

This shall be used for adding "usrquota" to tmp.mount without breaking compat,
but is generally be useful.

9 months agopam-systemd: introduce "user-light" session type, and make "background-light" the...
Lennart Poettering [Wed, 15 Jan 2025 19:55:01 +0000 (20:55 +0100)] 
pam-systemd: introduce "user-light" session type, and make "background-light" the default for system users (#35987)

This implements one idea from #34988: default to "user-light" and
"background-light" for system users, so that the service manager is only
pulled in for sessions that likely need them, i.e. not cron jobs or ftp
logins.

This is a compat break to some degree, but I think a worthy one. I
updated the NEWS file to explain this.

9 months agorandom-util: fix compilation error
Yu Watanabe [Wed, 15 Jan 2025 16:29:04 +0000 (01:29 +0900)] 
random-util: fix compilation error

Fixes the following error:
```
../src/basic/random-util.c: In function "fallback_random_bytes":
../src/basic/random-util.c:45:26: error: initializer-string for array of "char" is too long [-Werror=unterminated-string-initialization]
   45 |                 .label = "systemd fallback random bytes v1",
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

9 months agouserdb: optionally parse numeric UIDs/GIDs where a username is expected
Lennart Poettering [Tue, 14 Jan 2025 17:28:27 +0000 (18:28 +0100)] 
userdb: optionally parse numeric UIDs/GIDs where a username is expected

Let's move this logic from userdbctl into generic code so that we can
use it elsewhere.

9 months agoanalyze: fix assignment of object_field
Yu Watanabe [Wed, 15 Jan 2025 15:13:19 +0000 (00:13 +0900)] 
analyze: fix assignment of object_field

Prompted by #36000.

9 months agocurl-util: use curl_getdate instead of implementing http spec
jane400 [Wed, 15 Jan 2025 00:24:20 +0000 (01:24 +0100)] 
curl-util: use curl_getdate instead of implementing http spec

Available since curl 7.1, which is less than the version required in
meson.build

https://curl.se/libcurl/c/curl_getdate.html

9 months agoterminal-util: drop unused open_terminal_in_namespace() 36027/head
Mike Yuan [Wed, 15 Jan 2025 16:34:11 +0000 (17:34 +0100)] 
terminal-util: drop unused open_terminal_in_namespace()

With our baseline including TIOCGPTPEER we now systematically
open pty peer through ioctl(), i.e. this sits unused
since 1d522f1a866f911980b5eaad87182bf58c58fa32. Kill it!

9 months agorun: with TIOCGPTPEER there's no longer need to acquire pty peer through IPC
Mike Yuan [Wed, 15 Jan 2025 16:27:25 +0000 (17:27 +0100)] 
run: with TIOCGPTPEER there's no longer need to acquire pty peer through IPC

9 months agorun: correct log level for pty_open_peer() error
Mike Yuan [Wed, 15 Jan 2025 16:21:54 +0000 (17:21 +0100)] 
run: correct log level for pty_open_peer() error

Everything around it logs loudly.

9 months agologind: improve log message we generate when a user logs in 35987/head
Lennart Poettering [Tue, 14 Jan 2025 11:10:49 +0000 (12:10 +0100)] 
logind: improve log message we generate when a user logs in

Mention the session type and class both in the human readable string and
in the structured log.

9 months agorun0: allow explicit control of service manager activation for run0 sessions
Lennart Poettering [Tue, 14 Jan 2025 10:50:52 +0000 (11:50 +0100)] 
run0: allow explicit control of service manager activation for run0 sessions

This adds a new --lightweight=yes/no switch which allows controlling
whether the invoked service will have the service manager around or not.

Moreover, this changes that if the target user is root it will now
support to the lightweight mode, i.e. run0 towards root will no longer
pull in the service manager (a real tty login via getty still will
though!).

My thinking here is that quickly raising privileges via run0 probably
shouldn't be considered a proper login but just something short lived,
temporary for a single command or similar.

9 months agorun: fire sd_notify("READY=1") when in service mode and the unit is properly started
Lennart Poettering [Tue, 14 Jan 2025 10:48:52 +0000 (11:48 +0100)] 
run: fire sd_notify("READY=1") when in service mode and the unit is properly started

Let's make sure systemd-run itself works nicely as a service that tells
the caller when it is ready.

Note that we don't fire the same message in scope mode, since in that
case want to leave sd_notify() handling to the invoked process.

9 months agologind: introduce "user-light" session class
Lennart Poettering [Fri, 10 Jan 2025 08:32:18 +0000 (09:32 +0100)] 
logind: introduce "user-light" session class

This new session class is to "user" what "background" is to
"background-light": it doesn't cause the per-user service manager to
start.

This new session class is now the default if no session class was
provided at session registration time and the following conditions hold:

1. The session is not graphical
2. The user is not a regular user (but not root)

Or in other words root and system users won't get a service manager
started automatically if they go through a PAM session as part of things
like cron or ftp. They will however still get one if they log in
graphically.

This changes behaviour a bit, but hopefully in OK was.

This also makes "background-light" for system users incl. root.

This addresses one of the ideas discussed in #34988.

9 months agologind: introduce macro for the last session class condition check
Lennart Poettering [Fri, 10 Jan 2025 08:39:05 +0000 (09:39 +0100)] 
logind: introduce macro for the last session class condition check

For all checks regarding the properties of sessoin classes we have
SESSION_CLASS_CAN_XYZ() style macros. Except for one. Convert that one
too.

9 months agopam-systemd: downgrade log message we handle gracefully to LOG_WARNING as per coding...
Lennart Poettering [Fri, 10 Jan 2025 10:34:58 +0000 (11:34 +0100)] 
pam-systemd: downgrade log message we handle gracefully to LOG_WARNING as per coding style

9 months agomkosi: disable multipathd by default
Yu Watanabe [Wed, 15 Jan 2025 11:34:30 +0000 (20:34 +0900)] 
mkosi: disable multipathd by default

Hopefully fixes #36008.

9 months agologind: register PAM sessions via Varlink instead of D-Bus (#35264)
Lennart Poettering [Wed, 15 Jan 2025 15:53:43 +0000 (16:53 +0100)] 
logind: register PAM sessions via Varlink instead of D-Bus (#35264)

This makes things a bit faster (because it cuts down a bit on
roundtrips) and prepares ground so that one day we can let logind run in
earlier boot already, making it a bit less special.

communication between logind and pid1 is still dbus only, hence there's
a lot of room for further improvement I guess.

9 months agoefivars: deal with uncommitted efi variables
wrvsrx [Sat, 7 Dec 2024 02:32:15 +0000 (10:32 +0800)] 
efivars: deal with uncommitted efi variables

Unfortunately kernel reports EOF if there's an inconsistency between efivarfs var list
and what's actually stored in firmware, c.f. #34304. A zero size env var is not allowed in
efi and hence the variable doesn't really exist in the backing store as long as it is zero
sized, and the kernel calls this "uncommitted". Hence we translate EOF back to ENOENT here,
as with kernel behavior before
https://github.com/torvalds/linux/commit/3fab70c165795431f00ddf9be8b84ddd07bd1f8f

If the kernel changes behaviour (to flush dentries on resume), we can drop
this at some point in the future. But note that the commit is 11
years old at this point so we'll need to deal with the current behaviour for
a long time.

Fix #34304.

9 months agomachine: introduce io.systemd.MachineImage.SetPoolLimit (#35953)
Lennart Poettering [Wed, 15 Jan 2025 15:52:24 +0000 (16:52 +0100)] 
machine: introduce io.systemd.MachineImage.SetPoolLimit (#35953)

This PR introduces io.systemd.MachineImage.SetPoolLimit method which is
alternative to DBus's SetPoolLimit.

This is last function for org.freedesktop.machine1 Dbus interface

9 months agonspawn: trivial scope reduction
Lennart Poettering [Wed, 15 Jan 2025 10:48:28 +0000 (11:48 +0100)] 
nspawn: trivial scope reduction

9 months agotools/fetch-distro: support the case where the sources are in a subdirectory
Antonio Alvarez Feijoo [Wed, 15 Jan 2025 11:01:22 +0000 (12:01 +0100)] 
tools/fetch-distro: support the case where the sources are in a subdirectory

If the GIT_SUBDIR environment variable is set, do not checkout the full sources
of the git repository, but perform a sparse checkout of the directory containing
the package. In this case, check only the commit history in this subdirectory.

9 months agoci: Stop archiving packages
Daan De Meyer [Wed, 15 Jan 2025 11:58:36 +0000 (12:58 +0100)] 
ci: Stop archiving packages

This takes up a lot of storage space and we're almost hitting the
limit so since nobody's actually using these and we just started
doing nightly builds in OBS, let's drop this and point people towards
OBS for nightly packages in the future.

9 months agoptyfwd: fix wrong userdata passed to PTY forwarding
Yu Watanabe [Wed, 15 Jan 2025 10:23:49 +0000 (19:23 +0900)] 
ptyfwd: fix wrong userdata passed to PTY forwarding

Fixes #35942.

9 months agostring-util: make strjoin() just a special case of strextend() (#36011)
Lennart Poettering [Wed, 15 Jan 2025 12:25:08 +0000 (13:25 +0100)] 
string-util: make strjoin() just a special case of strextend() (#36011)

This is split out of #36010, but makes a ton of sense on its own.

9 months agouser-record-show: use word 'show' not 'dump' for helper call
Lennart Poettering [Tue, 14 Jan 2025 14:48:00 +0000 (15:48 +0100)] 
user-record-show: use word 'show' not 'dump' for helper call

The key functions and the file itself use the word "to show" here, this
helper should really stick to that nomenclature.

9 months agomissing: add quotactl_fd() wrapper
Lennart Poettering [Fri, 10 Jan 2025 10:33:03 +0000 (11:33 +0100)] 
missing: add quotactl_fd() wrapper

9 months agobus-wait-for-jobs: fix table of service result codes (#35992)
Lennart Poettering [Wed, 15 Jan 2025 11:50:32 +0000 (12:50 +0100)] 
bus-wait-for-jobs: fix table of service result codes (#35992)

9 months agopam-systemd: talk to logind via varlink 35264/head
Lennart Poettering [Mon, 18 Nov 2024 10:25:20 +0000 (11:25 +0100)] 
pam-systemd: talk to logind via varlink

This makes sure we now use Varlink per default as transport for
allocating sessions.

This reduces the time it takes to do one run0 cycle by roughly ~10% on my
completely synthetic test setup (assuming the target user's service
manager is already started)

The D-Bus codepaths are kept in place for two reasons:
* To make upgrades easy
* If the user actually sets resource properties on the PAM session we
  fall back to the D-Bus codepaths, as we currently have no way to
  encode the scope properties in JSON, this is only supported for D-Bus
  serialization.

The latter should be revisited once it is possible to allocate a scope
unit from PID1 via varlink.

9 months agologind: add basic Varlink API
Lennart Poettering [Tue, 19 Nov 2024 21:21:47 +0000 (22:21 +0100)] 
logind: add basic Varlink API

For now this only covers CreateSession() and ReleaseSession(), i.e. the
two operations pam_systemd cares about.

9 months agomachine: tests for io.systemd.MachineImage.SetPoolLimit 35953/head
Ivan Kruglov [Thu, 9 Jan 2025 15:24:32 +0000 (16:24 +0100)] 
machine: tests for io.systemd.MachineImage.SetPoolLimit

9 months agomachine: introduce io.systemd.MachineImage.SetPoolLimit
Ivan Kruglov [Thu, 9 Jan 2025 15:02:19 +0000 (16:02 +0100)] 
machine: introduce io.systemd.MachineImage.SetPoolLimit

9 months agomachine: use image_set_pool_limit() in dbus
Ivan Kruglov [Fri, 10 Jan 2025 11:21:03 +0000 (12:21 +0100)] 
machine: use image_set_pool_limit() in dbus

9 months agoshared: image_set_pool_limit()
Ivan Kruglov [Fri, 10 Jan 2025 11:20:50 +0000 (12:20 +0100)] 
shared: image_set_pool_limit()

9 months agotest: Drop sandbox() from integration test wrapper (#36009)
Daan De Meyer [Wed, 15 Jan 2025 10:32:34 +0000 (11:32 +0100)] 
test: Drop sandbox() from integration test wrapper (#36009)

With the latest changes, this is not required anymore as mkosi sandbox
will set up the proper $PATH to make sure the executables from the build
directory are used.

9 months agostring-util: add a mechanism for strextend_with_separator() for specifying "ignore... 36011/head
Lennart Poettering [Wed, 15 Jan 2025 08:32:44 +0000 (09:32 +0100)] 
string-util: add a mechanism for strextend_with_separator() for specifying "ignore" arguments

in strv_new() we have STRV_IGNORE for skipping over an argument in the
argument list. Let's add the same to strextend_with_separator():

strextend_with_separator(&x, "foo", POINTER_MAX, "bar");

will result in "foobar" being appended to "x". (POINTER_MAX Which is
different from NULL, which terminates the argument list).

This is useful for ternary op situations.

(We should probably get rid of STRV_IGNORE and just use POINTER_MAX
everywhere directly, but that's for another time.)

9 months agostring-util: make strjoin() just a special case of strextend()
Lennart Poettering [Wed, 15 Jan 2025 08:31:35 +0000 (09:31 +0100)] 
string-util: make strjoin() just a special case of strextend()

The functions are very similar, let's make them the same. If the first
argument to strextend() is NULL instead of extending a string we'll
allocate a fresh one and return that.

9 months agoudev: several trivial fixlets (#36005)
Daan De Meyer [Wed, 15 Jan 2025 09:50:11 +0000 (10:50 +0100)] 
udev: several trivial fixlets (#36005)

split out of #35968.

9 months agomeson: add udev/hwdb build aliases
Luca Boccassi [Tue, 14 Jan 2025 23:22:04 +0000 (23:22 +0000)] 
meson: add udev/hwdb build aliases

Allows to do:

meson compile libudev udev hwdb
meson install --no-rebuild --tags libudev,udev,hwdb

9 months agoman: also fix documentation of start-limit-hit 35992/head
Lennart Poettering [Tue, 14 Jan 2025 13:04:52 +0000 (14:04 +0100)] 
man: also fix documentation of start-limit-hit

9 months agobus-wait-for-jobs: fix service result table
Lennart Poettering [Tue, 14 Jan 2025 12:56:58 +0000 (13:56 +0100)] 
bus-wait-for-jobs: fix service result table

We were missing one service result (oom-kill), and the ratelimit one is
called differently. Correct that so that we generate proper log messages
for these cases.

9 months agoterminal-util: drop support for pre-TIOCGPTPEER kernels
Lennart Poettering [Tue, 14 Jan 2025 11:05:05 +0000 (12:05 +0100)] 
terminal-util: drop support for pre-TIOCGPTPEER kernels

Our minimum baseline is now far beyond 4.13, hence let's drop these
fallback paths.

9 months agoupdate TODO
Lennart Poettering [Wed, 15 Jan 2025 09:37:11 +0000 (10:37 +0100)] 
update TODO

9 months agosysusers: emit audit events for user and group creation (#35957)
Zbigniew Jędrzejewski-Szmek [Wed, 15 Jan 2025 09:36:07 +0000 (10:36 +0100)] 
sysusers: emit audit events for user and group creation (#35957)

Background: Fedora/RHEL are switching to sysusers.d metadata for
creation of users and groups for system users defined by packages
(https://fedoraproject.org/wiki/Changes/RPMSuportForSystemdSysusers).
Packages carry sysusers files. During package installation, rpm calls an
program to execute on this config. This program may either be
/usr/lib/rpm/sysusers.sh which calls useradd/groupadd, or
/usr/bin/systemd-sysusers. To match the functionality provided by
useradd/groupadd from the shadow-utils project, systemd-sysusers must
emit audit events so that it provides a drop-in replacement.

systemd-sysuers will emit audit events AUDIT_ADD_USER/AUDIT_ADD_GROUP
when adding users and groups. The operation "names" are copied from
shadow-utils, so the format of the events that is generated on success
should be identical. On failure, things are more complicated. We write
the whole file at once, once, so we first generate "success" messages
for each entry, then we try to write the files, and if things fail, we
generate failure messages to all entries that we failed to write.

9 months agocore: use shared audit-fd wrappers 35957/head
Zbigniew Jędrzejewski-Szmek [Tue, 14 Jan 2025 14:45:07 +0000 (15:45 +0100)] 
core: use shared audit-fd wrappers

Two funcs are renamed to avoid naming conflict with the common
helper.

9 months agosysusers: emit audit events for user and group creation
Zbigniew Jędrzejewski-Szmek [Fri, 10 Jan 2025 14:35:13 +0000 (15:35 +0100)] 
sysusers: emit audit events for user and group creation

Background: Fedora/RHEL are switching to sysusers.d metadata for creation of
users and groups for system users defined by packages
(https://fedoraproject.org/wiki/Changes/RPMSuportForSystemdSysusers).
Packages carry sysusers files. During package installation, rpm calls an
program to execute on this config. This program may either be
/usr/lib/rpm/sysusers.sh which calls useradd/groupadd, or
/usr/bin/systemd-sysusers. To match the functionality provided by
useradd/groupadd from the shadow-utils project, systemd-sysusers must emit
audit events so that it provides a drop-in replacement.

systemd-sysuers will emit audit events AUDIT_ADD_USER/AUDIT_ADD_GROUP when
adding users and groups. The operation "names" are copied from shadow-utils in
Fedora (which has a patch to change them from the upstream version), so the
format of the events that is generated on success should be identical.

The helper code is shared between sysusers and utmp-wtmp. I changed the
audit_fd variable to be unconditional. This way we can avoid ugly iffdefery
every time the variable would be used. The cost is that 4 bytes of unused
storage might be present. This is negligible, and the compiler might even be
able to optimize that away if it inlines things.

9 months agotest: Drop sandbox() from integration test wrapper 36009/head
Daan De Meyer [Wed, 15 Jan 2025 09:21:33 +0000 (10:21 +0100)] 
test: Drop sandbox() from integration test wrapper

With the latest changes, this is not required anymore as mkosi sandbox
will set up the proper $PATH to make sure the executables from the build
directory are used.

9 months agomkosi: Update to latest
Daan De Meyer [Wed, 15 Jan 2025 09:21:12 +0000 (10:21 +0100)] 
mkosi: Update to latest