]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 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()

3 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

3 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

3 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

3 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.

3 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
3 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

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

3 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.

3 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
3 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.

3 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

3 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

3 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

3 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

3 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.

3 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

3 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

3 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.

3 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

3 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

3 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

3 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.

3 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()

3 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

3 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
3 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

3 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

3 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 &&.

3 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

3 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.

3 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.

3 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.

3 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

3 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.

3 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.

3 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.

3 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

3 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.

3 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.

3 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.

3 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.

3 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

3 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.

3 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

3 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.

3 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

3 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.

3 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.

3 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.

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

3 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.

3 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

3 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

3 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.

3 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

3 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.

3 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.

3 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.]

3 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

3 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

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

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

3 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

3 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.

3 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.

3 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

3 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

3 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.

3 years agoshared/format-table: use goto to make code flow clear
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 15:01:50 +0000 (17:01 +0200)] 
shared/format-table: use goto to make code flow clear

gcc 9.3.0 "cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0" with --optimization=1 was
not able to figure out that all cases are covered because r is either set in
the switch or type < _TABLE_DATA_TYPE_MAX.

But for a human reader this might also not be obvious: the cases are not in
exactly the same order as enum definitions, and it's a long list. By using the
goto, there should be no doubt, and we avoid checking the condition a second
time.

3 years agoshared/format-table: rework loop
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 14:55:27 +0000 (16:55 +0200)] 
shared/format-table: rework loop

Not a big difference, but I think it's a bit nicer this way.

3 years agoproc-cmdline: allow backslash escapes when parsing /proc/cmdline
Lennart Poettering [Tue, 6 Apr 2021 09:45:47 +0000 (11:45 +0200)] 
proc-cmdline: allow backslash escapes when parsing /proc/cmdline

So far when parsing /proc/cmdline we'd consider backslashes as
mechanisms for escaping whitepace or quotes. This changes things so that
they are retained as they are instead. The kernel itself doesn't allow such
escaping, and hence we shouldn't do so either (see lib/cmdline.c in the
kernel sources; it does support "" quotes btw).

This fix is useful to allow specifying backslash escapes in the "root="
cmdline option to be passed through to systemd-fstab-generator. Example:

    root=/dev/disk/by-partlabel/Root\x20Partition

Previously we'd eat up the "\" so that we'd then look for a device
/dev/disk/by-partlabel/Rootx20Partition which never shows up.

3 years agosd-bus: make sd_bus_error_set() more like sd_bus_error_setfv()
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 13:54:26 +0000 (15:54 +0200)] 
sd-bus: make sd_bus_error_set() more like sd_bus_error_setfv()

In b9c19bc384fd41c173a8e453bd157544400af059, I added an assert to _setfv() and
_setf(), but I forgot to do the same in _set(). Let's do this for completeness.

While at it, restructure _set() to use the same style as _setfv().

3 years agotree-wide: sd_bus_error_setf → set_bus_error_set
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 13:59:27 +0000 (15:59 +0200)] 
tree-wide: sd_bus_error_setf → set_bus_error_set

strdup() is more efficient than asprintf().

3 years agotree-wide: use the same comment for work-around initializations
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 12:22:30 +0000 (14:22 +0200)] 
tree-wide: use the same comment for work-around initializations

This should make it easier to remove those warnings when the compiler
gets smarter. Not sure if I got them all...

Double space before the comment start to make it easier to separate from the
preceding line.

3 years agocoredump: update and shorten package metadata keys 19231/head
Luca Boccassi [Wed, 7 Apr 2021 09:56:14 +0000 (10:56 +0100)] 
coredump: update and shorten package metadata keys

Follow-up for a7ea0a460bb3

3 years agocoredump: use path_equal_filename helper
Luca Boccassi [Wed, 7 Apr 2021 09:47:14 +0000 (10:47 +0100)] 
coredump: use path_equal_filename helper

3 years agobasic: add path_equal_filename helper
Luca Boccassi [Wed, 7 Apr 2021 09:45:33 +0000 (10:45 +0100)] 
basic: add path_equal_filename helper

3 years agocoredumpctl: fetch JSON object by key instead of iterating
Luca Boccassi [Wed, 7 Apr 2021 09:38:56 +0000 (10:38 +0100)] 
coredumpctl: fetch JSON object by key instead of iterating

Follow-up for d1b5a0c691

3 years agocoredump: fetch JSON object by key instead of iterating
Luca Boccassi [Wed, 7 Apr 2021 09:35:34 +0000 (10:35 +0100)] 
coredump: fetch JSON object by key instead of iterating

Follow-up for c546154a4448ddf9

3 years agocoredump: rename COREDUMP_PKGMETA_ fields to COREDUMP_PACKAGE_
Luca Boccassi [Wed, 7 Apr 2021 09:31:31 +0000 (10:31 +0100)] 
coredump: rename COREDUMP_PKGMETA_ fields to COREDUMP_PACKAGE_

Follow-up for c546154a4448ddf9

3 years agocoredump: use JSON helpers instead of creating objects manually
Luca Boccassi [Wed, 7 Apr 2021 09:21:48 +0000 (10:21 +0100)] 
coredump: use JSON helpers instead of creating objects manually

Follow-up for 95f71807733

3 years agocoredump: fix style nits
Luca Boccassi [Wed, 7 Apr 2021 09:16:54 +0000 (10:16 +0100)] 
coredump: fix style nits

