Commit Graph

39486 Commits

Author SHA1 Message Date
Lennart Poettering
15e2182fb3 mkdir: don't allow us to get confused by symlinks in mkdir_p_root()'s chowning logic 2022-08-23 15:10:15 +02:00
Lennart Poettering
c06103be64 bless-boot: remove a bunch of 'else' 2022-08-23 15:10:15 +02:00
Lennart Poettering
e08c10a424 path-util: drop the now unused dirname_malloc() 2022-08-23 15:10:15 +02:00
Lennart Poettering
45519d13a4 tree-wide: port things dirname_malloc() → path_extract_directory() 2022-08-23 15:10:15 +02:00
Luca Boccassi
712e0b4792 Merge pull request #23893 from yuwata/core-mount-re-read-mountinfo
core/mount: adjust deserialized state based on if the corresponding mountinfo entry exists or not
2022-08-23 12:46:39 +01:00
eggfly
6b5e82408d fix typos 2022-08-23 10:53:47 +02:00
jiangchuangang
9ed999cb5d fix typo 2022-08-23 09:23:49 +02:00
Goffredo Baroncelli
046f101bf6 Allow uneven length BootXXXX variables
The BootXXXX variables may have an uneven length. Don't return error
in this case.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
2022-08-23 07:22:46 +02:00
Lennart Poettering
81a7eac1f7 chase-symlinks: refuse more chase_symlink() flags in the open/stat flavours
These flags make no sense when we try to access the final inode, hence
refuse.
2022-08-22 19:25:00 +01:00
Lennart Poettering
127b72da2b measure: add --current switch for "systemd-measure calculate"
This allows allows shortcutting measurements of the specified files and
use the information from /sys/ instead.

This is not too useful on its own given that "systemd-measure status"
already exists which displays the current, relevant PCR values. The main
difference is how "complete" the information is. "status" will detect if
the measurements make any sense, and show more than PCR 11. "calculate
--current" otoh only reads PCR 11 and uses that, and that's really it.

This is mainly preparation for later work to add PCR signing to the
tool, where usually it makes most sense to sign prepared kernel images,
but for testing it's really useful to shortcut signing to the current
PCR values instead
2022-08-22 19:17:18 +01:00
Lennart Poettering
8e7e4a730b tree-wide: use path_join() instead of prefix_roota() in various cases
prefix_roota() is something we should stop using. It is bad for three
reasons:

1. As it names suggests it's supposed to be used when working relative
   to some root directory, but given it doesn't follow symlinks (and
   instead just stupidly joins paths) it is not a good choice for that.

2. More often than not it is currently used with inputs under control of
   the user, and that is icky given it typically allocates memory on the
   stack.

3. It's a redundant interface, where chase_symlinks() and path_join()
   already exist as better, safer interfaces.

Hence, let's start moving things from prefix_roota() to path_join() for
the cases where that's appropriate.
2022-08-22 19:15:29 +01:00
Lennart Poettering
8ef6106de4 Merge pull request #24392 from poettering/chase-symlinks-more-stuff
some tweaks to chase_symlinks() and port some code from prefix_roota() over
2022-08-22 18:41:14 +02:00
Yu Watanabe
2b21522e82 test: merge test-repart.sh and TEST-58-REPART 2022-08-22 17:00:38 +02:00
Yu Watanabe
655eb07391 gpt: fix alignment 2022-08-22 17:00:38 +02:00
Yu Watanabe
4565246911 gpt: fix native uuids for s390x
__s390__ is defined for both s390 and s390x. Hence, we need to define
the native uuids for s390x at first.
2022-08-22 17:00:38 +02:00
Yu Watanabe
400e3d21f8 udev: fix inversed inequality for timeout of retrying event
Follow-up for 5d354e525a.
2022-08-22 17:00:38 +02:00
Yu Watanabe
695cfd53fe repart: drop doubled space 2022-08-22 17:00:38 +02:00
Antonio Alvarez Feijoo
782e41ab88 sysext: add missing COMMAND to the help output and man synopsis 2022-08-22 15:41:12 +01:00
Luca Boccassi
d4001c518a Merge pull request #24385 from yuwata/hostname-chassis
hostname: fix fallback chassis type
2022-08-22 15:40:38 +01:00
Lennart Poettering
1d1c226f6c conf-files: port conf_files_list() over to chase_symlinks() from prefix_roota() 2022-08-22 14:08:48 +02:00
Lennart Poettering
3730dc5d5b bootctl: port some more code over to chase_symlinks() from prefix_roota()
This is far from complete, but let's start moving this way.
2022-08-22 14:07:45 +02:00
Lennart Poettering
2b2caea21d chase-symlinks: add chase_symlinks_and_access() helper
This is similar to chase_symlinks_and_access() but wraps access() rather
than stat()
2022-08-22 13:40:13 +02:00
Lennart Poettering
37b9bc56fc chase-symlinks: fix shortcut condition 2022-08-22 13:40:13 +02:00
Lennart Poettering
6957023208 chase-symlinks: honour CHASE_NOFOLLOW flag properly in some cases 2022-08-22 13:40:13 +02:00
jiangchuangang
e3a4724db2 take jointly mounted controllers into account when migrate cgroups, otherwise "CGroupMask done" seems to be redundant. 2022-08-22 14:21:31 +09:00