Commit Graph
63811 Commits
Author SHA1 Message Date
Daan De Meyer 73c43e96e7 Merge pull request #27186 from yuwata/os-release
os-util: several cleanups and introduce _at() variants of os-release parsers
2023-04-11 14:54:56 +02:00
Zbigniew Jędrzejewski-Szmek ba5a469648 Merge pull request #27169 from yuwata/udev-rule-refuse-unsafe-path
sd-device,udev: refuse unsafe path in SYMLINK= and TAG=
2023-04-11 14:43:50 +02:00
Yu Watanabe 19db450f3a hwdb: fix ambiguous glob pattern for Lenovo machines
Fixes #27195.

Follow-up for a5c0ad9a9a.
2023-04-11 13:21:34 +02:00
Yu Watanabe 538d878dbd os-util: introduce several _at() variants of os-release parsers 2023-04-11 18:49:45 +09:00
Yu Watanabe 5cf69e709e os-util: make $SYSTEMD_OS_RELEASE prefixed with the root directory
To make it consistent with other env vars, e.g. $SYSTEMD_ESP_PATH or
$SYSTEMD_XBOOTLDR_PATH.

This is useful when the root is specified by a file descriptor, instead
of a path.
2023-04-11 18:49:23 +09:00
Yu Watanabe f4a1d32c82 os-util: merge parse_{extension,os}_release() 2023-04-11 18:49:23 +09:00
Yu Watanabe 7ef43c78df os-util: invert order of arguments in extension release parser
For consistency with other functions.
Unfortunately, va_start() requires that the previous argument is a
pointer, hence the order of the arguments in the internal function
cannot be changed.
2023-04-11 18:49:23 +09:00
Yu Watanabe 61acfd8311 os-util: shorten temporal variable names
No functional change, just refactoring.
2023-04-11 18:49:20 +09:00
Yu Watanabe 59c4707594 os-util: log one more error cause 2023-04-11 18:48:58 +09:00
Yu Watanabe c9d64f8a2c os-util: do not use 'r' for storing loop status
The variable 'r' is usually used for storing return value of functional
call. Let's introduce another boolean to store the current loop status.

No functional change, just refactoring.
2023-04-11 18:48:58 +09:00
Yu Watanabe 7421f20c7e os-util: return earlier when unsupported image class is specified 2023-04-11 18:47:15 +09:00
Yu Watanabe 7213c75045 os-util: return earlier when extension release file is found
No functional change, just refactoring.
2023-04-11 18:44:50 +09:00
Yu Watanabe a84677e0f4 os-util: split-out open_os_release() from open_extension_release()
The logics of opening os-release and extension-release are completely
different.
No functional change, just refactoring.
2023-04-11 18:44:50 +09:00
Yu Watanabe 6f0f4d1488 os-util: fix fd leak on failure 2023-04-11 18:44:50 +09:00
Yu Watanabe 396ec9587c os-util: make open_extension_release() return O_PATH fd 2023-04-11 18:44:50 +09:00
Yu Watanabe 53cbf5f9a6 os-util: drop fopen_extension_release() 2023-04-11 18:44:50 +09:00
Yu Watanabe bfeaa62dbc compress: replace compress_blob() with compress_blob_explicit()
And make compress_xyz() return 0 on success, as we know which compression
algorithm is used when calling compress_blob().

Follow-up for 2360352ef0.
2023-04-11 09:14:34 +02:00
Daan De Meyer 7cb9ed5d38 Merge pull request #27206 from yuwata/udev-rename
udev: rename arguments and options, update comments
2023-04-11 09:12:21 +02:00
Yu Watanabe 0d68cd72b6 chase: drop redundant call of delete_trailing_chars()
In that branch, 'root' is a non-root and absolute path.
Hence, delete_trailing_chars() does not make the path empty.
And, if the path contains redundant slashes at the end, that will be
dropped by path_simplify().
2023-04-11 09:06:05 +02:00
Yu Watanabe 0f9aca9a98 Merge pull request #27207 from masatake/busctl--help-msg
busctl: add --xml-interface to the help message
2023-04-11 14:42:27 +09:00
Yu Watanabe c689c541a1 Merge pull request #27201 from yuwata/o-path-support
Support O_PATH more
2023-04-11 12:37:37 +09:00
Colin Walters 4e1ac54e1c tree-wide: A few more uses of "unmet" for conditions
This is a followup to
413e8650b7
> tree-wide: Use "unmet" for condition checks, not "failed"

Since I noticed when running `systemctl status` on a recent
systemd still seeing
`Condition: start condition failed`

