1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00
Commit Graph

50483 Commits

Author SHA1 Message Date
Lennart Poettering
1a80f4e0d7 docs: document native journal protocol
Fixes: #17748
2021-04-08 22:16:58 +02:00
Zbigniew Jędrzejewski-Szmek
d0b3039837
Merge pull request #19226 from keszybz/reenable-maybe-unitialized-warning
meson: re-enable -Wmaybe-uninitialized
2021-04-08 20:29:05 +02:00
Zbigniew Jędrzejewski-Szmek
d8e4c59785
Merge pull request #19250 from keszybz/sd-bus-is-ready-simplification
Simplify how sd_bus_is_ready() is used
2021-04-08 20:26:30 +02:00
Luca Boccassi
9f519e491f 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
2021-04-08 16:16:55 +02:00
Zbigniew Jędrzejewski-Szmek
5dbec9bd32 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.
2021-04-08 15:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
3bbb76f621 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.
2021-04-08 14:59:10 +02:00
Yu Watanabe
a73f8e9f32 network: do not emit changed properties when bus connection is not ready
Prompted by #19212.
2021-04-08 14:48:46 +02:00
Yu Watanabe
ecb4b08c2e test: move check of nat table existence
As test_v4() with iptables backend will be called after nftables tests.

Follow-up for afbcd90552.
2021-04-08 14:39:53 +02:00
Zbigniew Jędrzejewski-Szmek
2fe2941646
Merge pull request #19237 from yuwata/udev-builtin-net-id-follow-ups-for-19017
udev: fix several issues around hotplug slot detection
2021-04-08 14:37:02 +02:00
Zbigniew Jędrzejewski-Szmek
68c98a411d meson: re-enable -Wmaybe-uninitialized on -O[02] with recent gcc versions
The warning was disabled in 8794164fed 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.
2021-04-08 13:12:56 +02:00
Zbigniew Jędrzejewski-Szmek
98d81cf974 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.
2021-04-08 13:00:50 +02:00
Zbigniew Jędrzejewski-Szmek
3b9e6fb490 basic/strbuf: use _cleanup_ 2021-04-08 13:00:50 +02:00
Zbigniew Jędrzejewski-Szmek
a03e335b86 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.
2021-04-08 13:00:50 +02:00
Zbigniew Jędrzejewski-Szmek
71d1e58309 core: fix memleak of ipc_namespace_path
Fixup for a70581ffb5.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32991
2021-04-07 22:12:50 +01:00
Luca Boccassi
7f8225d21b
Merge pull request #19231 from bluca/coredump_decode
coredump: follow-ups for #19135
2021-04-07 22:06:26 +01:00
Yu Watanabe
cb8c948738 udev: use snprintf_ok() 2021-04-08 01:38:47 +09:00
Yu Watanabe
5a6e56ec17 udev: fix potential infinite loop 2021-04-08 01:38:47 +09:00
Yu Watanabe
19ed9a114c udev: make dev_pci_slot() return earlier when PCI bridge is found 2021-04-08 01:38:47 +09:00
Yu Watanabe
c304cb0146 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.
2021-04-08 01:38:43 +09:00
Yu Watanabe
fa28023c0f udev: split out logic of parsing s390 PCI slots
This also adds several debugging logs.
2021-04-08 01:35:43 +09:00
Yu Watanabe
70c35e4bfd udev: it is not necessary that the path is readable 2021-04-08 01:35:43 +09:00
Yu Watanabe
b08c3fbe0e udev: add missing initialization to fix freeing invalid address 2021-04-08 01:35:43 +09:00
Lennart Poettering
7211773a55 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.
2021-04-07 17:45:28 +02:00
Zbigniew Jędrzejewski-Szmek
46cbdcd9fe 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.
2021-04-07 17:05:35 +02:00
Zbigniew Jędrzejewski-Szmek
4a3ad75efa shared/format-table: rework loop
Not a big difference, but I think it's a bit nicer this way.
2021-04-07 17:05:35 +02:00
Lennart Poettering
d997861ea7 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.
2021-04-07 16:19:35 +02:00
Zbigniew Jędrzejewski-Szmek
f1e7cbaef7 sd-bus: make sd_bus_error_set() more like sd_bus_error_setfv()
In b9c19bc384, 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().
2021-04-07 16:04:52 +02:00
Zbigniew Jędrzejewski-Szmek
1b09b81cf4 tree-wide: sd_bus_error_setf → set_bus_error_set
strdup() is more efficient than asprintf().
2021-04-07 16:04:52 +02:00
Zbigniew Jędrzejewski-Szmek
7756528e9b 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.
2021-04-07 16:04:22 +02:00
Luca Boccassi
81e01cf809 coredump: update and shorten package metadata keys
Follow-up for a7ea0a460b
2021-04-07 14:04:04 +01:00
Luca Boccassi
289784a798 coredump: use path_equal_filename helper 2021-04-07 14:03:49 +01:00
Luca Boccassi
727e63e33e basic: add path_equal_filename helper 2021-04-07 14:03:49 +01:00
Luca Boccassi
b7ddd44497 coredumpctl: fetch JSON object by key instead of iterating
Follow-up for d1b5a0c691
2021-04-07 14:03:49 +01:00
Luca Boccassi
1f2abb791e coredump: fetch JSON object by key instead of iterating
Follow-up for c546154a44
2021-04-07 14:03:48 +01:00
Luca Boccassi
671769c932 coredump: rename COREDUMP_PKGMETA_ fields to COREDUMP_PACKAGE_
Follow-up for c546154a44
2021-04-07 14:02:38 +01:00
Luca Boccassi
f216e74841 coredump: use JSON helpers instead of creating objects manually
Follow-up for 95f7180773
2021-04-07 14:02:38 +01:00
Luca Boccassi
9b7205f5dd coredump: fix style nits
Follow-up for 95f7180773
2021-04-07 14:02:38 +01:00
Luca Boccassi
26c22c84e0 coredump: use set_put_strdup()
Follow-up for 95f7180773
2021-04-07 14:02:38 +01:00
Luca Boccassi
2c173dbf1b coredump: fix typo
Follow-up for 95f7180773
2021-04-07 14:02:38 +01:00
Zbigniew Jędrzejewski-Szmek
462035d599 sd-device: small modernization 2021-04-07 14:36:37 +02:00
Zbigniew Jędrzejewski-Szmek
9b4aba104e shared/base-filesystem: modernization 2021-04-07 14:36:25 +02:00
Morten Linderud
29d898cc7b 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>
2021-04-07 13:57:33 +02:00
Luca Boccassi
65d09d575c 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.
2021-04-07 09:32:42 +02:00
Zbigniew Jędrzejewski-Szmek
3e3ab11b9e
Merge pull request #19135 from bluca/coredump_decode
coredump: parse build-id and .note.package
2021-04-07 07:41:16 +02:00
Luca Boccassi
a7ea0a460b Add markdown doc about coredump package metadata 2021-04-06 23:12:51 +01:00
Luca Boccassi
d1b5a0c691 coredumpctl: parse and print package metadata 2021-04-06 23:12:51 +01:00
Luca Boccassi
c546154a44 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.
2021-04-06 23:12:51 +01:00
Luca Boccassi
95f7180773 coredump: parse .note.package ELF section
Parse the .note.package ELF section for each ELF object
contained in a core file, if present.
2021-04-06 22:53:54 +01:00
Luca Boccassi
965e095546 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.
2021-04-06 22:52:48 +01:00
Luca Boccassi
ee579e6454
Merge pull request #19215 from braewoods/main
hwdb: 60-keyboard:: Add quirks for 2 new HP laptops
2021-04-06 18:52:11 +01:00