]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agotest-network: test waiting for address family 19069/head
LetzteInstanz [Mon, 12 Apr 2021 15:15:33 +0000 (18:15 +0300)] 
test-network: test waiting for address family

4 years agowait-online: wait for address family
LetzteInstanz [Tue, 13 Apr 2021 11:57:19 +0000 (14:57 +0300)] 
wait-online: wait for address family

This introduce -4 and -6 commandline options.

4 years agosd-network: read IPv4/IPv6 address states from state files
LetzteInstanz [Mon, 12 Apr 2021 10:50:32 +0000 (13:50 +0300)] 
sd-network: read IPv4/IPv6 address states from state files

4 years agonetwork: save IPv4/IPv6 address states into state file
LetzteInstanz [Sun, 11 Apr 2021 20:29:11 +0000 (23:29 +0300)] 
network: save IPv4/IPv6 address states into state file

This also introduces RequiredFamilyForOnline= setting to .network file,
and IPv4AddressState/IPv6AddressState DBus properties.

4 years agonetwork: move AddressFamily into network-util for the use by wait-online later
LetzteInstanz [Sun, 21 Mar 2021 07:37:38 +0000 (10:37 +0300)] 
network: move AddressFamily into network-util for the use by wait-online later

4 years agoudev: delete useless codes
gaoyi [Tue, 13 Apr 2021 10:59:46 +0000 (18:59 +0800)] 
udev: delete useless codes

It seems no one will touch queue.bin

4 years agodhcp: Implemented BindToInterface= configuration option
Yegor Alexeyev [Tue, 9 Mar 2021 11:57:37 +0000 (14:57 +0300)] 
dhcp: Implemented BindToInterface= configuration option

4 years agoMerge pull request #19303 from yuwata/fix-typo
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

4 years agotree-wide: update comment about unnecessary initialization 19303/head
Yu Watanabe [Tue, 13 Apr 2021 03:53:32 +0000 (12:53 +0900)] 
tree-wide: update comment about unnecessary initialization

4 years agoman: fix typo
Yu Watanabe [Tue, 13 Apr 2021 03:52:56 +0000 (12:52 +0900)] 
man: fix typo