To recap the original rationale here for "unmet" is that it's
normal for some units to be conditional, so the term "failure"
here is too strong.
2023-04-11 12:36:53 +09:00
Yu Watanabe 2653ded4d1 Merge pull request #27199 from yuwata/find-esp
path-util: introduce path_prefix_root_cwd(), and use it in find_esp() and friends
2023-04-11 12:36:13 +09:00
Yu Watanabe 562f22dbfc Merge pull request #27202 from yuwata/os-release-tiny-cleanups
os-util: tiny cleanups
2023-04-11 12:35:34 +09:00
Yu Watanabe 06692fdb5b env-file: introduce parse_env_file_fdv() 2023-04-11 12:33:14 +09:00
Masatake YAMATO a5efb0cc2b shell-completion: add --xml-interface option of busctl to the rules
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2023-04-11 11:47:56 +09:00
Masatake YAMATO c39b8978f6 busctl: add --xml-interface to the help message
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2023-04-11 11:45:26 +09:00
Yu Watanabe fb4d9bf47f find-esp: use path_prefix_root_cwd()
Unlikely, but even if find_esp() or friends called with unnormalized or
relative 'root', let's make the result path normalized and absolute.

Note, before 63105f33ed, these functions
returned an absolute and normalized path. But the commit made the result
path simply concatenated with root.

Follow-up for 63105f33ed.
2023-04-11 06:27:11 +09:00
Yu Watanabe 75cc8d7c42 path-util: introduce path_prefix_root_cwd() 2023-04-11 06:27:05 +09:00
Yu Watanabe adc5b9823c test: update description 2023-04-11 06:07:15 +09:00
Yu Watanabe 6fdc9fbc0f udev/scsi_id: rename positional arguments 2023-04-11 06:07:03 +09:00
Yu Watanabe 8352a29b6d device-nodes: rename argument 2023-04-11 05:53:58 +09:00
Yu Watanabe 8c14d828d4 os-util: drop redundant declaration of load_os_release_pairs() 2023-04-11 05:20:15 +09:00
Yu Watanabe d67071d2f6 os-util: use _IMAGE_CLASS_INVALID
When extension is not specified, image class is not necessary to be
specified. Let's use _IMAGE_CLASS_INVALID as an indicator that no
extension is specified.
2023-04-11 05:20:15 +09:00
Yu Watanabe c2cd950817 os-util: move declaration of string table lookup for image class 2023-04-11 05:20:15 +09:00
Yu Watanabe fe008489f7 portable: always reopen fd of release file
To make it support the case that the fd is O_PATH.
2023-04-11 05:17:52 +09:00
Yu Watanabe e63d070373 copy: make copy_bytes() support O_PATH fds 2023-04-11 05:17:10 +09:00
Luca Boccassi 1dec1c6163 Merge pull request #27182 from mrc0mmand/test-tweaks
test: a couple of stability tweaks
2023-04-10 18:42:34 +01:00
Daan De Meyer 25d598e144 Merge pull request #27184 from yuwata/xfopenat-full
fileio: introduce xfopenat_full()
2023-04-10 11:50:34 +02:00
Дамјан Георгиевски 7b411cf842 ci: add permissions to make a release
follow-up to https://github.com/systemd/systemd/pull/27071
in order to create Github Releases, the job needs permissions to write
contents

also:
- pinned the `softprops/action-gh-release` action to a specific commit
- made it only active on the `systemd` organization repos (so not on
  forks)
2023-04-10 17:23:32 +08:00
Mike Yuan 17409d8488 Merge pull request #27193 from yuwata/analyze-blame
analyze: make 'blame' work even the default target not reached
2023-04-10 17:19:11 +08:00
Daan De Meyer 4fbad6ff05 Merge pull request #27194 from yuwata/chase-cleanups
chase: several cleanups
2023-04-10 07:52:04 +02:00
Yu Watanabe b4cb4c5cc6 fd-util: slightly optimize dir_fd_is_root()
When STATX_MNT_ID is not supported, we need to manually obtain mount id.
Let's compare inodes earlier.
2023-04-10 10:04:46 +09:00
Yu Watanabe a6ef5ef707 chase: use dir_fd_is_root() to check if fd points to the root directory
As commented in dir_fd_is_root(), comparing inode is not enough to
determine if we are at the root directory.
2023-04-10 09:55:29 +09:00
Yu Watanabe 4443e3003a chase: use stat_inode_same() at one more place 2023-04-10 09:45:21 +09:00
Yu Watanabe de68bf7896 test: add tests about iterator position for path_find_{first,last}_component()
When path_find_first_component() returns the last component, the iterator
must be an empty string. The fact is heavily used in chaseat(). Let's
explicitly test it.
2023-04-10 09:39:14 +09:00
Yu Watanabe 3a7ba9f6b9 path-util: make iterator for path_find_last_component() always finish with the beginning of the buffer 2023-04-10 09:30:14 +09:00
Yu Watanabe a0d3e0ec79 chase: extend comment about CHASE_PARENT 2023-04-10 08:57:01 +09:00
Yu Watanabe 75adfc3b17 chase: drop one redundant call of fstat()
Now, 'st' is always synced with 'fd'. Hence, we can use
stat_verify_directory().
2023-04-10 08:43:31 +09:00
Yu Watanabe ad66c7f1d3 chase: make struct stat always sync with the opened fd
Previously, struct stat may not be correctly synced with the currently
opened fd, e.g. when a path contains symlink which points to an absolute
path.

This also rename variables for struct stat, to make them consistent with
the corresponding fd.
2023-04-10 08:40:14 +09:00