Commit Graph

4807 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
02df2981b5 meson: drop repeated output in error message 2022-10-17 15:10:53 +02:00
Zbigniew Jędrzejewski-Szmek
0923b4253c tree-wide: replace "plural(s)" by "plurals"
(s) is just ugly with a vibe of DOS. In most cases just using the normal plural
form is more natural and gramatically correct.

There are some log_debug() statements left, and texts in foreign licenses or
headers. Those are not touched on purpose.
2022-10-17 15:10:53 +02:00
Luca Boccassi
5762dbfad6 Merge pull request #24883 from bluca/extrel_force
portable: allow caller to override extension-release name check
2022-10-12 20:20:46 +02:00
Luca Boccassi
a063184097 Merge pull request #24934 from keszybz/remove-nss-lookup
Remove nss lookups from pid1
2022-10-12 15:21:40 +02:00
Yu Watanabe
6c65a9e1d6 Merge pull request #24973 from keszybz/simplify-variable-declarations
Simplify variable declarations
2022-10-12 19:36:47 +09:00
Luca Boccassi
06768b90a3 portable: allow caller to override extension-release name check
When the --force flag is used, do not insist that the extension-release
file has to match the extension image name
2022-10-12 09:57:24 +01:00
Luca Boccassi
192a9b70c2 os-util: split out extension-release xattr helper 2022-10-12 09:57:24 +01:00
Zbigniew Jędrzejewski-Szmek
67f047a6f2 basic/user-util: simplify variable declarations in fget{pw,gr}ent_sane() 2022-10-12 09:18:41 +02:00
Zbigniew Jędrzejewski-Szmek
9154bd57db basic/chase-symlinks: add note that CHASE_WARN is not for PID 1
This should be enough to make us remember that constraint. A more heavy-weight
approach like renaming the option to CHASE_WARN_NSS_LOOKUP would be possible,
but it'd make the callers quite verbose and doesn't seem worth it.
2022-10-12 08:01:01 +02:00
Luca Boccassi
da60182759 Merge pull request #24933 from keszybz/erradicate-strerror
Erradicate strerror
2022-10-11 21:47:38 +02:00
Zbigniew Jędrzejewski-Szmek
0b6a47957b tree-wide: drop () around the first argument of a ternary op
https://github.com/systemd/systemd/pull/24933#discussion_r991242789
2022-10-11 16:59:00 +02:00
Zbigniew Jędrzejewski-Szmek
0cf1a4b3a7 Get rid of strerror_safe() 2022-10-11 16:59:00 +02:00
Zbigniew Jędrzejewski-Szmek
f37508d506 tree-wide: get rid of lgtm annotations
We now use CodeQL, and LGTM itself is gone. Those old annotations are not
useful for anythign now.
2022-10-11 16:59:00 +02:00
Zbigniew Jędrzejewski-Szmek
f69ae8585f tree-wide: define and use STRERROR_OR_EOF() 2022-10-11 16:58:21 +02:00
Zbigniew Jędrzejewski-Szmek
2c5d05b3cd basic: add STRERROR() wrapper for strerror_r() 2022-10-11 16:10:21 +02:00
Zbigniew Jędrzejewski-Szmek
892dc96787 basic/stdio-util: allow xsprintf() to be used without any arguments
xsprintf(buf, "…: %m") would fail, now it works.
2022-10-11 16:10:21 +02:00
Lennart Poettering
00675c363f tree-wide: add ERRNO_IS_XATTR_ABSENT() helper
We check the same list of error codes on various xattr operations, and
we should on some more. Add a common helper for this purpose.
2022-10-10 16:00:15 +02:00
Zbigniew Jędrzejewski-Szmek
50c5b991df basic/errno-util: add helper to protect and set errno in one step
This pattern is used in a few places. Those are changed in this patch.
Subsequent patches will add more.
2022-10-10 09:12:21 +02:00
Zbigniew Jędrzejewski-Szmek
6b7834fe5d basic/log: include the log syntax callback in the errno protection block
In general, log_syntax_internal() must keep errno unchanged. But the
call to log_syntax_callback() was added outside of the block protected
by PROTECT_ERRNO.
2022-10-07 16:25:56 +02:00
Luca Boccassi
e96180a88d Merge pull request #24877 from brauner/namespace_utils
namespace-util: add an initial set of tweaks
2022-10-04 21:59:48 +01:00
Christian Brauner
2fe299a320 namespace-util: add in_same_namespace()
Add a helper for the canonical way to determine whether two namespaces
are identical.
2022-10-04 18:51:28 +02:00
Christian Brauner
c3b9c418c0 namespace-util: add namespace_info 2022-10-04 18:46:27 +02:00
Christian Brauner
9014fd82f7 missing_sched: add CLONE_NEWTIME 2022-09-30 17:08:57 +02:00
Luca Boccassi
697f082697 Merge pull request #24853 from poettering/resolved-monitor-fixes
resolved: various monitor fixes
2022-09-30 15:46:13 +01:00
Jonas Kümmerlin
1355672437 generator: skip fsck if fsck command is missing
This is useful for systems which don't have any fsck.

We already skip emitting the fsck dependency when the fsck.$fstype helper
is missing, but fstab-generator doesn't necessarily know the fstype when
handling the root= parameter.

