1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 01:55:22 +03:00
Commit Graph

75432 Commits

Author SHA1 Message Date
Luca Boccassi
67f90b0d85 os-release: change RELEASE_TYPE value from 'pre-release' to 'development'
The point was made on https://lists.debian.org/debian-ctte/2024/08/msg00005.html
that 'pre-release sounds' like an RC candidate, ie, something that will change
very slightly in the released version. But this is not necessarily the case
for example at the beginnig of a Fedora Rawhide or Debian Testing release cycle,
so change it to a more generic 'development'

Follow-up for 7102dc52e6
2024-08-01 20:36:02 +01:00
Luca Boccassi
62bfb79b61
Merge pull request #33893 from yuwata/coverity
tree-wide: resolve several issues found by coverity
2024-08-01 20:33:53 +02:00
Luca Boccassi
98c2cb186b
Merge pull request #32988 from AdrianVovk/os-release-prerelease
os-release: Add RELEASE_TYPE=
2024-08-01 18:56:15 +02:00
Adrian Vovk
d25a9bfa8f os-release: Introduce experiment RELEASE_TYPE
This is for experimental builds of the OS made to test some specific WIP
feature.

For example, let's say the distro in question is Asahi Linux and Apple
just released the M3 SoC. The Asahi developers will start porting to the
M3, and will quickly generate builds of Asahi Linux that can technically
boot but aren't ready for any kind of daily use. These images are marked
as experimental, and can be shared among the developers. If a user
somehow stumbles upon one of these images and tries to install it,
they'll be warned that they're about to install an experimental Apple M3
port of Asahi Linux. Eventually, once the Asahi developers think that
their M3 port is ready for a wider audience, they can merge it into the
mainline Asahi repos, where it will be distributed through the usual
nightly CI builds (where RELEASE_TYPE=pre-release; M3 support is no
longer experimental).
2024-08-01 17:22:23 +01:00
Adrian Vovk
7102dc52e6 os-release: Add RELEASE_TYPE=
This will allow GUIs to customize their behavior a little based on the
type of release.

For example, an OS installer may display a warning/disclaimer if
RELEASE_TYPE=prerelease. The software updates app might be a bit more
insistent about upgrading to the next major release if
RELEASE_TYPE=stable than if RELEASE_TYPE=lts
2024-08-01 17:22:13 +01:00
Yu Watanabe
f7012a93a7 import: check overflow
Fixes CID#1548022 and CID#1548075.
2024-08-01 22:45:53 +09:00
Yu Watanabe
fea2f92d8d test: use ASSERT_OK_ERRNO() for setenv() and unsetenv() 2024-08-01 22:42:08 +09:00
Yu Watanabe
6141fe925a test: resolve "Unchecked return value" coverity warning
Follow-up for c8210d98a4.
Fixes CID#1548920.
2024-08-01 22:42:08 +09:00
Yu Watanabe
a30ac8d52c vmspawn: check overflow earlier
Follow-up for 862c68a914.
Fixes CID#1550749.
2024-08-01 22:42:08 +09:00
Yu Watanabe
96bf7e1f3b test: resolve "Unchecked return value" coverity warning
Follow-up for 5fef5552a6.
Fixes CID#1558540.
2024-08-01 22:42:08 +09:00
Yu Watanabe
dc7607f687 test: resolve "Unchecked return value" coverity warning
Follow-up for 8c57700b6b.
Fixes CID#1558539.
2024-08-01 22:42:08 +09:00
Frantisek Sumsal
ce2344bbee test: attempt to install sshd-session from multiple places
On Fedora the sshd-session binary is under /usr/libexec/openssh/ so
cover this path as well in the old framework.