Follow-up for 95f71807733

3 years agocoredump: use set_put_strdup()
Luca Boccassi [Wed, 7 Apr 2021 09:15:20 +0000 (10:15 +0100)] 
coredump: use set_put_strdup()

Follow-up for 95f71807733

3 years agocoredump: fix typo
Luca Boccassi [Wed, 7 Apr 2021 09:15:01 +0000 (10:15 +0100)] 
coredump: fix typo

Follow-up for 95f71807733

3 years agosd-device: small modernization
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 12:33:25 +0000 (14:33 +0200)] 
sd-device: small modernization

3 years agoshared/base-filesystem: modernization
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 11:15:28 +0000 (13:15 +0200)] 
shared/base-filesystem: modernization

3 years agoman/systemd-cryptenroll: Fix sd-boot manvolnum from 8 to 7
Morten Linderud [Wed, 7 Apr 2021 10:10:10 +0000 (12:10 +0200)] 
man/systemd-cryptenroll: Fix sd-boot manvolnum from 8 to 7

Off-by-one error in the documentation index. The volume number for
systemd-boot/sd-boot is 7.

Signed-off-by: Morten Linderud <morten@linderud.pw>
3 years agoBump test-random-util timeout
Luca Boccassi [Tue, 6 Apr 2021 19:24:17 +0000 (20:24 +0100)] 
Bump test-random-util timeout

It is using log_trace, which we enabled in the CI, so now it's
slower and it is timing out. Bump the timeout from 30s to 120s.

3 years agoMerge pull request #19135 from bluca/coredump_decode
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 05:41:16 +0000 (07:41 +0200)] 
Merge pull request #19135 from bluca/coredump_decode

coredump: parse build-id and .note.package

3 years agoAdd markdown doc about coredump package metadata 19135/head
Luca Boccassi [Tue, 6 Apr 2021 14:48:52 +0000 (15:48 +0100)] 
Add markdown doc about coredump package metadata

3 years agocoredumpctl: parse and print package metadata
Luca Boccassi [Tue, 6 Apr 2021 17:02:41 +0000 (18:02 +0100)] 
coredumpctl: parse and print package metadata

3 years agocoredump: parse and append package metadata to journal message
Luca Boccassi [Tue, 6 Apr 2021 17:24:01 +0000 (18:24 +0100)] 
coredump: parse and append package metadata to journal message

Append 'package' and 'packageVersion' to the journal as discrete fields
COREDUMP_PKGMETA_PACKAGE and COREDUMP_PKGMETA_PACKAGEVERSION respectively,
and the full json blurb as COREDUMP_PKGMETA_JSON.

3 years agocoredump: parse .note.package ELF section
Luca Boccassi [Tue, 6 Apr 2021 17:21:48 +0000 (18:21 +0100)] 
coredump: parse .note.package ELF section

Parse the .note.package ELF section for each ELF object
contained in a core file, if present.

3 years agocoredump: parse build-id out of core file
Luca Boccassi [Thu, 18 Mar 2021 11:19:09 +0000 (11:19 +0000)] 
coredump: parse build-id out of core file

Parse the build-id of each ELF object contained in the core file
using the elfutils' libdwfl interface.
Add it to the journal.

3 years agoMerge pull request #19215 from braewoods/main
Luca Boccassi [Tue, 6 Apr 2021 17:52:11 +0000 (18:52 +0100)] 
Merge pull request #19215 from braewoods/main

hwdb: 60-keyboard:: Add quirks for 2 new HP laptops

3 years agotpm2-util: properly load tpm2 libraries befre unsealing
Lennart Poettering [Tue, 6 Apr 2021 09:46:19 +0000 (11:46 +0200)] 
tpm2-util: properly load tpm2 libraries befre unsealing

We forgot a call to dlopen_tpm2() in the unseal codepaths. As long as
automatic TPM2 device discovery was used that didn't matter, since in
that codepaths we'd have another call dlopen_tpm2(). But with an
explicitly configured TPM2 device things should work too, hence add the
missing call.

Fixes: #19206
3 years agorecovery-key: add some extra asserts
Lennart Poettering [Tue, 6 Apr 2021 09:45:54 +0000 (11:45 +0200)] 
recovery-key: add some extra asserts

Let's ensure our key sizes calculations are correct.

This doesn't actually change anything, just adds more safety checks.
Inspired by #19203, but not a fix.

3 years agoresolve: copy rd flag from the query to response
KoyamaSohei [Sat, 3 Apr 2021 16:13:37 +0000 (01:13 +0900)] 
resolve: copy rd flag from the query to response

3 years agobash-completion: localize words and cword variables
Sibo Dong [Sat, 3 Apr 2021 03:33:59 +0000 (23:33 -0400)] 
bash-completion: localize words and cword variables

The words and cword variables are not localized in all Bash completion
scripts that call _init_completion.

cur, prev, words, and cword (and split if using the -s flag) are all
variables that should be localized in Bash completion scripts before
calling _init_completion (even if they don't otherwise appear in the
calling script). This is done for cur and prev, but not for words and
cword. Letting words and cword remain unlocalized may clobber variables
the user is using for other purposes, which is bad.

This issue can be resolved by declaring words and cword as local
variables.

Resolves #19188.