Commit Graph

78816 Commits

Author SHA1 Message Date
Miroslav Lichvar
af96ccfc24 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.
2025-01-16 21:12:47 +01:00
Luca Boccassi
0ec19b311b test: add link to Ubuntu autopkgtest status page in README
Known issues will be listed there by the team managing the infra
2025-01-16 14:50:55 +01:00
Lennart Poettering
8ce960a80d process-util: port pid_from_same_root_fs() to pidref + more (#35975)
Let's continue our move to PidRef.
2025-01-16 13:48:48 +01:00
Lennart Poettering
277255e814 process-util: slightly update comment in freeze() 2025-01-16 11:55:21 +01:00
Lennart Poettering
d6267b9b18 process-util: port pid_from_same_root_fs() to pidref, and port three places over to it 2025-01-16 11:55:21 +01:00
Lennart Poettering
a65de78d5c 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.
2025-01-16 11:55:21 +01:00
Lennart Poettering
6eeeef9f66 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.
2025-01-16 11:55:21 +01:00
Lennart Poettering
8110b34b64 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.
2025-01-16 11:55:21 +01:00
Lennart Poettering
9ef559a036 tree-wide: drop support for kernels without pidfd_open() and pidfd_send_signal() (#35971) 2025-01-16 11:37:17 +01:00
Lennart Poettering
39706728e1 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.
2025-01-16 11:26:57 +01:00
Jan Macku
ca97d48bd4 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 91080bc973
2025-01-16 10:49:04 +01:00
Duncan Overbruck
c8342feb07 shell-completions: add systemctl sleep 2025-01-16 09:33:15 +01:00
Lennart Poettering
30adccf3d4 meson: enable -Wzero-as-null-pointer-constant (#36028)
Support for C added in gcc 15:

236c0829ee
2025-01-16 07:48:21 +01:00
Lennart Poettering
5e36128ff2 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.
2025-01-16 07:47:08 +01:00
Mike Yuan
70923ed358 meson: enable -Wzero-as-null-pointer-constant
Support for C added in gcc 15:
236c0829ee
2025-01-16 02:26:56 +01:00
Mike Yuan
347eb8fbe3 tree-wide: remove unnecessary gcc >= 7 version check
Our baseline is gcc 8.4.
2025-01-16 02:26:56 +01:00
Luca Boccassi
35da377035 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 01f05f0087.
2025-01-16 00:42:23 +00:00
Luca Boccassi
01f05f0087 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
2025-01-15 23:57:11 +00:00
hanjinpeng
7e91a68b2f log: check isempty for object_field and extra_field 2025-01-15 22:36:58 +00:00
Lennart Poettering
2ca0f3ed2e pty_open_peer() follow-up (#36027) 2025-01-15 21:05:59 +01:00
Lennart Poettering
09fbff57fc 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.
2025-01-15 21:05:06 +01:00
Lennart Poettering
f8214e2cca 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.
2025-01-15 20:55:01 +01:00
Yu Watanabe
e722fe74ca 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
```
2025-01-15 20:24:30 +01:00
Lennart Poettering
cc7300fc58 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.
2025-01-16 03:34:37 +09:00
Yu Watanabe
b8980528c0 analyze: fix assignment of object_field
Prompted by #36000.
2025-01-16 03:34:11 +09:00
jane400
9e47199028 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
2025-01-16 03:33:45 +09:00
Mike Yuan
d693ba5f8e 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 1d522f1a86. Kill it!
2025-01-15 17:46:10 +01:00
Mike Yuan
9843ad6dc3 run: with TIOCGPTPEER there's no longer need to acquire pty peer through IPC 2025-01-15 17:46:10 +01:00
Mike Yuan
e956a8372b run: correct log level for pty_open_peer() error
Everything around it logs loudly.
2025-01-15 17:46:10 +01:00
Lennart Poettering
07b3556510 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.
2025-01-15 17:03:21 +01:00
Lennart Poettering
ef5f72437e 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.
2025-01-15 17:03:21 +01:00
Lennart Poettering
db320d97ca 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.
2025-01-15 17:03:21 +01:00
Lennart Poettering
cf8f6cd057 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.
2025-01-15 17:03:21 +01:00
Lennart Poettering
a6ad410ffa 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.
2025-01-15 17:03:21 +01:00
Lennart Poettering
29f2057a20 pam-systemd: downgrade log message we handle gracefully to LOG_WARNING as per coding style 2025-01-15 17:03:21 +01:00
Yu Watanabe
7adf6ce3ca mkosi: disable multipathd by default
Hopefully fixes #36008.
2025-01-16 00:57:07 +09:00
Lennart Poettering
d2c7f8242b 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.
2025-01-15 16:53:43 +01:00
wrvsrx
6013dee98d 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
3fab70c165

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.
2025-01-15 16:53:21 +01:00
Lennart Poettering
fc6192f52b 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
2025-01-15 16:52:24 +01:00
Lennart Poettering
76d2b8e281 nspawn: trivial scope reduction 2025-01-15 15:35:57 +00:00
Antonio Alvarez Feijoo
49879a32b6 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.
2025-01-15 15:33:00 +00:00
Daan De Meyer
e9b9fc080f 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.
2025-01-15 15:32:14 +00:00
Yu Watanabe
346ed75198 ptyfwd: fix wrong userdata passed to PTY forwarding
Fixes #35942.
2025-01-15 16:25:32 +01:00
Lennart Poettering
b5a6f4c05b 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.
2025-01-15 13:25:08 +01:00
Lennart Poettering
3bcb650431 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.
2025-01-15 13:24:17 +01:00
Lennart Poettering
7adafb0832 missing: add quotactl_fd() wrapper 2025-01-15 13:24:04 +01:00
Lennart Poettering
f91f1eda08 bus-wait-for-jobs: fix table of service result codes (#35992) 2025-01-15 12:50:32 +01:00
Lennart Poettering
4582f8d7a5 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.
2025-01-15 11:58:49 +01:00
Lennart Poettering
2baca6c22b logind: add basic Varlink API
For now this only covers CreateSession() and ReleaseSession(), i.e. the
two operations pam_systemd cares about.
2025-01-15 11:56:47 +01:00
Ivan Kruglov
4daecc8af5 machine: tests for io.systemd.MachineImage.SetPoolLimit 2025-01-15 02:47:58 -08:00