Previously, systemd-fsck was started for these mounts and then exited
immediately because it couldn't find the fsck.$fstype helper.
2022-09-30 15:01:41 +01:00
Lennart Poettering
24fe5e9807 glyph-util: add left arrow special glyph entry 2022-09-30 14:14:48 +02:00
Daan De Meyer
354dc913c5 Merge pull request #24635 from DaanDeMeyer/repart-verity-sig
repart: Add support for generating verity sig partitions
2022-09-23 18:53:04 +02:00
Daan De Meyer
2812017cfb basic: Add strgrowpad0() 2022-09-23 14:10:07 +02:00
Lennart Poettering
497ca785aa fs-util: add mknodat_atomic() 2022-09-23 09:25:33 +02:00
Lennart Poettering
4f477796f3 fs-util: make mkfifo_atomic() just a shortcut for mkfifoat_atomic() 2022-09-23 09:24:05 +02:00
Lennart Poettering
da9dd029a2 fs-util: replace symlink_atomic() by symlinkat_atomic() 2022-09-23 09:22:36 +02:00
Yu Watanabe
0a935bb850 Merge pull request #24711 from poettering/verify_fsroot_dir-rework
find-esp: rework verify_fsroot_dir()  a bit
2022-09-21 00:56:00 +09:00
Lennart Poettering
739d9cae40 recurse-dir: use fd_reopen() at one more place
Inspired by 83b94cf10e
2022-09-21 00:55:23 +09:00
Lennart Poettering
52f19d9678 stat-util: add statx_mount_same() to check if two stax refer to the same mount 2022-09-20 13:52:01 +02:00
Lennart Poettering
2bd315fb2b stat-util: add statx_inode_same() helper to check if two statx structs refer to same inode
The same as stat_inode_same(), but for struct statx rather than struct
stat.
2022-09-20 13:52:01 +02:00
Lennart Poettering
d45dee7c00 chase-symlinks: don't insist on absolute paths if CHASE_PREFIX_ROOT is set
There's little reason to require this, given that we can just say that
if a relative path is specified it is to be read relative to the root.

This fixes a bootctl bug introduced by
3730dc5d5b which didn't bother prefixing
paths as necessary.
2022-09-20 13:52:01 +02:00
Yu Watanabe
f1d93b84bc mkdir: chase_symlinks_and_stat() does not return 0
This reverts commits e22916e61d and
1e146d7382.
2022-09-19 22:54:05 +09:00
Yu Watanabe
5b4671ec47 Merge pull request #24646 from yuwata/udev-node-symlink_atomic
udev: introduce symlink_atomic_full() and use it
2022-09-19 05:25:58 +09:00
Yu Watanabe
28f9bcd65a path-util: add examples for path_make_relative() and path_make_relative_parent()
Addresses https://github.com/systemd/systemd/pull/24646#discussion_r973691797.
2022-09-19 00:30:29 +09:00
Yu Watanabe
ee3455cf11 fd-util: rename CLOSE_AND_REPLACE() -> close_and_replace()
We have free_and_replace() and friends, they are all named with lower
letters, even they are macros, not functions.
For consistency, let's rename CLOSE_AND_REPLACE() with lower letters.

This also mekes the macro used more places.
2022-09-17 09:54:41 +02:00
Yu Watanabe
8dcc66cefc uid-range: tie up number and array of uid range entries
This renames UidRange -> UidRangeEntry, and reintroduces UidRange which
contains the array of UidRangeEntry and its size.
No fucntional changes, just refactoring.
2022-09-16 20:56:58 +09:00
Yu Watanabe
6cc6cd9289 uid-range: make uid_range_intersect() take two UidRange objects
No functional changes, just refactoring.
2022-09-16 20:52:47 +09:00
Yu Watanabe
f6c13f9f95 uid-range: optimize to load uid_map file
If uid_map contains many lines, then the previous logic takes O(n^2 log n),
This makes O(n log n).
2022-09-16 20:52:36 +09:00
Yu Watanabe
b5739767da uid-range: escape from loop earlier
The array of uid range entries are already sorted. Hence, if x and y are
does not have intersection, then the remaining entries neither have
intersection with x.
2022-09-16 20:50:00 +09:00
Yu Watanabe
34eeba475d uid-range: sort uid range entries in uid_range_coalesce()
As the logic in uid_range_coalesce() assumes the array of entries are
already sorted.
No functional changes, just refactoring.
2022-09-16 20:49:55 +09:00
Yu Watanabe
7cf337c50f uid-range: use parse_uid_range() 2022-09-16 20:48:53 +09:00
Yu Watanabe
590d81002b fs-util,label: introduce symlink_atomic_full() and symlink_atomic_full_label()
These new functions optionally create symlink of relative path.
2022-09-14 06:22:09 +09:00
Yu Watanabe
449375d2ad fs-util: use path_make_relative_parent() at one more place 2022-09-14 06:22:09 +09:00
David Tardon
995340074e tree-wide: use ASSERT_PTR more 2022-09-13 08:13:27 +02:00
Yu Watanabe
75a5a143bb Merge pull request #23043 from yuwata/udev-node-use-flock
udev-node: use flock() for symlink stack directory
2022-09-12 23:40:34 +09:00