Commit Graph

82627 Commits

Author SHA1 Message Date
Andres Beltran
26c6f3271a core: add quota support for State, Cache, and Log exec directories 2025-07-07 17:28:47 +00:00
Andres Beltran
744086b58d shared: add exec-directory-util.ch 2025-07-07 17:28:47 +00:00
Andres Beltran
81e6b3685a quota-util: add methods to read and set project IDs 2025-07-07 17:28:47 +00:00
Andres Beltran
652ba6e0dc chattr-util: add helpers to read and set project IDs 2025-07-07 17:28:47 +00:00
Zbigniew Jędrzejewski-Szmek
a2123bf9d4 man: improve Description= documentation (#38101)
Fixes: #36165
2025-07-07 11:56:09 +02:00
Lennart Poettering
172dd81e92 man: improve Description= documentation
This is an attempt to address the issues raised in #36165.

Fixes: #36165
2025-07-07 11:21:25 +02:00
Lennart Poettering
d03714e4e4 tree-wide: "human readable" → "human-readable"
Apparently, the spelling with a hyphen is better style in the English
language.

Suggested by: #36165
2025-07-07 11:21:25 +02:00
dependabot[bot]
663108304a build(deps): bump github/codeql-action from 3.28.18 to 3.29.2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.18 to 3.29.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](ff0a06e83c...181d5eefc2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-07 17:36:42 +09:00
Lennart Poettering
64a78cb082 Unify error messages for transient settings, fix handling of Ex variants (#38083) 2025-07-07 09:39:40 +02:00
Daan De Meyer
c97fd65417 Explicitly include more headers (#38100)
Continuation of 4f18ff2e29.
2025-07-07 08:26:46 +02:00
Yu Watanabe
10b0bc476b timesync,test: explicitly include sys/timex.h when struct timex is used
struct timex is defined by sys/timex.h -> bits/timex.h.
Glibc includes the header in time.h, but let's explicitly include it
when the struct is used.

Similar to 4f18ff2e29, but for sys/timex.h.
2025-07-07 12:44:18 +09:00
Yu Watanabe
83a047fe23 tree-wide: include sys/stat.h where necessary
These source files uses symbols provided by sys/stat.h, e.g. struct stat,
S_IFREG, S_IFBLK, and so on. Let's explicitly include sys/stat.h where
necessary.

Glibc's fcntl.h includes bits/stat.h, which provides these symbols, so
these symbols can be used without explicitly including sys/stat.h. But,
based on the discussion in #37922, we should explicitly include relevant
headers, and should not rely on the indirect inclusion.

Similar to 4f18ff2e29, but for sys/stat.h.
2025-07-07 12:44:10 +09:00
Lennart Poettering
0ae2ac9759 Two follow-ups for recent PRs (#38062) 2025-07-06 22:06:52 +02:00
Zbigniew Jędrzejewski-Szmek
228d84e37a systemd-analyze: stop printing Ex transient settings
The test will fail if we ever add one again in the future by mistake.
2025-07-06 18:17:47 +02:00
Zbigniew Jędrzejewski-Szmek
41288f2daf shared/bus-unit-util: fix PrivateTmp=/PrivateUsers=/ProtectControlGroups= and Ex variants
For some fields, we perform careful parsing and verification on the sender
side. For other fields, we accept any string or strv. I think that actually
this is fine: we should optimize for the correct case, i.e. the user runs a
command that is valid. The server must perform parsing in all cases, so doing
the verification on the sender side doesn't add value. When doing parsing
locally, in case of invalid or unsupported input, we would generate the error
message locally, so we would avoid the D-Bus call, but the message itself is
not better and from the user's point of view, the result is the same. And by
doing the parsing only on the server side, we deal better with the case where
the sender has an older version of the software. By not doing verification, we
implicitly "support" new values. And when the sender has a newer version that
supports additional fields, that does not help as long as the server uses an
older version. So in case of version mismatches, parsing on the server side is
as good or better.

Resolves https://github.com/systemd/systemd/issues/37174.
2025-07-06 18:17:45 +02:00
Zbigniew Jędrzejewski-Szmek
fb98c75e0e shared/bus-unit-util: tweak bus_append_exec_command to use Ex prop only if necessary
This changes little in behaviour, the conceptual part is more important. The
non-Ex variant is the actual name on the command line, and we should use the
non-Ex D-Bus property too, if it works. This increases compatibility with old
versions. But the code was mostly doing the right thing. Even the tests tested
the right thing.

Follow-up for b3d593673c and
898fc00e79.

The test is simplified by taking advantage of the fact that both names
on the commandline are supposed to behave identically.

Partially resolves https://github.com/systemd/systemd/issues/37174.
2025-07-06 18:17:43 +02:00
Zbigniew Jędrzejewski-Szmek
6f06afde59 shared/bus-unit-util: rework error messages for NFTSet=
Let's be nice to the user and print the exact reason why we won't accept
a setting.
2025-07-06 18:06:51 +02:00
Zbigniew Jędrzejewski-Szmek
95a3cfcbf6 shared/bus-unit-util: rework error messages
We generally want to have error messages with a fixed structure that convey the
important information, i.e. field name, error value, and the offending text for
options that take short values. (The text is not printed for strings encoded with
base64 and hexmem or for credentials.)

Let's use a helper that prints the message in a fixed format in the majority of
cases. In the few places where a custom message is useful, the helper is not
used. The helper:
- prints the field name, value, and error info,
- quotes the value,
- handles -ENOMEM, so we don't need to handle it separately everywhere.

When this code was originally written, parse functions would return -1
as error. Nowadays day all return a good errno, so it is fine if we print
the corresponding strerror.
2025-07-06 18:06:49 +02:00
Zbigniew Jędrzejewski-Szmek
ce120ac823 shared/bus-unit-util: tweak error handling in bus_append_exec_command
exec_command_flags_to_strv() should not fail, unless we screwed up, so assert
instead of returning an error. Also, no need to strdup constant _PATH_BSHELL;
drop that so that we can get rid of the oom error handling. Finally, rename
l → cmdline for clarity.
2025-07-06 17:47:11 +02:00
Yu Watanabe
ffe8f21302 basic/include: replace _Static_assert() with static_assert()
If one of the header is included in a C++ source file, then using
_Static_assert() triggers compile error for some reasons.
Let's use static_assert(), which can be used by both C and C++ code.
2025-07-06 22:02:18 +09:00
Luca Boccassi
a8f8b3efb5 ci: add test timeout multiplier for ppc64le
The slow tests have timed out at least a couple of times,
so add a multiplier

1252/1633 systemd:libsystemd / test-sd-device      TIMEOUT 30.04s killed by signal 15 SIGTERM
1633/1633 systemd:libsystemd / test-journal-verify TIMEOUT 90.01s killed by signal 15 SIGTERM

Follow-up for 8a1d134144
2025-07-06 12:35:01 +01:00
Yu Watanabe
2643cb1ade core: rename ExecContext.ioprio_set -> .ioprio_is_set
To make it not conflict with syscall ioprio_set().
This is important as we have
```
 #define ioprio_set missing_ioprio_set
```
in missing_syscall.h.
2025-07-06 13:31:40 +02:00
Yu Watanabe
c56e251d3f analyze: include unistd.h
The source file uses symbols e.g. execl(), execvp(), _exit(), and so on,
without including unistd.h.

Continuation of 4f18ff2e29.

Follow-up for 9a08000d18.
2025-07-06 13:31:17 +02:00
Yu Watanabe
8d29f31bf6 namespace-util,nsresource: explicitly include sched.h
These source files uses symbols provided by sched.h, e.g.
setns(), unshare(), CLONE_NEWNS, and friends, but they do not explicitly
include sched.h. Currently, it is included indirectly via missing_syscall.h,
which is included by e.g. pidfd-util.h.
Let's explicitly include headers that provides symbols used in the code.

This is similar to 4f18ff2e29, but for sched.h.
2025-07-06 13:28:46 +02:00
Yu Watanabe
cfba9b9eab tree-wide: several cleanups for reading/writing /proc/sys/fs/nr_open
- use unsigned for the return value of read_nr_open(), as it does not
  fail, and the kernel internally uses unsigned for the value,
- when bumping the value by PID1, let's start from the kernel's maximum
  value defined in fs/file.c. The maximum value should be mostly an API
  of the kernel, but may changed in a future, hence still try several
  times if we fail to bump the value.

Co-authored-by: Jared Baur <jaredbaur@fastmail.com>
Co-authored-by: John Rinehart <johnrichardrinehart@gmail.com>
2025-07-06 13:22:56 +02:00
Luca Boccassi
6cc01c8cc4 ukify: fix parsing uname version with '+'
Debian started using '+' in the kernel uname version, which fails the
regex in ukify. Fix it.
2025-07-06 10:49:22 +01:00
Yu Watanabe
ebfd56975e cgroup-util: clean up skip_{slices,session,user_manager} (#38089) 2025-07-06 16:37:28 +09:00
Yu Watanabe
b0d40944b3 hwdb: fix typo in 70-maker-tools.hwdb, and add the file to meson.build (#38090) 2025-07-06 16:31:23 +09:00
Yu Watanabe
e7f04514c1 meson fixlets (#38086)
Some fixes for issues found while doing a minimal aarch64 cross build
2025-07-06 16:27:31 +09:00
AsciiWolf
225de2729d hwdb: fix typo in 70-maker-tools.hwdb 2025-07-05 23:44:08 +02:00
AsciiWolf
cdbc500faa hwdb: add 70-maker-tools.hwdb to meson.build
The hwdb file was not added there in 3dcb56f5e0 for some reason
2025-07-05 23:32:09 +02:00
Mike Yuan
b6fde0875b core/cgroup: drop outdated comment 2025-07-05 22:26:23 +02:00
Mike Yuan
d33104eba2 cgroup-util: clean up skip_{slices,session,user_manager}
Let's avoid obscure memcmp()s in skip_* and instead use
strndupa() to extract the bits we care and call usual
string routines on it.
2025-07-05 22:26:23 +02:00
Mike Yuan
68c703872c string-table: drop unneeded initialization 2025-07-05 22:26:23 +02:00
Luca Boccassi
163e666204 meson: call qemu with -machine virt on aarch64
'qemu-system-aarch64 -device help' fails when no machine is specified.
Use the 'virt' type which seems to be what everyone uses for VMs.
2025-07-05 20:21:51 +01:00
Luca Boccassi
ec0bbbd2a9 meson: do not reference variable unless feature that defines it is enabled
SYSTEMD_LANGUAGE_FALLBACK_MAP is used by the localed test, and
language_fallback_map is defined by the localed meson.
If the feature is disabled, the test is not built so the env var
is not needed, and the meson variable is not defined so the build
fails.
2025-07-05 20:21:00 +01:00
Yu Watanabe
f89a52e360 analyze: fix typo
Follow-up for 9a08000d18.
2025-07-06 01:42:27 +09:00
Yu Watanabe
7db319b13a man/analyze: fix typo
Follow-up for a839c4b7b7.
2025-07-06 01:41:47 +09:00
Yu Watanabe
0ddf8d9c1d TODO: fix typo 2025-07-06 01:41:14 +09:00
Yu Watanabe
4adf1b1d62 core/socket: fix typo
Follow-up for 1b4ab5a209.
2025-07-06 01:38:14 +09:00
DaanDeMeyer
5fe08a12e6 ask-password-api: Add more debug logging 2025-07-05 20:16:01 +09:00
Luca Boccassi
d25e515ebc mkosi: enable arm64 job and test fixlets (#38066)
Enable nspawn job, as there's no nested kvm so VMs are too slow. Fix
some tests that fail in a VM anyway, might add a nightly job later that
runs them.
2025-07-05 11:46:30 +01:00
Mike Yuan
1320e56283 chase: introduce openat_opath_with_automount() helper
Follow-up for c5de7b14ae

chase() is arguably a hot path in our code, hence it deserves
some caching whether open_tree() is available. Moreover,
the manual set of r to -EPERM feels kinda ugly. Let's
instead extract this bit into its own function.
2025-07-05 12:18:55 +02:00
Mike Yuan
d75219711f journal-file: const and _pure_'ify journal_file_writable()
Follow-up for 1543c2385c
2025-07-05 11:45:18 +02:00
Yu Watanabe
4df7d51cde networkd-test: stop varlink socket before setting up runtime directories
Follow-up for b0ea79c5b5.
2025-07-05 16:54:19 +09:00
Luca Boccassi
a06e64d884 ci: use -p and -f when creating dirs/removing files in mkosi job btrfs setup
It failed at least once:

mkdir: cannot create directory ‘/mnt/mkosi’: File exists
2025-07-05 11:38:10 +09:00
Lennart Poettering
aac21825cd seccomp-util: allowlist open_tree() as part of @file-system
Now that we make use of open_tree() in places we previously used
openat() with O_PATH, it makes sense to move it from @mount to
@file-system. Without the OPEN_TREE_CLONE flag open_tree() is after all
unprivileged.

Note that open_tree_attr() I left in @mount, since it's purpose is
really to set mount options when cloning, and that's clearly a mount
related thing, not so much something you could use unpriv.

Follow-up for: c5de7b14ae

This addresses an issue tracked down by Antonio Feijoo: since the commit
that started to use open_tree() various apps started to crash because
they used seccomp filters and sd-device started to use open_tree()
internally.
2025-07-04 22:23:24 +02:00
DaanDeMeyer
eabee42517 man: Fix typo 2025-07-04 21:33:36 +02:00
Luca Boccassi
b8fe5fa129 Small cleanups for tests (#38063) 2025-07-04 19:24:29 +01:00
Luca Boccassi
7c6e78a6bc mkosi: update debian commit reference to cc380fbc8af2e17165623d16630b7fc3ab4291d0
* cc380fbc8a Install new files for upstream build
* 45f81ec53e Install new files for upstream build
* 105837d0ba Update changelog for 257.7-1 release
* bb17074bfd systemd-boot: reduce harmless noise on cleanup
* 363898fe05 systemd-boot: remove fb too on removal
2025-07-04 20:17:51 +02:00