Commit Graph

4782 Commits

Author SHA1 Message Date
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
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
Guillaume W. Bres
b3fe33ff52 basic/missing_loop.h: fix missing lo_flags LO_FLAGS_DIRECT_IO 2022-09-08 18:46:19 +01:00
Yu Watanabe
a30d3c0134 uid-range: move to src/basic/
To make the functions defined in the files usable by libsystemd library.
2022-09-08 11:08:43 +09:00
Yu Watanabe
6f2cea06bf Merge pull request #24467 from qdeslandes/nspawn_rootidmap
nspawn: add rootidmap as --bind option
2022-09-06 03:45:53 +09:00
Lennart Poettering
11a1ac5978 parse-util: make safe_atou8() just a wrapper around safe_atou8_full()
As in the previous commit: it's just a wrapper around the same
strtoul(), hence let's just share some more code.
2022-09-05 18:17:18 +02:00
Lennart Poettering
c74101200c parse-util: make safe_atou16_full() just a wrapper around safe_atou_full()
Both are fancy wrappers around strtoul() anyway, not more, hence let's
just make them a wrapper around each other, too, to simplify things a
lot.
2022-09-05 18:17:18 +02:00
Quentin Deslandes
1aa18710af nspawn: rename RemountIdmapFlags enum to RemountIdmapping
This enum should be used to define various idmapping modes for bind
mounts which might be incompatible. Changing its name and the values
name to reflect that.
2022-09-05 15:49:26 +01:00
Yu Watanabe
8ba24727c5 tmpfile-util: truncate original filename if the result filename is too long
This also verify that the extra string does not contain '/'.
2022-09-03 09:47:31 +09:00
Yu Watanabe
d4f60bdc11 path-util: introduce path_make_relative_parent() 2022-09-03 05:01:51 +09:00
Lennart Poettering
f1ee066840 log: don't attempt to duplicate closed fd
if the console fd is not open we shouldn#t try to move it out of the 0…2
range.

Fixes: #24535
Alternative-for: #24537
2022-09-03 03:06:18 +09:00
Johannes Schauer Marin Rodrigues
3fa8a1148a sysusers: make sp_lstchg shadow field reproducible
If the environment variable SOURCE_DATE_EPOCH is set, use its value
instead of the current time.
2022-09-02 07:17:25 +02:00
Lennart Poettering
6eeadaa141 path-util: return error if fnmatch() fails 2022-08-31 17:31:11 +02:00
Lennart Poettering
8812f8fc65 hashmap: add comment explaining that set_fnmatch() handles fnmatch() errors as non-matches 2022-08-31 15:13:42 +02:00
Jan Janssen
63b9838639 tree-wide: Mark some constants as unsigned
All these are really unsigned and used as such. This silences some
-Wformat-signedness warnings with gcc.
2022-08-30 12:03:33 +02:00
Yu Watanabe
69a20cc3e4 Merge pull request #23888 from topimiettinen/networkd-netlabel-v2
network: NetLabel integration
2022-08-30 07:30:49 +09:00
Lennart Poettering
bcfc0e8872 strv: modernize strv_fnmatch() a bit 2022-08-30 01:09:12 +09:00
Topi Miettinen
5b198025de sd-netlink: add NetLabel support 2022-08-29 14:23:17 +09:00
Topi Miettinen
3f36b9ed47 basic: generate netmasks for IPv6 and generic IP family addresses
Added functions to generate netmasks for IPv6 and generic IP family addresses.
2022-08-29 14:23:17 +09:00
Yu Watanabe
4492b5d804 devnum-util: split-out device_path_make_inaccessible() 2022-08-28 09:08:21 +09:00
Devendra Tewari
0f79b3469f systemd-growfs: use sd_device_new_from_devnum()
Use sd_device_new_from_devnum() instead of
device_path_make_major_minor_sysfs().
2022-08-26 20:33:03 +01:00
Yu Watanabe
72715f3d13 virt: fix alignment
Follow-up for f555830674.
2022-08-25 16:23:05 +00:00
Devendra Tewari
aa181897cf systemd-growfs: remove dependency on udev symlinks
systemd-growfs currently requires that udev ran first to work (because
/dev/block/ symlinks must exist) but that is not what happens when
we're not using initrd and systemd is PID1.
2022-08-24 21:42:16 +01:00
Lennart Poettering
782c6e5c90 time-util: fix overflow condition in usec_sub_signed()
If the delta specified is INT64_MIN, and we negate that we'd end up at
INT64_MAX+1 which is outside of the int64_t type. Hence let's treat this
case specifically to avoid unintended overflows.
2022-08-24 21:41:40 +01:00
Richard Phibel
34683dbdd0 journald: use rate-limited logging to log 'Failed to write entry' message 2022-08-24 21:39:20 +01:00
Luca Boccassi
298b3de6d4 Merge pull request #24370 from keszybz/sysusers-equivs
Use /bin/bash for root shell and suppress some warnings from sysusers
2022-08-24 21:35:28 +01:00
Zbigniew Jędrzejewski-Szmek
8795d9bacd basic/user-util: rename output param to ret, shorten code 2022-08-24 10:02:46 +02:00