Commit Graph
69743 Commits
Author SHA1 Message Date
Yu Watanabe d05649ca7d resolve: add several comments for DNS type table
Also update compile time checks.

Follow-up for 818bb6f482.
2023-12-31 04:51:42 +09:00
Yu Watanabe e6bca18296 Merge pull request #30658 from jnohlgard/udevadm-lock-return-code
udevadm: Propagate return code from verb result
2023-12-31 04:51:09 +09:00
Yu Watanabe 13a30c6dc4 test: add simple coverage tests for 'udevadm lock' 2023-12-30 05:28:04 +09:00
Joakim NohlgårdandYu Watanabe ba340e2a75 udevadm: Propagate return code from verb result
udevadm lock did not propagate the return code from the child process
because all positive values were treated as success.

v2:
Now 'udevadm test-builtin' ignores all positive return values from the
builtin commands. Otherwise, as the hwdb builtin returns an positive value
when a matching entry found, 'udevadm test-builtin hwdb' will fail.

v3:
Initialize partition table before calling 'sfdisk --delete'.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2023-12-30 05:26:59 +09:00
Mike Yuan 6b9cac874c fd-util: don't eat up errors in fd_cloexec_many
Follow-up for ed18c22c98

Before this commit, a successful fd_cloexec() call would
discard all previously gathered errors.
2023-12-29 14:26:40 +01:00
Yu Watanabe 5b201ffb1e sd-journal: check sd-event state before setting up post change timer
The similar check already exists in schedule_post_change().

The function is currently called at two places.
- journal_file_open() in sd-journal:
  In this case, if the timer is not set up, then journal_file_post_change()
  will be called at the end of journal_file_append_entry(). So, the necessary
  task will be done sequentially when an journal entry is stored to the opened
  journal file. That is desired when the function is called at outside of the
  event loop.
- server_open_journal() in journald:
  This is not called after we exit the event loop.

So, we can safely do nothing in the function if the event loop is being
finished or already finished.

Fixes #30644.
2023-12-29 06:39:06 +09:00
Yu Watanabe 0802e9d8de coccinelle: re-indent comments 2023-12-29 04:14:55 +09:00
Yu Watanabe a1ccd5eed8 coccinelle: fix typo
Follow-up for b25d3b36a2.
2023-12-29 04:13:45 +09:00
Ronan Pigott 818bb6f482 dns: update record type enum to match iana
Adds some new dns record types. Also, some types were inserted into the
middle of the enum — this corrects an error where the enum constants for
some of the record types previously held an incorrect value.
2023-12-29 04:08:41 +09:00
Yu Watanabe 568fd8a63b Merge pull request #30649 from YHNdnzj/close-nointr-unnecessary
Some modernization/cleanup for fd-util
2023-12-29 04:03:15 +09:00
Luca Boccassi aa735b0219 units: add ConditionSecurity=tpm2 to systemd-tpm2-setup units
ConditionSecurity=measured-uki can be true even with TPM 1.2 which we
don't support, so add an explicit check for TPM 2.0.

Fixes https://github.com/systemd/systemd/issues/30650

Follow-up for 2e64cb71b9
2023-12-29 03:14:34 +09:00
A S Alam c6dcd70a37 po: Translated using Weblate (Punjabi)
Currently translated at 26.4% (60 of 227 strings)