4 years agoload-fragment: parse specifiers in CPUAffinity= (#19281)
Francois Gervais [Mon, 12 Apr 2021 22:25:29 +0000 (18:25 -0400)] 
load-fragment: parse specifiers in CPUAffinity= (#19281)

4 years agomeson: do not fail if rsync is not installed with meson 0.57.2
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.

4 years agopackit: drop the 'sources' file after cloning the Fedora repo
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.

4 years agoMerge pull request #18701 from bugaevc/mdns-unicast
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

4 years agoMerge pull request #13496 from wat-ze-hex/custom-bpf-progs-parameterized-3
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

4 years agoman: fix discriptions for --exec-delay
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.

4 years agosd-dhcp-client: constify argument in sd_dhcp_lease_get_xxx()
Yu Watanabe [Sun, 11 Apr 2021 08:54:50 +0000 (17:54 +0900)] 
sd-dhcp-client: constify argument in sd_dhcp_lease_get_xxx()

4 years agonetworkctl: drop unused variables
Yu Watanabe [Sun, 11 Apr 2021 15:56:01 +0000 (00:56 +0900)] 
networkctl: drop unused variables

4 years agotest-repart: use cryptsetup and losetup autoclose
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

4 years agoscsi_id: use read_line instead of fgets
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."

4 years agoMerge pull request #19164 from mmatsuya/main
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()

4 years agomkosi.arch: add rsync build dependency
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

4 years agoExtend characters set for PKCS11 URI
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

4 years agonetwork: refuse to configure NDISC twice
Yu Watanabe [Sat, 10 Apr 2021 04:37:35 +0000 (13:37 +0900)] 
network: refuse to configure NDISC twice

4 years agoresolved: add RFC 8375 "home.arpa" to list of default NTA
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.

4 years agoopenssl: make RSA struct const
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
4 years agosd-dhcp6-client: do not use IN_SET() macro when only one target value
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

4 years agonetwork: adjust log message
Yu Watanabe [Sat, 10 Apr 2021 04:28:11 +0000 (13:28 +0900)] 
network: adjust log message

4 years agonetwork: drop unnecessary bitfield specifier
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.

4 years agounits: install dbus-org.freedesktop.oom1.service alias
Anita Zhang [Sat, 10 Apr 2021 07:50:50 +0000 (00:50 -0700)] 
units: install dbus-org.freedesktop.oom1.service alias

Fixes: #18469
4 years agofuzz: add BPFProgram= to directives 13496/head
Julia Kartseva [Tue, 22 Dec 2020 17:27:14 +0000 (09:27 -0800)] 
fuzz: add BPFProgram= to directives

4 years agodbus-cgroup: add BPFProgram= dbus support
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.

4 years agoman: add BPFProgram= documentation
Julia Kartseva [Wed, 9 Dec 2020 06:06:56 +0000 (22:06 -0800)] 
man: add BPFProgram= documentation

4 years agotests: add unit file tests for BPFProgram=
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

4 years agocore: add bpf-foreign to fragment parser
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

4 years agocore: add bpf-foreign cgroup mask and harness
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.

4 years agocore: add bpf-foreign unit helpers
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.

4 years agocgroup: add foreign program to cgroup context
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.

4 years agoshared: bpf_attach_type {from,to} string
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.

4 years agoshared: add bpf-program helpers
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.

4 years agobpf-firewall: attach with BPF_F_ALLOW_MULTI if kernel supports
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

4 years agosd-device: fix error code returned by sd_device_get_sysattr_value() for non-existing...
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.

4 years agogpt-auto-generator: don't generate systemd-cryptsetup@.service when --Dlibcryptsetup...
gaoyi [Tue, 6 Apr 2021 02:44:33 +0000 (10:44 +0800)] 
gpt-auto-generator: don't generate systemd-cryptsetup@.service when --Dlibcryptsetup=false

4 years agoMerge pull request #19243 from bluca/lgtm
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

4 years agohwdb: 60-keyboard:: Update MSI Modern backslash and hotkeys
Aakash Singh [Tue, 6 Apr 2021 20:13:46 +0000 (01:43 +0530)] 
hwdb: 60-keyboard:: Update MSI Modern backslash and hotkeys

fix typos

4 years agologin: logind-dbus: support scheduled kexec (#19162)
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

4 years agoman: document system-systemd\x2dcryptsetup.slice
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.

4 years agodocs: use new URL for package-notes
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 08:27:36 +0000 (10:27 +0200)] 
docs: use new URL for package-notes

4 years agopo: Translated using Weblate (Korean)
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

4 years agonetwork: do not require DHCPv6 addresses when UseAddress=no
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.

4 years agoMerge pull request #19254 from poettering/native-journal-proto-doc
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

4 years agoMerge pull request #19255 from poettering/glyph-love
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

4 years agoMerge pull request #19248 from keszybz/make-tests-test
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

4 years agocore: rework unit_active_state_to_glyph() to use a translation table 19255/head
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.

4 years agolocale-util: make SpecialGlyph more like our usual enums
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()

4 years agoman: link up new journal protocol docs 19254/head
Lennart Poettering [Thu, 8 Apr 2021 20:14:57 +0000 (22:14 +0200)] 
man: link up new journal protocol docs

4 years agodocs: document native journal protocol
Lennart Poettering [Thu, 8 Apr 2021 20:07:00 +0000 (22:07 +0200)] 
docs: document native journal protocol

Fixes: #17748
4 years agoMerge pull request #19226 from keszybz/reenable-maybe-unitialized-warning
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

4 years agoMerge pull request #19250 from keszybz/sd-bus-is-ready-simplification
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

4 years agoTEST-17: make the test test 19248/head
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 &&.

4 years agoTEST-46: simplify lossy diff invocation
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 08:34:53 +0000 (10:34 +0200)] 
TEST-46: simplify lossy diff invocation

4 years agohomectl,TEST-46: fix test and fix homectl return value, update docs
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.

4 years agoTEST-44: fix test
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.

4 years agoTEST-43: fix exit condition testing
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.

4 years agoTEST-*: use spacing before redirection operator, but not after
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

4 years agoTEST-*: make failure tests actually fail on failure
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.

4 years agoTEST-42-EXECSTOPPOST: un-invert test
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.

4 years agotmpfiles: make handling of existing-but-different targets more consistent
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.

4 years agotests: allow for os-release quote variability in TEST-50-DISSECT
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

4 years agonetworkd: simplify sd_bus_is_ready() checks 19250/head
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.

4 years agosd-bus: make sd_bus_is_{ready,open} accept NULL
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.

4 years agonetwork: do not emit changed properties when bus connection is not ready
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.

4 years agotest: move check of nat table existence
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.

4 years agoMerge pull request #19237 from yuwata/udev-builtin-net-id-follow-ups-for-19017
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

4 years agoin-addr-util: suppress LGTM warning about htobe32 19243/head
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.

4 years agoerrno-util: suppress LGTM warning about strerror
Luca Boccassi [Wed, 7 Apr 2021 22:06:24 +0000 (23:06 +0100)] 
errno-util: suppress LGTM warning about strerror

4 years agoscsi_id: modernize and use extract_many_words instead of strsep
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.

4 years agotest-extract-word: add a couple more corner cases
Luca Boccassi [Wed, 7 Apr 2021 21:52:32 +0000 (22:52 +0100)] 
test-extract-word: add a couple more corner cases

4 years agotimedated: use format_timestamp instead of ctime
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.

4 years agomeson: re-enable -Wmaybe-uninitialized on -O[02] with recent gcc versions 19226/head
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. 77fac974feda46a1bc3c).

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.

