Commit Graph

40398 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
84d2744bc5 Move warning about unsupported BPF firewall right before the firewall would be created
There's no need to warn about the firewall when parsing, because the unit might
not be started at all. Let's warn only when we're actually preparing to start
the firewall.

This changes behaviour:
- the warning is printed just once for all unit types, and not once
  for normal units and once for transient units.
- on repeat warnings, the message is not printed at all. There's already
  detailed debug info from bpf_firewall_compile(), so we don't need to repeat
  ourselves.
- when we are not root, let's say precisely that, not "lack of necessary privileges"
  and "the local system does not support BPF/cgroup firewalling".

Fixes #12673.
2019-06-04 17:22:37 +02:00
Yu Watanabe
0bd3c2102f journalctl: make 'journalctl --flush' or friends not fail with varlink timeout
Closes #12570.
2019-06-04 23:27:26 +09:00
Zbigniew Jędrzejewski-Szmek
90f003a39f meson: escape dots in man/man helper
It was impossible to view systemd.nspawn(5), because systemd-nspawn(1) was matched
also, and happened to be earlier in the list. The solution in this patch is pretty
crude, but is should be enough for our purposes, since we don't have any regexp
special characters in man page names except for the dot.
2019-06-04 12:56:26 +02:00
Zbigniew Jędrzejewski-Szmek
aafec74d04
Merge pull request #12733 from keszybz/sd-bus-error-reporting
Bus error reporting improvements
2019-06-04 12:01:52 +02:00
Zbigniew Jędrzejewski-Szmek
33f724f427
Merge pull request #12734 from keszybz/cpu-set-util-on-i386
Fixes for test-cpu-set-util on i386
2019-06-04 12:01:20 +02:00
Yu Watanabe
ca866a32fb bash-completion: support "networkctl delete" 2019-06-04 12:00:49 +02:00
Yu Watanabe
f2083c718b journalctl: mention --smart-relinquish-var in log message 2019-06-04 17:04:35 +09:00
Yu Watanabe
17087340c3 journalctl: fix error cause in log message
If varlink_call() returns negative errno, then `error` is null.
2019-06-04 17:03:36 +09:00
Zbigniew Jędrzejewski-Szmek
64412970ac test-cpu-set-util: fix allocation size check on i386
We get just 28 bytes not 32 as on 64-bit architectures (__cpu_set_t is 4 bytes,
we need at least 26, so 28 satisfies the constraints).
2019-06-04 09:40:38 +02:00
Zbigniew Jędrzejewski-Szmek
a299ce058b test-cpu-set-util: fix comparison for allocation size
On i386, __cpu_mask is 4 bytes, so we'd check if c.allocated >= 0, and
gcc would warn about a bogus comparison. Let's round up.

