Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 10:14:01 +0000 (06:14 -0400)]
partition, random-seed, logind: fix log messages with %m
We would print "...: Success", which is not too terrible, but not pretty
either.
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 09:54:17 +0000 (05:54 -0400)]
sd-device: improve log message and tweak style
We shouldn't say the attribute is missing right after ruling out ENOENT.
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 08:55:09 +0000 (04:55 -0400)]
libsystemd-network: fix dhcp option buffer confusion
We were writing to the wrong buffer with a wrong offset :(
Bug present since the original introduction of the code in
04b28be1a306fd2ba454d3ee333d63df71aa3873.
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 11:17:22 +0000 (13:17 +0200)]
meson: simplify the BUILD_MODE conditional
Using a enum is all nice and generic, but at this point it seems unlikely that
we'll add further build modes. But having an enum means that we need to include
the header file with the enumeration whenerever the conditional is used. I want
to use the conditional in log.h, which makes it hard to avoid circular imports.
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 12:42:39 +0000 (14:42 +0200)]
bpf-devices: update comment
Luca Boccassi [Mon, 12 Apr 2021 22:10:21 +0000 (23:10 +0100)]
tree-wide: avoid uninitialized warning on _cleanup_ variables
With some versions of the compiler, the _cleanup_ attr makes it think
the variable might be freed/closed when uninitialized, even though it
cannot happen. The added cost is small enough to be worth the benefit,
and optimized builds will help reduce it even further.
Luca Boccassi [Tue, 13 Apr 2021 19:03:39 +0000 (20:03 +0100)]
meson: build tests with -Wno-maybe-uninitialized if -O2/-flto are used
We intentionally do not inline initializations with definitions for
a bunch of _cleanup_ variables in tests, to ensure valgrind is triggered.
This triggers a lot of maybe-uninitialized false positives when -O2 and
-flto are used. Suppress them.
Luca Boccassi [Tue, 13 Apr 2021 12:17:53 +0000 (13:17 +0100)]
rfkill: add some casts to silence -Werror=sign-compare
gaoyi [Tue, 13 Apr 2021 10:59:46 +0000 (18:59 +0800)]
udev: delete useless codes
It seems no one will touch queue.bin
Yegor Alexeyev [Tue, 9 Mar 2021 11:57:37 +0000 (14:57 +0300)]
dhcp: Implemented BindToInterface= configuration option
Luca Boccassi [Tue, 13 Apr 2021 08:44:33 +0000 (09:44 +0100)]
Merge pull request #19303 from yuwata/fix-typo
tree-wide: fix typo
Yu Watanabe [Tue, 13 Apr 2021 03:53:32 +0000 (12:53 +0900)]
tree-wide: update comment about unnecessary initialization
Yu Watanabe [Tue, 13 Apr 2021 03:52:56 +0000 (12:52 +0900)]
man: fix typo
Francois Gervais [Mon, 12 Apr 2021 22:25:29 +0000 (18:25 -0400)]
load-fragment: parse specifiers in CPUAffinity= (#19281)
Zbigniew Jędrzejewski-Szmek [Mon, 12 Apr 2021 12:03:32 +0000 (14:03 +0200)]
meson: do not fail if rsync is not installed with meson 0.57.2
https://github.com/mesonbuild/meson/issues/8641
Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
Frantisek Sumsal [Mon, 12 Apr 2021 15:56:33 +0000 (17:56 +0200)]
packit: drop the 'sources' file after cloning the Fedora repo
Otherwise rebase-helper thinks we're are a dist-git repository,
replacing the generated git archive with PR changes with the tarball
found in the 'sources' file.
Lennart Poettering [Mon, 12 Apr 2021 15:53:38 +0000 (17:53 +0200)]
Merge pull request #18701 from bugaevc/mdns-unicast
resolved: reply using unicast mDNS when appropriate
Zbigniew Jędrzejewski-Szmek [Mon, 12 Apr 2021 12:31:42 +0000 (14:31 +0200)]
Merge pull request #13496 from wat-ze-hex/custom-bpf-progs-parameterized-3
bpf: extend bpf cgroup program support
gaoyi [Mon, 12 Apr 2021 08:09:47 +0000 (16:09 +0800)]
man: fix discriptions for --exec-delay
There are two ambiguity in the original description:
1. It will delay all RUN instructions, include builtin.
2. It will delay before running RUN, not each of RUN{program} instructions.
Yu Watanabe [Sun, 11 Apr 2021 08:54:50 +0000 (17:54 +0900)]
sd-dhcp-client: constify argument in sd_dhcp_lease_get_xxx()
Yu Watanabe [Sun, 11 Apr 2021 15:56:01 +0000 (00:56 +0900)]
networkctl: drop unused variables
Luca Boccassi [Fri, 9 Apr 2021 09:56:13 +0000 (10:56 +0100)]
test-repart: use cryptsetup and losetup autoclose
The test occasionally fails as the umount is not yet completed when
cryptsetup close is invoked.
Both cryptsetup and losetup have supported deferred cleanup for some
time now, so use it instead to avoid races.
++ losetup -P --show --find /tmp/test-repart.dMOfYQ8UUF/zzz
+ LOOP=/dev/loop6
+ VOLUME=test-repart-11882
+ touch /tmp/test-repart.dMOfYQ8UUF/empty-password
+ cryptsetup open --type=luks2 --key-file=/tmp/test-repart.dMOfYQ8UUF/empty*** test-repart-11882
+ mkdir /tmp/test-repart.dMOfYQ8UUF/mount
+ mount -t ext4 /dev/mapper/test-repart-11882 /tmp/test-repart.dMOfYQ8UUF/mount
+ diff -r /tmp/test-repart.dMOfYQ8UUF/mount/def /tmp/test-repart.dMOfYQ8UUF/definitions
+ umount /tmp/test-repart.dMOfYQ8UUF/mount
+ cryptsetup close test-repart-11882
Device test-repart-11882 is still in use.
+ rm -rf /tmp/test-repart.dMOfYQ8UUF
Luca Boccassi [Fri, 9 Apr 2021 16:55:57 +0000 (17:55 +0100)]
scsi_id: use read_line instead of fgets
LGTM warns about it:
"Call to fgets() is potentially dangerous. Use read_line() instead."
Yu Watanabe [Sun, 11 Apr 2021 07:46:25 +0000 (16:46 +0900)]
Merge pull request #19164 from mmatsuya/main
tmpfiles: use a entry in hashmap as ItemArray in read_config_file()
Luca Boccassi [Sat, 10 Apr 2021 19:13:02 +0000 (20:13 +0100)]
mkosi.arch: add rsync build dependency
Program rsync found: NO
man/meson.build:187:0: ERROR: Program 'rsync' not found
Oleg Popov [Sat, 10 Apr 2021 14:21:25 +0000 (17:21 +0300)]
Extend characters set for PKCS11 URI
There are tokens with dots (and other symbols) in PKCS11 URI:
pkcs11:model=Rutoken%20ECP;manufacturer=Aktiv%20Co.;serial=3xxxxxxb;token=livelace
pkcs11:model=PRO;manufacturer=Aladdin%20R.D.;serial=
CC62FB25;token=val%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00;id=%33%32%31%30%33%61%36%37%36%65%32%34%35%62%32%31;type=private
Yu Watanabe [Sat, 10 Apr 2021 04:37:35 +0000 (13:37 +0900)]
network: refuse to configure NDISC twice
Lennart Poettering [Sat, 10 Apr 2021 12:58:54 +0000 (14:58 +0200)]
resolved: add RFC 8375 "home.arpa" to list of default NTA
RFC 8375 introduced "home.arpa" as special TLD for home networks. Let's
hence add it to our default list of NTAs.
Lennart Poettering [Sat, 10 Apr 2021 12:59:40 +0000 (14:59 +0200)]
openssl: make RSA struct const
OpenSSL 3.0 broke API there, but it doesn't hurt to add the "const",
hence add it.
Fixes: #19267
Yu Watanabe [Sat, 10 Apr 2021 04:31:08 +0000 (13:31 +0900)]
sd-dhcp6-client: do not use IN_SET() macro when only one target value
Yu Watanabe [Sat, 10 Apr 2021 04:28:11 +0000 (13:28 +0900)]
network: adjust log message
Yu Watanabe [Fri, 9 Apr 2021 10:53:40 +0000 (19:53 +0900)]
network: drop unnecessary bitfield specifier
Manager is allocated only once. It is not necessary to optimize its
size.
Anita Zhang [Sat, 10 Apr 2021 07:50:50 +0000 (00:50 -0700)]
units: install dbus-org.freedesktop.oom1.service alias
Fixes: #18469
Julia Kartseva [Tue, 22 Dec 2020 17:27:14 +0000 (09:27 -0800)]
fuzz: add BPFProgram= to directives
Julia Kartseva [Wed, 9 Dec 2020 06:07:30 +0000 (22:07 -0800)]
dbus-cgroup: add BPFProgram= dbus support
- Handle BPFProgram= property in string format
"<bpf_attach_type>:<bpffs_path>", e.g. egress:/sys/fs/bpf/egress-hook.
- Add dbus getter to list foreign bpf programs attached to a cgroup.
Julia Kartseva [Wed, 9 Dec 2020 06:06:56 +0000 (22:06 -0800)]
man: add BPFProgram= documentation
Julia Kartseva [Wed, 4 Sep 2019 02:08:13 +0000 (19:08 -0700)]
tests: add unit file tests for BPFProgram=
- Pin trivial bpf programs to bpf filesystem, compose BPFProgram= option
string and pass it to a unit. Programs store `0` in r0 BPF register for
denying action, e.g. drop a packet.
- Load trivial BPF programs
- Test is skipped if not run under root or if can not lock enough
memory.
- For egress and ingress hooks, test BPFProgram= option along with
with IP{Egress|Ingress}FilterPath=, expected result should not depend on
which rule is executed first.
Expected results for BPF_CGROUP_INET_INGRESS:
5 packets transmitted, 0 received, 100% packet loss, time 89ms
For BPF_CGROUP_INET_SOCK_CREATE:
ping: socket: Operation not permitted
Julia Kartseva [Thu, 4 Feb 2021 08:04:19 +0000 (00:04 -0800)]
core: add bpf-foreign to fragment parser
- Parse a string for bpf attach type
- Simplify bpffs path
- Add foreign bpf program to cgroup context
Julia Kartseva [Thu, 4 Feb 2021 08:03:08 +0000 (00:03 -0800)]
core: add bpf-foreign cgroup mask and harness
Add CGROUP_MASK_BPF_FOREIGN to CGROUP_MASK_BPF and standard cgroup
context harness.
Julia Kartseva [Wed, 16 Sep 2020 22:58:04 +0000 (15:58 -0700)]
core: add bpf-foreign unit helpers
- Introduce support of cgroup-bpf programs managed (i.e. compiled,
loaded to and unloaded from kernel) externally. Systemd is only
responsible for attaching programs to unit cgroup hence the name
'foreign'.
Foreign BPF programs are identified by bpf program ID and attach type.
systemd:
- Gets kernel FD of BPF program;
- Makes a unique identifier of BPF program from BPF attach type and
program ID. Same program IDs mean the same program, i.e the same
chunk of kernel memory. Even if the same program is passed multiple
times, identical (program_id, attach_type) instances are collapsed
into one;
- Attaches programs to unit cgroup.
Julia Kartseva [Tue, 2 Mar 2021 00:56:04 +0000 (16:56 -0800)]
cgroup: add foreign program to cgroup context
- Store foreign bpf programs in cgroup context. A program is considered
foreign if it was loaded to a kernel by an entity external to systemd,
so systemd is responsible only for attach and detach paths.
- Support the case of pinned bpf programs: pinning to bpffs so a program
is kept loaded to the kernel even when program fd is closed by a user
application is a common way to extend program's lifetime.
- Aadd linked list node struct with attach type and bpffs path
fields.
Julia Kartseva [Thu, 4 Feb 2021 08:02:07 +0000 (00:02 -0800)]
shared: bpf_attach_type {from,to} string
Introduce bpf_cgroup_attach_type_table with accustomed attached type
names also used in bpftool.
Add bpf_cgroup_attach_type_{from|to}_string helpers to convert from|to
string representation of pinned bpf program, e.g.
"egress:/sys/fs/bpf/egress-hook" for
/sys/fs/bpf/egress-hook path and BPF_CGROUP_INET_EGRESS attach type.
Julia Kartseva [Wed, 16 Sep 2020 22:58:04 +0000 (15:58 -0700)]
shared: add bpf-program helpers
Add helpers to:
- Create new BPFProgram instance from a path in bpf
filesystem and bpf attach type;
- Pin a program to bpf fs;
- Get BPF program ID by BPF program FD.
Julia Kartseva [Thu, 4 Feb 2021 06:15:27 +0000 (22:15 -0800)]
bpf-firewall: attach with BPF_F_ALLOW_MULTI if kernel supports
Reduced version of [0].
Use BPF_F_ALLOW_MULTI attach flag for bpf-firewall if kernel supports
it.
Aside from addressing security issue in [0] attaching with 'multi'
allows further attaching of cgroup egress, ingress hooks specified by
BPFProgram=.
[0] https://github.com/systemd/systemd/pull/17495/commits/
4e42210d40f96e185a55d43041dd6b962ea830dd
Lennart Poettering [Fri, 9 Apr 2021 13:00:16 +0000 (15:00 +0200)]
sd-device: fix error code returned by sd_device_get_sysattr_value() for non-existing attributes
lstat() returns the error in errno, not as return value. Let's propagate
this correctly.
This broke the bolt test suite, as @gicmo discovered.
Follow-up for
acfc2a1d15560084e077ffb3be472cd117e9020a.
gaoyi [Tue, 6 Apr 2021 02:44:33 +0000 (10:44 +0800)]
gpt-auto-generator: don't generate systemd-cryptsetup@.service when --Dlibcryptsetup=false
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 11:12:41 +0000 (13:12 +0200)]
Merge pull request #19243 from bluca/lgtm
Fix various issues reported by LGTM
Aakash Singh [Tue, 6 Apr 2021 20:13:46 +0000 (01:43 +0530)]
hwdb: 60-keyboard:: Update MSI Modern backslash and hotkeys
fix typos
Jérôme Carretero [Fri, 9 Apr 2021 08:55:58 +0000 (04:55 -0400)]
login: logind-dbus: support scheduled kexec (#19162)
login: logind-dbus: support delayed kexec
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 07:27:42 +0000 (09:27 +0200)]
man: document system-systemd\x2dcryptsetup.slice
As discussed in
https://github.com/systemd/systemd/pull/14235/commits/
1dc85eff1d0dff18aaeaae530c91bf53f34b726e#r606821495,
follow-up for commit
1dc85eff1d0dff18aaeaae530c91bf53f34b726e.
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 08:27:36 +0000 (10:27 +0200)]
docs: use new URL for package-notes
simmon [Fri, 9 Apr 2021 07:01:57 +0000 (09:01 +0200)]
po: Translated using Weblate (Korean)
Currently translated at 100.0% (189 of 189 strings)
Co-authored-by: simmon <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
Yu Watanabe [Wed, 7 Apr 2021 17:29:52 +0000 (02:29 +0900)]
network: do not require DHCPv6 addresses when UseAddress=no
Follow-up for
1536b7b2d00819615bf8eba194de7ccd20c3689f.
Fixes #19196.
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 06:13:21 +0000 (08:13 +0200)]
Merge pull request #19254 from poettering/native-journal-proto-doc
document native journal protocol
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 06:05:14 +0000 (08:05 +0200)]
Merge pull request #19255 from poettering/glyph-love
some SpecialGlyph tweaks
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 05:56:04 +0000 (07:56 +0200)]
Merge pull request #19248 from keszybz/make-tests-test
Make tests test
Lennart Poettering [Thu, 8 Apr 2021 21:01:25 +0000 (23:01 +0200)]
core: rework unit_active_state_to_glyph() to use a translation table
Let's make this a bit more readable by implementing this via a
translation table, indexed by the state.
Lennart Poettering [Thu, 8 Apr 2021 20:59:43 +0000 (22:59 +0200)]
locale-util: make SpecialGlyph more like our usual enums
Let's define both an enum and a typedef named SpecialGlyph, the way we
usually do it.
Also, introduce an "invalid" special glyph, assigned to -EINVAL, also
like we always do it. (And handle it somewhat sanely in special_glyph()
Lennart Poettering [Thu, 8 Apr 2021 20:14:57 +0000 (22:14 +0200)]
man: link up new journal protocol docs
Lennart Poettering [Thu, 8 Apr 2021 20:07:00 +0000 (22:07 +0200)]
docs: document native journal protocol
Fixes: #17748
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 18:29:05 +0000 (20:29 +0200)]
Merge pull request #19226 from keszybz/reenable-maybe-unitialized-warning
meson: re-enable -Wmaybe-uninitialized
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 18:26:30 +0000 (20:26 +0200)]
Merge pull request #19250 from keszybz/sd-bus-is-ready-simplification
Simplify how sd_bus_is_ready() is used
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 08:57:40 +0000 (10:57 +0200)]
TEST-17: make the test test
'! grep -v' does *not* test that there are no matching lines.
Instead, it checks that whether there are any non-matching lines.
And of course, for the test to fail, '! grep' cannot be part of
an expression with &&.
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 08:34:53 +0000 (10:34 +0200)]
TEST-46: simplify lossy diff invocation
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 08:34:28 +0000 (10:34 +0200)]
homectl,TEST-46: fix test and fix homectl return value, update docs
The usual: the test wasn't testing, so we didn't notice that the
command wasn't returning as expected.
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 07:47:04 +0000 (09:47 +0200)]
TEST-44: fix test
We were grepping for 'hello world', and in the namespace we would
match on 'hello world', and outside, on 'echo "hello world"'. When
the condition check was fixed, the test gave a false positive.
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 07:45:28 +0000 (09:45 +0200)]
TEST-43: fix exit condition testing
We were invoking 'systemd-run bash', but the test invoked by bash
was not effective. When the result of that check is propagated, the
outer command fails.
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 22:09:55 +0000 (00:09 +0200)]
TEST-*: use spacing before redirection operator, but not after
<< EOF → <<EOF
> foo < bar → >foo <bar
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 23:27:33 +0000 (01:27 +0200)]
TEST-*: make failure tests actually fail on failure
Here the intent was actually correct, and the tests still pass when the check
is made effective.
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 23:23:49 +0000 (01:23 +0200)]
TEST-42-EXECSTOPPOST: un-invert test
Since we test for the file right below, it seems we expected the
command to succeed.
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 22:48:35 +0000 (00:48 +0200)]
tmpfiles: make handling of existing-but-different targets more consistent
create_fifo() was added in
a2fc2f8dd30c17ad1e23a31fc6ff2aeba4c6fa27, and
would always ignore failure. The test was trying to fail in this case, but
we actually don't fail, which seems to be correct. We didn't notice before
because the test was ineffective.
To make things consistent, generally log at warning level, but don't propagate
the error. For symlinks, log at debug level, as before.
For 'e', failure is not propagated now. The test is adjusted to match.
I think warning is appropriate in most cases: we do not expect a device node to
be replaced by a different device node or even a non-device file. This would
most likely be an error somewhere. An exception is made for symlinks, which are
mismatched on purpose, for example /etc/resolv.conf. With this patch, we don't
get any warnings with the any of the 74 tmpfiles.d files, which suggests that
increasing the warning levels will not cause too many unexpected warnings. If
it turns out that there are valid cases where people have expected mismatches
for non-symlink types, we can always decrease the log levels again.
Luca Boccassi [Thu, 8 Apr 2021 10:30:33 +0000 (11:30 +0100)]
tests: allow for os-release quote variability in TEST-50-DISSECT
Quoting of values differs between distros: Fedora doesn't quote the ID_
fields, but CentOS does.
Adjust the test checks to account for this.
Fixes #19242
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 13:04:18 +0000 (15:04 +0200)]
networkd: simplify sd_bus_is_ready() checks
Also add "system" in the messages, because we set the internal value,
and are just skipping the setting of the external value, so the message
could be confusing without that clarification.
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 12:59:10 +0000 (14:59 +0200)]
sd-bus: make sd_bus_is_{ready,open} accept NULL
We didn't document this behaviour one way or another, so I think it's
OK to change. All callers do the NULL check before callling this to avoid
the assert warning, so it seems reasonable to do it internally.
sd_bus_can_send() is similar, but there we expressly say that an
error is returned on NULL, so I didn't change it.
Yu Watanabe [Wed, 7 Apr 2021 16:58:55 +0000 (01:58 +0900)]
network: do not emit changed properties when bus connection is not ready
Prompted by #19212.
Yu Watanabe [Wed, 7 Apr 2021 16:47:52 +0000 (01:47 +0900)]
test: move check of nat table existence
As test_v4() with iptables backend will be called after nftables tests.
Follow-up for
afbcd905526111e3a1bd55b0d6d5ee4413734735.
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 12:37:02 +0000 (14:37 +0200)]
Merge pull request #19237 from yuwata/udev-builtin-net-id-follow-ups-for-19017
udev: fix several issues around hotplug slot detection
Luca Boccassi [Wed, 7 Apr 2021 22:08:34 +0000 (23:08 +0100)]
in-addr-util: suppress LGTM warning about htobe32
We are not calling it directly, it's coming from a standard library
macro, so just suppress it.
Luca Boccassi [Wed, 7 Apr 2021 22:06:24 +0000 (23:06 +0100)]
errno-util: suppress LGTM warning about strerror
Luca Boccassi [Wed, 7 Apr 2021 21:58:12 +0000 (22:58 +0100)]
scsi_id: modernize and use extract_many_words instead of strsep
Also use standard error loggin/return pattern.
Only cursory tested, by checking that with a simple config file
the array is the same before/after. Not tested with actual scsi
rules and devices, due to missing hardware.
Luca Boccassi [Wed, 7 Apr 2021 21:52:32 +0000 (22:52 +0100)]
test-extract-word: add a couple more corner cases
Luca Boccassi [Sat, 3 Apr 2021 13:46:46 +0000 (14:46 +0100)]
timedated: use format_timestamp instead of ctime
Some static analyzers (lgtm) warn against using non-re-entrant functions,
even though at the moment this code is not multi-threaded, just switch to
format_timestamp.
Zbigniew Jędrzejewski-Szmek [Wed, 31 Mar 2021 15:05:49 +0000 (17:05 +0200)]
meson: re-enable -Wmaybe-uninitialized on -O[02] with recent gcc versions
The warning was disabled in
8794164fed5f0142c34358613f92f4f761af4edd to avoid
false positives. But it is useful in finding errors, even if it sometimes
results in untrue warnings (c.f.
77fac974fe,
da46a1bc3c).
After #19168, #19169, and #19175, there are no warnings with
-Dbuildtype=debug-optimized/-O2 and gcc-11.0.1-0.3.fc34.x86_64. Warnings
are reenabled for -O[23]
-O0 is good for development, and -O2 is the default optimization level for
Fedora package builds. -Os, -O3, -O1, and -Og still generate some warnings. In
fact, with -Os the number of warnings seems completely hopeless. Dozens and
dozens.
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 10:57:23 +0000 (12:57 +0200)]
home: use goto to make it clear that variables are initialized
gcc-11.0.1-0.3.fc34.x86_64 with -Og was complaining that 'r' might be
unitialized. It cannot, but let's rework the code to use a goto instead of
conditionalizing on 'call' being unset, which I think is clearer and less error
prone. This silences the warning.
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 10:54:55 +0000 (12:54 +0200)]
basic/strbuf: use _cleanup_
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 15:31:34 +0000 (17:31 +0200)]
timedatectl: rework handling of conditions in print_status_info()
gcc-11.0.1-0.3.fc34.x86_64 was complaining that n might be unset with
--optimization=1. It was wrong, but let's rework the code to make it
obvious that it is always set.
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 22:09:38 +0000 (00:09 +0200)]
TEST-33-CLEAN-UNIT: fix broken test exposed by condition check fix
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 21:32:14 +0000 (23:32 +0200)]
TEST-22-TMPFILES: fix broken test exposed by condition check fix
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 21:24:25 +0000 (23:24 +0200)]
tests: make inverted tests actually count
"! test ..." does not cause the script to fail, even with set -e.
IIUC, bash treats this command as part of an expression line, as it
would if 'test ... && ...' was used. Failing expression lines do not
terminate the script.
This fixes the obvious cases by changing '! test' → 'test !'.
Then the inversion happens internally in test and bash will propagate
the failure.
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 20:35:19 +0000 (22:35 +0200)]
TEST-22-TMPFILES: add reproducer for bug with X
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 16:26:15 +0000 (18:26 +0200)]
man: fix quickhelp listing in tmpfiles.d(5)
Unlike many other small/big letter combos, this one has the recursive
version attached to the lowercase letter.
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 15:54:49 +0000 (17:54 +0200)]
tmpfiles: rework condition check
(!a && b) || (a && c) is replaced by (a ? c : b).
path_startswith() != NULL is need to avoid type warning.
Masahiro Matsuya [Wed, 31 Mar 2021 02:44:24 +0000 (11:44 +0900)]
tmpfiles: use a entry in hashmap as ItemArray in read_config_file()
[zjs: squash commits and use size_t as appropriate.
Bug seems to have been introduced in
811a15877825da9e53f9a2a8603da34589af6bbb.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
1944468.]
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 14:18:53 +0000 (16:18 +0200)]
core: fix memleak of ipc_namespace_path
Fixup for
a70581ffb5c13c91c76ff73ba6f5f3ff59c5a915.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32991
Luca Boccassi [Wed, 7 Apr 2021 21:06:26 +0000 (22:06 +0100)]
Merge pull request #19231 from bluca/coredump_decode
coredump: follow-ups for #19135
Yu Watanabe [Wed, 7 Apr 2021 13:22:22 +0000 (22:22 +0900)]
udev: use snprintf_ok()
Yu Watanabe [Wed, 7 Apr 2021 13:36:12 +0000 (22:36 +0900)]
udev: fix potential infinite loop
Yu Watanabe [Wed, 7 Apr 2021 13:26:41 +0000 (22:26 +0900)]
udev: make dev_pci_slot() return earlier when PCI bridge is found
Yu Watanabe [Wed, 7 Apr 2021 10:17:23 +0000 (19:17 +0900)]
udev: use uint32_t for hotplug_slot
This also makes function id is parsed as uint64_t. Kernel internally
uses uint32_t for function id (see the definition of 'struct zpci_dev),
but it maybe extended in the future.
Yu Watanabe [Wed, 7 Apr 2021 13:11:00 +0000 (22:11 +0900)]
udev: split out logic of parsing s390 PCI slots
This also adds several debugging logs.