4 years agohome: use goto to make it clear that variables are initialized
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.

4 years agobasic/strbuf: use _cleanup_
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 10:54:55 +0000 (12:54 +0200)] 
basic/strbuf: use _cleanup_

4 years agotimedatectl: rework handling of conditions in print_status_info()
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.

4 years agoTEST-33-CLEAN-UNIT: fix broken test exposed by condition check fix
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

4 years agoTEST-22-TMPFILES: 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

4 years agotests: make inverted tests actually count
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.

4 years agoTEST-22-TMPFILES: add reproducer for bug with X 19164/head
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 20:35:19 +0000 (22:35 +0200)] 
TEST-22-TMPFILES: add reproducer for bug with X

4 years agoman: fix quickhelp listing in tmpfiles.d(5)
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.

4 years agotmpfiles: rework condition check
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.

4 years agotmpfiles: use a entry in hashmap as ItemArray in read_config_file()
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.]

4 years agocore: fix memleak of ipc_namespace_path
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

4 years agoMerge pull request #19231 from bluca/coredump_decode
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

4 years agoudev: use snprintf_ok() 19237/head
Yu Watanabe [Wed, 7 Apr 2021 13:22:22 +0000 (22:22 +0900)] 
udev: use snprintf_ok()

4 years agoudev: fix potential infinite loop
Yu Watanabe [Wed, 7 Apr 2021 13:36:12 +0000 (22:36 +0900)] 
udev: fix potential infinite loop

4 years agoudev: make dev_pci_slot() return earlier when PCI bridge is found
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

4 years agoudev: use uint32_t for hotplug_slot
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.

4 years agoudev: split out logic of parsing s390 PCI slots
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.

4 years agoudev: it is not necessary that the path is readable
Yu Watanabe [Wed, 7 Apr 2021 10:19:45 +0000 (19:19 +0900)] 
udev: it is not necessary that the path is readable

4 years agoudev: add missing initialization to fix freeing invalid address
Yu Watanabe [Wed, 7 Apr 2021 10:09:50 +0000 (19:09 +0900)] 
udev: add missing initialization to fix freeing invalid address

4 years agomkosi: work-around to make systemd build in Fedora images that lack populated /etc
Lennart Poettering [Thu, 1 Apr 2021 15:58:54 +0000 (17:58 +0200)] 
mkosi: work-around to make systemd build in Fedora images that lack populated /etc

On Fedora /usr/bin/ld is a symlink managed via the "alternatives"
system. This unfortunately means the binary is not usable in
environments where /var or /etc are unpopulated. Let's address this by
redirecting "ld" to "ld.bfd" manually if such an environment is
detected, via $PATH.

This is useful for building systemd in mkosi with UsrOnly=1 set.