Yu Watanabe
c9501b03cd
Merge pull request #26641 from medhefgo/boot-elf2efi
...
boot: Drop gnu-efi / Add elf2efi.py
2023-03-11 17:15:01 +09:00
Daan De Meyer
aa41079175
Merge pull request #26726 from DaanDeMeyer/cleanups
...
Various small cleanups
2023-03-10 14:22:53 +01:00
Lennart Poettering
d0ed83f3ae
Merge pull request #26737 from poettering/runtime-scope
...
add RuntimeScope enum, replacing LookupScope and various booleans indicating whether we are called in a per-system or per-user context
2023-03-10 13:09:40 +01:00
Daan De Meyer
37c485482f
lock-util: Use unposix_lock() in make_lock_file() and release_lock_file()
2023-03-10 11:57:43 +01:00
Daan De Meyer
460accdf3d
user-util: Use unposix_lock() in take_etc_passwd_lock()
2023-03-10 11:57:43 +01:00
Daan De Meyer
4dd888dc92
lock-util: Move to src/basic
2023-03-10 11:57:43 +01:00
Jan Janssen
9214828313
meson: Introduce userspace dep
...
This will help in a later commit to separate userspace from EFI builds.
2023-03-10 11:40:14 +01:00
Lennart Poettering
f69edd6faf
Merge pull request #26331 from ddstreet/tpm2_pcr_read
...
Tpm2 pcr read
2023-03-10 10:24:39 +01:00
Lennart Poettering
40d73340fa
runtime-scope: add helper that turns RuntimeScope enum into --system/--user string
2023-03-10 09:47:58 +01:00
Lennart Poettering
4870133bfa
basic: add RuntimeScope enum
...
In various tools and services we have a per-system and per-user concept.
So far we sometimes used a boolean indicating whether we are in system
mode, or a reversed boolean indicating whether we are in user mode, or
the LookupScope enum used by the lookup path logic.
Let's address that, in introduce a common enum for this, we can use all
across the board.
This is mostly just search/replace, no actual code changes.
2023-03-10 09:47:39 +01:00
Lennart Poettering
5f64d2bf33
socket-util: fix socket_get_family()
...
Function didn't actually return anything useful. Quite a shame.
2023-03-10 09:36:18 +01:00
Lennart Poettering
96c96fb250
Merge pull request #26704 from poettering/mnt-nosymlinks
...
Set MS_NOSYMFOLLOW for ESP + XBOOTLDR and many mount option clean-ups
2023-03-10 09:34:04 +01:00
Lennart Poettering
92c6f73cc5
fd-util: move ACQUIRE_NO_XYZ flags to the header the function using them is in
...
Follow-up for: b25a930f0e
2023-03-09 22:56:30 +01:00
Lennart Poettering
a617007417
mempress: change default PSI window duration to 2s
...
This changes the PSI window duration we default to for watching memory
pressure events from 1s to 2s. This is because apparently the kernel
will soon disallow window durations other than 2s for unprivileged
processes.
Hence, we'll bump the threshold from 100m to 200ms, and the window from
1s to 2s.
2023-03-09 22:31:20 +01:00
Lennart Poettering
e1349c045e
mountpoint-util: add comment explaining why fstype_can_discard() can't use mount_option_supported()
2023-03-09 21:56:42 +01:00
Lennart Poettering
6eda6f7e51
mountpoint-util: add new fstype_can_umask() helper
2023-03-09 21:56:42 +01:00
Lennart Poettering
034ebc47a2
mountpoint-util: move 'norecovery' detection into its own helper call
...
And let's also ask the kernel explicitly for support.
2023-03-09 21:56:42 +01:00
Lennart Poettering
4e6d305ae2
mountpoint-util: use mount_option_supported() to detect if 'discard' is support for an fs
2023-03-09 21:56:42 +01:00
Lennart Poettering
117e703447
mountpoint-util: generalize mount_option_supported()
2023-03-09 21:56:42 +01:00
Lennart Poettering
7d3b157b77
mountpoint-util: add helper that checks if MS_NOSYMFOLLOW is supported
2023-03-09 16:14:29 +01:00
Lennart Poettering
c115e1615b
missing: add more defines to fsopen() definitions
2023-03-09 16:13:42 +01:00
Lennart Poettering
34a9da0d8e
missing: add fsmount() syscall fallback definition
2023-03-09 16:12:37 +01:00
Dan Streetman
33d9beed07
basic/bitfield: add bitfield operations
...
Add macros to manage bits in a bitfield (e.g. uint32_t, uint64_t, etc),
such as setting, clearing, checking bits, and iterating all set bits.
These are similiar to the bitmap operations, but operate on basic types
instead of requiring a Bitmap object.
2023-03-09 09:58:32 -05:00
Daan De Meyer
44777d7ad6
memfd-util: Add memfd_new_and_seal()
2023-03-09 13:46:55 +01:00
Dan Streetman
e179f2d89c
basic/macro: add macro to iterate variadic args
2023-03-09 07:11:04 -05:00
Yu Watanabe
b9872fe1dd
macro: support the case that the number of elements has const qualifier
...
Follow-up for 5716c27e1f .
Addresses https://github.com/systemd/systemd/pull/26303#issuecomment-1460712007 .
2023-03-09 08:41:43 +01:00
Luca Boccassi
2ca6f09b30
Merge pull request #26656 from yuwata/mkdir-error-code
...
mkdir: fix error code
2023-03-08 21:23:07 +00:00
Zbigniew Jędrzejewski-Szmek
ad078f59fa
Merge pull request #26678 from yuwata/foreach_array
...
macro: introduce FOREACH_ARRAY() macro
2023-03-08 19:06:20 +01:00
Jan Engelhardt
18fe76eba5
doc: correct wrong use "'s" contractions
2023-03-07 13:39:31 +01:00
Yu Watanabe
9d0d39ee53
conf-files: fix potential memleak in conf_files_list_strv_internal() on failure
...
This also changes the used hash_ops from path_hash_ops to
string_hash_ops, as the key is not a path, but a filename.
2023-03-07 18:43:34 +09:00
Yu Watanabe
5716c27e1f
macro: introduce FOREACH_ARRAY() macro
...
The pattern that runs all array element is quite common.
But, sometimes, the number of element may be in a signed integer, or the
array may be NULL.
2023-03-07 13:27:16 +09:00
Luca Boccassi
df40b7ef5a
Merge pull request #26686 from yuwata/iovec
...
tree-wide: replace IOVEC_INIT with IOVEC_MAKE
2023-03-06 21:00:04 +00:00
Luca Boccassi
db73b9d2ab
Merge pull request #26502 from DaanDeMeyer/chase-symlinks-additions
...
Several chase_symlinks() additions
2023-03-06 20:51:06 +00:00
Luca Boccassi
52bdfbf7d7
Merge pull request #26687 from yuwata/c2x
...
C2X support
2023-03-06 20:50:17 +00:00
Yu Watanabe
84d0dc53ac
time-util: drop redundant call of tzset()
...
It is also called at the beginning of `parse_timestamp_maybe_with_tz()`.
2023-03-06 20:39:37 +00:00
Daan De Meyer
9a98c0f2b1
chase-symlinks: Add chase_symlinks_at_and_open()
2023-03-06 13:53:01 +01:00
Daan De Meyer
e864dfa671
chase-symlinks: Add CHASE_MKDIR_0755
2023-03-06 13:42:43 +01:00
Daan De Meyer
28aa650eb7
chase-symlinks: Add CHASE_PARENT
...
Let's simplify chasing the parent directory of some path by adding
CHASE_PARENT.
2023-03-06 13:42:43 +01:00
Daan De Meyer
7bf4057d79
chase-symlinks: Return "." as path from chase_symlinks_at() instead of NULL
2023-03-06 13:42:40 +01:00
Daan De Meyer
577efd82f2
chase-symlinks: Skip shortcuts if CHASE_PROHIBIT_SYMLINKS is set
2023-03-06 13:41:02 +01:00
Cristian Rodríguez and Yu Watanabe
5545f336fd
Include <threads.h> if possible to get thread_local definition
...
IN C23, thread_local is a reserved keyword and we shall therefore
do nothing to redefine it. glibc has it defined for older standard
version with the right conditions.
v2 by Yu Watanabe:
Move the definition to missing_threads.h like the way we define e.g.
missing syscalls or missing definitions, and include it by the users.
Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com >
2023-03-06 10:04:39 +09:00
Yu Watanabe
ce16d177dd
tree-wide: replace IOVEC_INIT with IOVEC_MAKE
...
We use gnu11 to build, hence we can use structured initializer with
casting, and it is not necessary to use different patterns on
initialization and assignment.
Addresses https://github.com/systemd/systemd/pull/26560#discussion_r1118875447 .
2023-03-06 09:30:28 +09:00
Yu Watanabe
f482e22484
Merge pull request #26653 from poettering/tmpfile-linkable-replace
...
teach link_tmpfile() to optionally replace files
2023-03-04 02:53:59 +09:00
Yu Watanabe
c1b1492a94
mkdir: fix error code on failure
...
Before:
====
$ systemctl edit network.target
Failed to create directories for "/etc/systemd/system/network.target.d/override.conf": No such file or directory
====
After:
====
$ systemctl edit network.target
Failed to create directories for "/etc/systemd/system/network.target.d/override.conf": Permission denied
====
Fixes #26652 .
2023-03-03 22:52:09 +09:00
Lennart Poettering
23e208e742
tmpfile-util: teach link_tmpfile() to optionally replace files
2023-03-03 13:44:12 +01:00
Yu Watanabe
9f819781ca
time-util: refuse non-zero gmtoff with non-UTC timezone
...
Also this moves the range check for gmtoff to parse_timestamp_impl(), to
address the post-merge comment:
https://github.com/systemd/systemd/pull/26409#discussion_r1118650190
2023-03-03 20:39:19 +09:00
Yu Watanabe
87e0fd575e
time-util: extend comment a bit
2023-03-03 20:39:19 +09:00
Yu Watanabe
8beb47c824
time-util: rename len -> tz_offset
...
And merge parse_timestamp_with_tz() with parse_timestamp_impl().
Addresses the post-merge comment:
https://github.com/systemd/systemd/pull/26409#discussion_r1118647440
2023-03-03 20:39:19 +09:00
Yu Watanabe
ca9c9d8d8e
time-util: fix typo
...
Follow-up for 7a9afae604 .
2023-03-03 20:39:19 +09:00
Luca Boccassi
a41ac8ac40
Merge pull request #26628 from msizanoen1/utf8-quote-valid
...
escape: Ensure that output is always valid UTF-8
2023-03-02 17:33:16 +00:00