Follow-up for aaa7b36bd1.
2024-08-01 15:02:34 +02:00
dependabot[bot]
89322b8c09 build(deps): bump github/codeql-action from 3.25.11 to 3.25.15
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.11 to 3.25.15.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b611370bb5...afb54ba388)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 13:36:40 +02:00
dependabot[bot]
73eb21703e build(deps): bump meson from 1.4.1 to 1.5.1 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 1.4.1 to 1.5.1.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.4.1...1.5.1)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 13:34:28 +02:00
dependabot[bot]
5186b40c6f build(deps): bump systemd/mkosi
Bumps [systemd/mkosi](https://github.com/systemd/mkosi) from 4eba736412c702bbbe2c6d4a58a92fa977219249 to 63fc1fde5b1aac1abf07ac499068c2b62263dafb.
- [Release notes](https://github.com/systemd/mkosi/releases)
- [Changelog](https://github.com/systemd/mkosi/blob/main/NEWS.md)
- [Commits](4eba736412...63fc1fde5b)

---
updated-dependencies:
- dependency-name: systemd/mkosi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 13:34:09 +02:00
dependabot[bot]
1d8de1d5ac build(deps): bump redhat-plumbers-in-action/differential-shellcheck
Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](60c9f2b924...cc6721c45a)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 13:09:16 +02:00
dependabot[bot]
e2dca8d9c0 build(deps): bump ossf/scorecard-action from 2.3.3 to 2.4.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.3 to 2.4.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](dc50aa9510...62b2cac7ed)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 13:08:42 +02:00
Yu Watanabe
a8bc75089d journalctl: fix compile error on i386
Fixes the following error:
===
In file included from ../src/basic/macro.h:13,
                 from ../src/basic/dirent-util.h:8,
                 from ../src/journal/journalctl-misc.c:3:
../src/journal/journalctl-misc.c: In function 'show_log_ids':
../src/journal/journalctl-misc.c:107:22: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  107 |         assert(n_ids < INT64_MAX);
      |                      ^
../src/fundamental/macro-fundamental.h:70:44: note: in definition of macro '_unlikely_'
   70 | #define _unlikely_(x) (__builtin_expect(!!(x), 0))
      |                                            ^
../src/basic/macro.h:165:22: note: in expansion of macro 'assert_message_se'
  165 | #define assert(expr) assert_message_se(expr, #expr)
      |                      ^~~~~~~~~~~~~~~~~
../src/journal/journalctl-misc.c:107:9: note: in expansion of macro 'assert'
  107 |         assert(n_ids < INT64_MAX);
      |         ^~~~~~
cc1: all warnings being treated as errors
===

Follow-up for 0a8c1f6212.
2024-08-01 10:49:40 +02:00
Yu Watanabe
12a12c5af5
Merge pull request #33888 from YHNdnzj/followups
core: a few follow-ups for recent PRs
2024-08-01 11:35:13 +09:00
Yu Watanabe
89cf6f0b0a
Merge pull request #32448 from yuwata/journalctl-current-invocation
journalctl: introduce --list-invocations, -I, --invocation= options
2024-08-01 11:33:20 +09:00
Yu Watanabe
b1b30d0226 test: add test for journalctl --list-invocations and --invocation= 2024-08-01 07:31:44 +09:00
Yu Watanabe
7d3ae6b213 journalctl: add --list-invocations command and -I/--invocation options
The --list-invocations command is similar to --list-boots, but shows
invocation IDs of specified unit. This should be useful when showing
a specific invocation of a unit.

The --invocation option is similar to --boot, but takes a invocation ID
or an offset. The -I option is equivalent to --invocation=0.
2024-08-01 07:31:44 +09:00
Yu Watanabe
82721be7d6 logs-show: extend journal_get_boots() and friends to find invocation IDs
Currently the extended features are not used, but will be used later.
2024-08-01 07:31:44 +09:00
Yu Watanabe
1a997cb732 logs-show: introduce several helper functions
Currently these are not used, but will be used later.
2024-08-01 07:31:44 +09:00
Yu Watanabe
0a8c1f6212 use int64_t for index in show_log_ids() 2024-08-01 07:31:44 +09:00
Yu Watanabe
b3a16f3985 journalctl: split out show_log_ids() from action_list_boots()
No functional change, just refactoring and prepraration for later change.
2024-08-01 07:31:44 +09:00
Yu Watanabe
a581a2ce8d journalctl: update log messages 2024-08-01 07:31:44 +09:00
Yu Watanabe
6ecee6cf2b logs-show: rename BootId -> LogId
The struct itself is generic, and can be used for other ID.
Let's rename it to more generic one.
No functional change, just refactoring and preparation for later
commits.
2024-08-01 07:31:44 +09:00
Mike Yuan
4c523d62d2
core/socket: stop hardcoding every service inactive state
History (c068650fcf,
941a12dcba) has proven
that we're not good at keeping socket and service states
in sync. Instead, let's query the high-level unit_active_state()
first, and only hardcode the two special auto-restart
service states.

Additionally, allow returning to listening state on SERVICE_CLEANING.
2024-07-31 21:56:28 +02:00
Mike Yuan
067c91fcb8
core/cgroup: use UNIT_IS_INACTIVE_OR_FAILED where appropriate 2024-07-31 21:40:28 +02:00
Mike Yuan
8574b7940b
core/unit: merge use of LOG_CONTEXT_SET_LOG_LEVEL into LOG_CONTEXT_PUSH_UNIT
No functional change, since LOG_CONTEXT_PUSH_UNIT is only used
in exec_spawn().
2024-07-31 21:40:28 +02:00
Mike Yuan
c4c416b109
core: clean up ambient capability logging
Follow-up for e0ebc81b2d
2024-07-31 21:40:28 +02:00
Daan De Meyer
3a5d72d8a3
Merge pull request #33886 from DaanDeMeyer/autologin
Two mkosi improvements
2024-07-31 20:21:12 +02:00
Daan De Meyer
ff5662129a
Merge pull request #33885 from DaanDeMeyer/pidref-kthread
Two pidfd fixes
2024-07-31 19:07:35 +02:00
Daan De Meyer
3fe25d4530 mkosi: Beef up testuser a bit
Give it a password and add it to some common groups.
2024-07-31 18:32:53 +02:00
Daan De Meyer
b3db96f230 mkosi: Switch to autologin via credentials
Let's use the newly added credentials to only enable autologin for
/dev/console (systemd-nspawn) and /dev/hvc0 (qemu) instead of enabling
autologin for every tty.
2024-07-31 17:38:12 +02:00
Daan De Meyer
e54a8e0fc3
Merge pull request #33873 from DaanDeMeyer/rename-creds
core: Add support for renaming credentials with ImportCredential=
2024-07-31 17:35:58 +02:00
Michal Sekletar
941a12dcba socket: fix socket activation of stopped services with pinned FD store 2024-07-31 16:29:07 +02:00
Luca Boccassi
0e5c97ae6f
Merge pull request #32937 from steelman/github/drop-ambient-caps-executor
core: drop ambient capabilities in systemd-executor
2024-07-31 16:11:30 +02:00
Daan De Meyer
e97429902d units: Import tty specific credentials for each getty unit
As explained in the previous commit, this allows us to configure
agetty and login for individual ttys instead of globally.
2024-07-31 15:52:29 +02:00
Daan De Meyer
831f208783 core: Add support for renaming credentials with ImportCredential=
This allows for "per-instance" credentials for units. The use case
is best explained with an example. Currently all our getty units
have the following stanzas in their unit file:

"""
ImportCredential=agetty.*
ImportCredential=login.*
"""

This means that setting agetty.autologin=root as a system credential
will make every instance of our all our getty units autologin as the
root user. This prevents us from doing autologin on /dev/hvc0 while
still requiring manual login on all other ttys.

To solve the issue, we introduce support for renaming credentials with
ImportCredential=. This will allow us to add the following to e.g.
serial-getty@.service:

"""
ImportCredential=tty.serial.%I.agetty.*:agetty.
ImportCredential=tty.serial.%I.login.*:login.
"""

which for serial-getty@hvc0.service will make the service manager read
all credentials of the form "tty.serial.hvc0.agetty.xxx" and pass them
to the service in the form "agetty.xxx" (same goes for login). We can
apply the same to each of the getty units to allow setting agetty and
login credentials for individual ttys instead of globally.
2024-07-31 15:52:27 +02:00
Daan De Meyer
3de13e6148 exec-credential: Skip duplicate credentials in load_credential_glob()
We document that when multiple credentials of the same name are found,
we use the first one found so let's actually implement that behavior.
2024-07-31 15:23:45 +02:00
Daan De Meyer
590348e2bf exec-credential: Log if we skip duplicate credential 2024-07-31 15:23:45 +02:00
Daan De Meyer
2c2ed3272b Drop EEXIST handling in load_credential_glob()
Credentials are written to a temporary file and renamed to the
destination with renameat() which will replace existing files so
EEXIST should not happen so drop the handling for EEXIST.
2024-07-31 15:23:45 +02:00
Daan De Meyer
5551426785
Merge pull request #33884 from DaanDeMeyer/log-context
log: Fix size calculation for number of iovecs
2024-07-31 14:23:08 +02:00
Daan De Meyer
ead48ec35c cgroup-util: Don't try to open pidfd for kernel threads
The kernel might start returning -EINVAL when trying to open pidfd's
for kernel threads so let's not try to open pidfd's for kernel threads.
2024-07-31 13:50:16 +02:00
Daan De Meyer
9ce964d55b
Merge pull request #33882 from bluca/efi_proto_fallback_memory
stub: allocate and zero enough space in legacy x86 handover protocol
2024-07-31 13:46:41 +02:00
Daan De Meyer
fc83ff3f55 log: Fix size calculation for number of iovecs
Each log context field can expand to up to three iovecs (key, value
and newline) so let's fix the size calculation to take this into
account.
2024-07-31 13:12:55 +02:00
Daan De Meyer
7881f485c9 execute: Drop log level to unit log level in exec_spawn()
All messages logged from exec_spawn() are attributed to the unit
and as such we should set the log level to the unit's max log level
for the duration of the function.
2024-07-31 13:12:55 +02:00
Łukasz Stelmach
18d51ec876 Revert "execute: Call capability_ambient_set_apply even if ambient set is 0"
With ambient capabilities being dropped at the start of process managers
(both system and user) as well as systemd-executor it isn't necessary
to drop them here. Moreover, at this point also the inheritable set can
be preserved. This makes it possible to assign a user session manager
inheritable capabilities which combined with file capabilites (ei sets)
of service executables enable running user services with capabilities
but only when started by the manager.

This reverts commit 943800f4e7.
2024-07-31 11:09:58 +02:00