Co-authored-by: A S Alam <aalam@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pa/
Translation: systemd/main
2023-12-28 16:32:36 +00:00
Mike Yuan da6c52c57c various: don't use close_nointr if retval is not checked anyway 2023-12-28 20:44:01 +08:00
Mike Yuan 1189815a6b logind-session-device: use _cleanup_close_ 2023-12-28 20:43:42 +08:00
Mike Yuan 3760416ee8 shared/async: use safe_close where appropriate 2023-12-28 18:26:52 +08:00
Mike Yuan 1cbd441b09 fdset: use FOREACH_ARRAY at one more place 2023-12-28 18:26:52 +08:00
Mike Yuan 1276e63370 fd-util: modernization 2023-12-28 18:26:52 +08:00
Chris Simons 9ef362bf3d machinectl: add restart convenience alias (#30625) 2023-12-28 07:09:42 +09:00
Yu Watanabe 1a4b0459f6 network/address: unconditionally check if address is ready
Previously, we checked if the address is ready only when it is an IPv6
address. But, IPv4 address never enter tentative state, hence the check
for an IPv4 address is effectively equivalent to the one for IPv6.
So, let's unify the check. This does not change any effective behavior.
2023-12-28 07:08:37 +09:00
Yu Watanabe 3a30d81238 Merge pull request #30643 from bluca/completion
bash completion additions for systemctl/systemd-analyze
2023-12-28 04:10:20 +09:00
Yu Watanabe 9e7cd6bed1 Merge pull request #30641 from YHNdnzj/hibernation-device
Follow-ups for hibernate-util
2023-12-28 04:09:55 +09:00
Yu Watanabe f1f494f3f8 Merge pull request #30634 from dtardon/docbook-valid-3
DocBook validation fixes (part 3)
2023-12-28 04:06:57 +09:00
Luca Boccassi cfb912abaf bash completion: add systemd-analyze architectures
Follow-up for fb8cc599ed
2023-12-27 17:52:06 +01:00
Luca Boccassi 5df839e99f analyze: allow --no-legend with architectures verb
It prints a table with a header, allow omitting it

Follow-up for fb8cc599ed
2023-12-27 17:50:07 +01:00
Luca Boccassi c24c63e946 bash completion: make systemctl mount-image/bind autocomplete on active services
The verb works only on running service units, so complete on that as the first
parameter, and a local file as the second. The other parameters are inside the
service namespace so we can't autocomplete from the outside, return early.
2023-12-27 17:48:05 +01:00
Luca Boccassi 79272d3098 bash completion: add systemctl service-log-level/target 2023-12-27 16:59:03 +01:00
Mike Yuan fe33920c2a sleep: don't log duplicate error
write_resume_config() logs error on its own.
2023-12-27 22:38:43 +08:00
Mike Yuan 6e819bd2bd hibernate-util: remove unused code
All callers of write_resume_config() pass non-NULL device.
2023-12-27 22:38:42 +08:00
Mike Yuan 66b9956082 hibernate-util: make sure we use blockdev path for HibernationDevice.path
Before this commit, this field could spuriously contain the path of the
swapfile.
2023-12-27 22:38:42 +08:00
Yu Watanabe 51dfa75c6e Merge pull request #30639 from mrc0mmand/more-cocci-shenanigans
Another batch of Coccinelle tweaks
2023-12-27 20:33:46 +09:00
Frantisek Sumsal 321e64dc67 tpm2-util: declare the cleanup attribute first
As we do everywhere else (apart from it being incosistent, the switched
order also makes Coccinelle unhappy).
2023-12-27 11:15:48 +01:00
Frantisek Sumsal 8f07111aa8 bootctl: add a missing space 2023-12-27 11:15:48 +01:00
Frantisek Sumsal b8e0dd3939 test: use timestamp_is_set() 2023-12-27 11:15:48 +01:00
Frantisek Sumsal cfae9ec203 test: use set_isempty() in one more place 2023-12-27 11:15:48 +01:00
Frantisek Sumsal 6f8b3838c9 test: use IN_SET()/ERRNO_IS_NEG_*() more 2023-12-27 11:15:48 +01:00
Frantisek Sumsal c83f4220a1 tree-wide: use IN_SET() more 2023-12-27 11:15:48 +01:00
Frantisek Sumsal c633361f06 coccinelle: dial back warnings about performance
Turns out I _really_ underestimated the impact of
--include-headers-for-types, as it significantly reduces both runtime
and storage penalties. For example, on my machine the runtime of
uncached run goes down from ~15 minutes to ~2 minutes, and similarly the
total storage needed by the cache goes from ~15 GiB down to ~3 GiB.
2023-12-27 11:15:48 +01:00
Frantisek Sumsal b25d3b36a2 coccinelle: help Coccinelle with some more complex macros
Drop the original macro file, since it's not needed anymore thanks to
resolving includes properly, but introduce a similar file -
parsing_hacks.h - that helps Coccinelle in some specific corner cases.

This eliminates most of the outstanding parsing errors in source files.
The remaining ones are limitations of the parsing engine (see the FIXMEs
in pasing_hacks.h) and need further investigation.
2023-12-27 11:15:48 +01:00
Frantisek Sumsal 11959eb201 coccinelle: search the system include path for header files as well
Since Coccinelle is originally a kernel tool, it doesn't search the
system include path by default for header files. Without this we're
missing a lot of types provides by stdlib (and other libraries we make
use of).
2023-12-27 11:15:44 +01:00
Luca Boccassi 74ce6bbdee Merge pull request #30631 from yuwata/network-address-free
network/address: tiny cleanups for address_free()
2023-12-26 19:21:15 +01:00
Mike Yuan e14348c616 sleep: connect to correct bus when locking homed-managed homes
Partially reverts 122f6f1eaa

Fixes https://github.com/systemd/systemd/issues/29938#issuecomment-1869508708
2023-12-26 18:53:03 +01:00
David Tardon af29d0b179 man: rewrite as <group> 2023-12-26 13:10:36 +01:00
David Tardon 0fd5f9fb50 man: fix markup
<arg> is not allowed inside <title>.
2023-12-26 13:10:36 +01:00
David Tardon 7f9d96d4c5 man: move </variablelist> to the right place 2023-12-26 13:10:35 +01:00
David Tardon b239fc7250 man: fix <cmdsynopsis> content
Inline text is not allowed.
2023-12-26 13:10:35 +01:00
David Tardon 20dcd73a28 man: fix markup
<option> is not allowed in <cmdsynopsis>.
2023-12-26 13:10:35 +01:00
David Tardon dfa6c32ad9 man: restrict <command> to the actual command 2023-12-26 13:10:35 +01:00
David Tardon 996de3397b man: move macro decls. out of <funcsynopsis>
<funcsynopsis> doesn't allow block content.
2023-12-26 13:10:35 +01:00
David Tardon 932abebf4d man: fix markup
<arg> is not allowed inside <term>.
2023-12-26 13:10:35 +01:00
Frantisek Sumsal 4d3510d00f coccinelle: explicitly undefine SD_BOOT
So Coccinelle doesn't pull in includes guarded by #if SD_BOOT.

For example:

$ head -n5 main.c
 #if FOO
 #include "foo.h"
 #else
 #include "bar.h"
 #endif

$ spatch --verbose-includes --recursive-includes --sp-file zz-drop-braces.cocci main.c
init_defs_builtins: /usr/lib64/coccinelle/standard.h
HANDLING: main.c
including ./foo.h
including ./bar.h

$ spatch --verbose-includes --recursive-includes --sp-file zz-drop-braces.cocci main.c --undefined FOO
init_defs_builtins: /usr/lib64/coccinelle/standard.h
HANDLING: main.c
including ./bar.h
2023-12-26 11:23:19 +01:00