Fixes #12726.
2019-06-04 09:23:34 +02:00
Yu Watanabe
9f08a578a8 network: remove unused argument in routing_policy_rule_configure() 2019-06-04 16:23:18 +09:00
Yu Watanabe
d26267ddf1 network: fix double free on error path 2019-06-04 16:23:18 +09:00
Yu Watanabe
3681d63935 network: fix UBSAN issue
Closes #12724.
2019-06-04 09:12:44 +02:00
Yu Watanabe
38b9af6154 networkctl: re-cast value stored in Set with INT_TO_PTR() 2019-06-04 09:08:55 +02:00
Zbigniew Jędrzejewski-Szmek
37dc34f702 shared/generator: voidify mkdir_parents() call
To appease coverity: CID#1401752.
2019-06-04 08:57:54 +02:00
Zbigniew Jędrzejewski-Szmek
24a4e7ff9d busctl: always prefix bus error message with local string
The message we get from the bus can be pretty bare-bones, and the user might be
confused which operation failed. Since we don't control the other side, let's
prefix the remote message with an informative prefix.
2019-06-04 08:37:24 +02:00
Zbigniew Jędrzejewski-Szmek
9e5205d2f7 sd-bus: improve bus error message for uknown properties
"Unknown interface or property." →
"Unknown interface org.freedesktop.network1.Link or property BitRates."
(I don't think the quotes are necessary. Dbus names have pretty strict rules.)
2019-06-04 08:37:04 +02:00
Zbigniew Jędrzejewski-Szmek
8210a61ad5 networkctl: log quietly if we fail to get bit rates
If we query older networked, they will be missing. This is not an error.
Also, make the error more informative, because the bus error itself might
be just "Unknown interface or property" which is not enough to understand
what is going on.
2019-06-04 08:37:04 +02:00
Michal Sekletar
71923237b1 cpu-set-util: use %d-%d format in cpu_set_to_range_string() only for actual ranges 2019-06-03 22:36:58 +02:00
Zbigniew Jędrzejewski-Szmek
4a6a2092d3 test-sleep: also print parsed modes and states
This allows the parser to be verified against on-disk config.
2019-06-04 04:15:09 +09:00
Yu Watanabe
3c2c30ebab
Merge pull request #12708 from yuwata/test-network-networkctl-tests
udevadm: add --wait-for-initialization option and use it in systemd-networkd-tests.py
2019-06-04 03:58:47 +09:00
Yu Watanabe
78690bb5d0 test-network: disable SystemCallFilter= when *SAN is enabled 2019-06-04 01:29:28 +09:00
Yu Watanabe
6d5b4efed2 test-network: add test for MTU field of 'networkctl status' 2019-06-04 01:29:28 +09:00
Yu Watanabe
bee692fd38 test-network: add tests for "networkctl delete" 2019-06-04 01:29:28 +09:00
Yu Watanabe
1ca44d7dfd test-network: move networkctl related tests to NetworkctlTests class 2019-06-04 01:29:24 +09:00
Yu Watanabe
ae760f4b16 udevadm: add --wait-for-initialization option to "udevadm info" 2019-06-04 01:28:30 +09:00
Yu Watanabe
1b47436e0e util: make device_wait_for_initialization() optionally takes timeout value 2019-06-04 01:19:43 +09:00
Yu Watanabe
f822c5d59e util: make argument "subsystem" in device_wait_for_initialization() optional 2019-06-04 01:19:43 +09:00
Zbigniew Jędrzejewski-Szmek
8f5d6a044b
Merge pull request #12619 from zachsmith/refactor-parse-sleep-config
systemd-sleep: refactor sleep conf parsing
2019-06-03 17:30:05 +02:00
Joe Richey
f8e54bf319 sd-boot: Remove unnecessary call to GetEventLog
This PR reverts #4302 and part of #7568, as the call to GetEventLog
isn't necessary to get the logs from the OS runtime.

This has already been reverted in shim, see:
    fd7c3bd920

The reasoning for the change that added this is wrong, explained below:

> According to TCG EFI Protocol Specification for TPM 2.0 family,
> all events generated after the invocation of EFI_TCG2_GET_EVENT_LOG
> shall be stored in an instance of an EFI_CONFIGURATION_TABLE aka
> EFI TCG 2.0 final events table.

This is correct and a valid reading of the TCG spec.

> Hence, it is necessary to trigger the internal switch through calling
> get_event_log() in order to allow to retrieve the logs from OS runtime.

However, this reasoning is incorrect. The "EFI TCG 2.0 final events
table" exists to allow the OS Runtime to get TCG events created during
or after the call to ExitBootServices. If systemd-boot didn't call
trigger_tcg2_final_events_table(), the call to HashLogExtendEvent will
write the event to the normal events table (i.e. the same place the
PCR 0 - 7 related events are written). Then the OS can obtain these
systemd-boot events in the same way it obtains normal events, via a
call to GetEventLog().

Tested on amd64 w/ TPM2 using the newest Linux kernel patches that
get the TPM2 formatted log:
    https://www.lkml.org/lkml/2019/5/20/1590
I confirmed that this change still lets the OS runtime obtain the log
entries created by systemd-boot.

Signed-off-by: Joe Richey <joerichey@google.com>
2019-06-03 15:47:09 +02:00
Zbigniew Jędrzejewski-Szmek
741c73c076
Merge pull request #12666 from yuwata/networkctl-show-stats
networkctl: show stats
2019-06-03 15:38:49 +02:00
Zbigniew Jędrzejewski-Szmek
2bb24885de
Merge pull request #12700 from yuwata/udev-propagate-critical-errors
udev: modernize code and propagate critical errors
2019-06-03 15:29:40 +02:00
Michal Sekletar
e7fca352ba execute: dump CPUAffinity as a range string instead of a list of CPUs
We do this already when printing the property in systemctl so be
consistent and do the same for systemd-analyze dump.
2019-06-03 15:21:52 +02:00
Yu Watanabe
81914d9f13 networkctl: drop unnecessary use of table_add_cell_full() 2019-06-03 16:43:18 +09:00
Yu Watanabe
d7aee41db3 udev: check formatting of attribute or value earlier 2019-06-03 08:35:33 +09:00
Yu Watanabe
1448820aad udev: evaluate formatting in RUN= key earlier
Closes #12291.
2019-06-03 08:35:33 +09:00
Yu Watanabe
7280153364 udev: use delete_trailing_chars() at one more place 2019-06-03 08:35:33 +09:00
Yu Watanabe
1b65f1ebc3 udev: replace xsprintf() + strpcpy() by strpcpyf() 2019-06-03 08:35:33 +09:00
Yu Watanabe
ce4f94b8e9 udev: make parser for attribute of $result harder 2019-06-03 08:35:33 +09:00
Yu Watanabe
13cd553f91 udev: split udev_event_apply_format() into small pieces
Also, this makes the function refuse invalid formatting and
propagate error in substituing variable.
2019-06-03 08:35:08 +09:00
Yu Watanabe
3c209d6070 udev: comment that $tempnode and $sysfs formats are deprecated 2019-06-02 14:15:32 +09:00
Yu Watanabe
ef315adaa4 udev: pass format type to udev_event_subst_format() 2019-06-02 14:15:32 +09:00
Yu Watanabe
7e9c23dd19 udev: rename enum subst_type -> FormatSubstitutionType 2019-06-02 14:15:32 +09:00
Yu Watanabe
25de7aa7b9 udev: modernize udev-rules.c
This does the following:
- rename enum udev_builtin_cmd -> UdevBuiltinCmd
- rename struct udev_builtin -> UdevBuiltin
- move type definitions to udev-rules.h
- move prototypes of functions defined in udev-rules.c to udev-rules.h
- drop to use strbuf
- propagate critical errors in applying rules,
- drop limitation for number of tokens per line.
2019-06-02 14:15:26 +09:00
Yu Watanabe
335dd8ba13 networkctl: show link bit rates 2019-06-01 10:24:47 +09:00
Yu Watanabe
a879e1a46e network: monitor link bit rates 2019-06-01 10:24:47 +09:00
Yu Watanabe
94a58cc1f9 bash-completion: support --stats/-s option of networkctl 2019-06-01 10:24:47 +09:00
Yu Watanabe
a459b24f7e networkctl: optionally show link statistics 2019-06-01 10:24:47 +09:00
Yu Watanabe
c095e5b02b netlink: set attribute size of IFLA_STATS and IFLA_STATS64 2019-06-01 10:24:47 +09:00
Zbigniew Jędrzejewski-Szmek
90e29fe1a5 networkctl: shorten Minimum/Maximum to min/max
This makes the output slightly "lighter" visually. min/max are well-established
forms, so there's no risk of misunderstanding. Also, not using title-case looks
a bit better.

Follow-up for c06ff86e25.

$ build/networkctl status '*'|grep MTU
                   MTU: 65536
                   MTU: 1500 (min: 68, max: 9000)
                   MTU: 1500 (max: 2048)
                   MTU: 1500 (min: 256, max: 2304)
                   MTU: 1500 (min: 68, max: 65535)
                   MTU: 1500 (min: 68, max: 65521)
                   MTU: 1500 (min: 68, max: 65535)
                   MTU: 1500 (max: 65535)
                   MTU: 1360 (min: 68, max: 65535)
2019-06-01 10:24:08 +09:00