]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agotest-network: add tests for KeepConfiguration= 12511/head
Yu Watanabe [Mon, 3 Jun 2019 04:21:13 +0000 (13:21 +0900)] 
test-network: add tests for KeepConfiguration=

4 years agoman: add documentation about KeepConfiguration
Yu Watanabe [Mon, 3 Jun 2019 06:37:25 +0000 (15:37 +0900)] 
man: add documentation about KeepConfiguration

4 years agonetwork: make KeepConfiguration=static drop DHCP addresses and routes
Yu Watanabe [Mon, 3 Jun 2019 03:33:13 +0000 (12:33 +0900)] 
network: make KeepConfiguration=static drop DHCP addresses and routes

Also, KeepConfiguration=dhcp drops static foreign addresses and routes.

4 years agonetwork: add KeepConfiguration=dhcp-on-stop
Yu Watanabe [Mon, 3 Jun 2019 17:05:26 +0000 (02:05 +0900)] 
network: add KeepConfiguration=dhcp-on-stop

The option prevents to drop lease address on stop.
By setting this, we can safely restart networkd.

4 years agonetworkd: add support to keep configuration
Susant Sahani [Mon, 3 Jun 2019 03:31:13 +0000 (12:31 +0900)] 
networkd: add support to keep configuration

4 years agoMerge pull request #12748 from keszybz/modernize-networkd-tests-style
Yu Watanabe [Thu, 6 Jun 2019 13:23:09 +0000 (22:23 +0900)] 
Merge pull request #12748 from keszybz/modernize-networkd-tests-style

Modernize networkd-tests.py style

4 years agoNEWS: add note about the CPUAffinity= changes
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 08:41:46 +0000 (10:41 +0200)] 
NEWS: add note about the CPUAffinity= changes

4 years agoMerge pull request #12508 from keszybz/no-root-checks
Yu Watanabe [Thu, 6 Jun 2019 12:31:19 +0000 (21:31 +0900)] 
Merge pull request #12508 from keszybz/no-root-checks

Drop many root checks

4 years agonetworkd-tests.py: properly escape pluses in regexps 12748/head
Zbigniew Jędrzejewski-Szmek [Thu, 6 Jun 2019 12:08:01 +0000 (14:08 +0200)] 
networkd-tests.py: properly escape pluses in regexps

Python warns that '\+' is an invalid escape. We need either '\\+' or r'\+'.

4 years agonetworkd-tests.py: remove some java-style boilerplate
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2019 10:08:09 +0000 (12:08 +0200)] 
networkd-tests.py: remove some java-style boilerplate

A class was used to put some utility functions under a namespace. But then this
namespace was inherited into classes, so the namespace split was undone. Let's
just define those functions in the module namespace.

(The Utilities class with a few functions still remain, because of the
unittest-style self.assert* craziness.)

4 years agonetworkd-tests.py: use check_output() instead of unittests' assertEqual()
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2019 10:03:01 +0000 (12:03 +0200)] 
networkd-tests.py: use check_output() instead of unittests' assertEqual()

It's pretty much the same thing, but more in pytest style, without the
unittest boilerplate.

4 years agonetworkd-tests.py: add helpers to common subprocess call patterns
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2019 09:43:28 +0000 (11:43 +0200)] 
networkd-tests.py: add helpers to common subprocess call patterns

For normal shell calls, python syntax is quite verbose. We don't need to punish
ourselves like that. In some places we would fork a shell to do argument splitting
for us. We know that our arguments can be safely split on whitespace, so let's do
that ourselves in all cases, without forking a shell.

We also expect command output to be valid text, so let's always set
universal_newlines=True.

This makes things shorter and easier to read. Development is also easier because
it's possible to paste many of the commands directly to/from a shell.

4 years agonetworkd-tests.py: remove unused import
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2019 10:42:29 +0000 (12:42 +0200)] 
networkd-tests.py: remove unused import

4 years agoDrop no longer needed halt-local.service.in
Michael Biebl [Wed, 5 Jun 2019 11:35:11 +0000 (13:35 +0200)] 
Drop no longer needed halt-local.service.in

Follow-up for commit 44508946534eee032927c263b79464832656dd6e.

4 years agoMerge pull request #12744 from yuwata/test-network-stability-dhcp-tests
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2019 12:31:24 +0000 (14:31 +0200)] 
Merge pull request #12744 from yuwata/test-network-stability-dhcp-tests

test-network: improve stability of DHCP client tests

4 years agotest-network: do not directly compare two results of "ip address" 12744/head
Yu Watanabe [Tue, 4 Jun 2019 18:57:21 +0000 (03:57 +0900)] 
test-network: do not directly compare two results of "ip address"

As it contains lifetime of the address.

4 years agoMerge pull request #11778 from anitazha/rfe_11654_dbus
Chris Down [Wed, 5 Jun 2019 09:02:00 +0000 (10:02 +0100)] 
Merge pull request #11778 from anitazha/rfe_11654_dbus

core: add ExecStartXYZEx= with dbus support for executable prefixes

4 years agoudev: propagate errors in udev_event_execute_rules()
Yu Watanabe [Tue, 4 Jun 2019 18:09:20 +0000 (03:09 +0900)] 
udev: propagate errors in udev_event_execute_rules()

And do not set initialized flag to the device.

4 years agoudevadm trigger: log errors and return first failure 12508/head
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jun 2019 07:54:54 +0000 (09:54 +0200)] 
udevadm trigger: log errors and return first failure

When udevadm trigger is called, the list of devices to trigger is always
generated through enumeration, and devices can come and go, so we should not
treat -ENOENT as a failure. But other types of failure should be logged.
It seems they were logged until baa30fbc2c04b23209d0b8fb3c86cd15ef9ea81a.

Also, return the first error. (I'm not sure if there are other failure modes
which we want to ignore. If they are, they'll need to be whitelisted like
-ENOENT.).

4 years agotest-network: do not allow addresses in tentative state
Yu Watanabe [Tue, 4 Jun 2019 18:55:32 +0000 (03:55 +0900)] 
test-network: do not allow addresses in tentative state

4 years agoman: mention quoting in description of Parameters=
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 11:44:46 +0000 (13:44 +0200)] 
man: mention quoting in description of Parameters=

Also add a short example how to translate nspawn command line to .nspawn settings.

Fixes #12703.

4 years agoMerge pull request #12741 from keszybz/bpf-firewall-warning
Yu Watanabe [Tue, 4 Jun 2019 19:01:44 +0000 (04:01 +0900)] 
Merge pull request #12741 from keszybz/bpf-firewall-warning

Silence BPF firewall warning when not useful

4 years agoMerge pull request #12737 from keszybz/meson-man-nspawn
Yu Watanabe [Tue, 4 Jun 2019 17:45:39 +0000 (02:45 +0900)] 
Merge pull request #12737 from keszybz/meson-man-nspawn

meson: escape dots in man/man helper

4 years agoMerge pull request #12661 from mrc0mmand/debug-journalctl-flush
Yu Watanabe [Tue, 4 Jun 2019 15:46:29 +0000 (00:46 +0900)] 
Merge pull request #12661 from mrc0mmand/debug-journalctl-flush

journal: disable varlink timeout for journalctl --flush or friends

4 years agoman/man: refer to the right build directory in the helpers 12737/head
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 15:33:59 +0000 (17:33 +0200)] 
man/man: refer to the right build directory in the helpers

I have no idea how this one slipped through.

4 years agoSilence warning about BPF firewall in containers 12741/head
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 15:22:12 +0000 (17:22 +0200)] 
Silence warning about BPF firewall in containers

We'd get a warning on every nspawn invocation:
dev-hugepages.mount: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
(This warning is only shown for the first unit using IP firewalling.)

Before the previous commit, I'd generally get a warning about systemd-udev.service, even though that service is
not started in containers. But are still many other units which that declare a
firewall, which is currently unsupported in containers. Let's stop warning
about this.

The warning is still emitted e.g. if legacy cgroups are used. This is something
that can be configured, so it makes more sense to emit the warning.

4 years agoMove warning about unsupported BPF firewall right before the firewall would be created
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 13:01:27 +0000 (15:01 +0200)] 
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.

4 years agojournalctl: make 'journalctl --flush' or friends not fail with varlink timeout 12661/head
Yu Watanabe [Fri, 24 May 2019 13:32:08 +0000 (22:32 +0900)] 
journalctl: make 'journalctl --flush' or friends not fail with varlink timeout

Closes #12570.

4 years agomeson: escape dots in man/man helper
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 10:56:14 +0000 (12:56 +0200)] 
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.

4 years agoMerge pull request #12733 from keszybz/sd-bus-error-reporting
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 10:01:52 +0000 (12:01 +0200)] 
Merge pull request #12733 from keszybz/sd-bus-error-reporting

Bus error reporting improvements

4 years agoMerge pull request #12734 from keszybz/cpu-set-util-on-i386
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 10:01:20 +0000 (12:01 +0200)] 
Merge pull request #12734 from keszybz/cpu-set-util-on-i386

Fixes for test-cpu-set-util on i386

4 years agobash-completion: support "networkctl delete"
Yu Watanabe [Tue, 4 Jun 2019 08:13:07 +0000 (17:13 +0900)] 
bash-completion: support "networkctl delete"

4 years agojournalctl: mention --smart-relinquish-var in log message
Yu Watanabe [Mon, 27 May 2019 20:17:27 +0000 (05:17 +0900)] 
journalctl: mention --smart-relinquish-var in log message

4 years agojournalctl: fix error cause in log message
Yu Watanabe [Fri, 24 May 2019 13:22:21 +0000 (22:22 +0900)] 
journalctl: fix error cause in log message

If varlink_call() returns negative errno, then `error` is null.

4 years agotest-cpu-set-util: fix allocation size check on i386 12734/head
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 07:40:38 +0000 (09:40 +0200)] 
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).

4 years agotest-cpu-set-util: fix comparison for allocation size
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 07:19:04 +0000 (09:19 +0200)] 
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.

4 years agonetwork: fix UBSAN issue
Yu Watanabe [Mon, 3 Jun 2019 14:29:07 +0000 (23:29 +0900)] 
network: fix UBSAN issue

Closes #12724.

4 years agonetworkctl: re-cast value stored in Set with INT_TO_PTR()
Yu Watanabe [Tue, 4 Jun 2019 05:00:51 +0000 (14:00 +0900)] 
networkctl: re-cast value stored in Set with INT_TO_PTR()

4 years agoshared/generator: voidify mkdir_parents() call
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jun 2019 06:57:54 +0000 (08:57 +0200)] 
shared/generator: voidify mkdir_parents() call

To appease coverity: CID#1401752.

4 years agobusctl: always prefix bus error message with local string 12733/head
Zbigniew Jędrzejewski-Szmek [Fri, 31 May 2019 14:21:56 +0000 (16:21 +0200)] 
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.

4 years agosd-bus: improve bus error message for uknown properties
Zbigniew Jędrzejewski-Szmek [Fri, 31 May 2019 13:33:46 +0000 (15:33 +0200)] 
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.)

4 years agonetworkctl: log quietly if we fail to get bit rates
Zbigniew Jędrzejewski-Szmek [Fri, 31 May 2019 14:08:31 +0000 (16:08 +0200)] 
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.

4 years agocpu-set-util: use %d-%d format in cpu_set_to_range_string() only for actual ranges
Michal Sekletar [Mon, 3 Jun 2019 08:12:35 +0000 (10:12 +0200)] 
cpu-set-util: use %d-%d format in  cpu_set_to_range_string() only for actual ranges

4 years agotest-sleep: also print parsed modes and states
Zbigniew Jędrzejewski-Szmek [Wed, 29 May 2019 14:08:47 +0000 (16:08 +0200)] 
test-sleep: also print parsed modes and states

This allows the parser to be verified against on-disk config.

4 years agoMerge pull request #12708 from yuwata/test-network-networkctl-tests
Yu Watanabe [Mon, 3 Jun 2019 18:58:47 +0000 (03:58 +0900)] 
Merge pull request #12708 from yuwata/test-network-networkctl-tests

udevadm: add --wait-for-initialization option and use it in systemd-networkd-tests.py

4 years agotest-network: disable SystemCallFilter= when *SAN is enabled 12708/head
Yu Watanabe [Sat, 1 Jun 2019 06:55:16 +0000 (15:55 +0900)] 
test-network: disable SystemCallFilter= when *SAN is enabled

4 years agotest-network: add test for MTU field of 'networkctl status'
Yu Watanabe [Sat, 1 Jun 2019 06:44:04 +0000 (15:44 +0900)] 
test-network: add test for MTU field of 'networkctl status'

4 years agotest-network: add tests for "networkctl delete"
Yu Watanabe [Fri, 31 May 2019 07:11:53 +0000 (16:11 +0900)] 
test-network: add tests for "networkctl delete"

4 years agotest-network: move networkctl related tests to NetworkctlTests class
Yu Watanabe [Sat, 1 Jun 2019 01:29:08 +0000 (10:29 +0900)] 
test-network: move networkctl related tests to NetworkctlTests class

4 years agoudevadm: add --wait-for-initialization option to "udevadm info"
Yu Watanabe [Sat, 1 Jun 2019 16:02:09 +0000 (01:02 +0900)] 
udevadm: add --wait-for-initialization option to "udevadm info"

4 years agoutil: make device_wait_for_initialization() optionally takes timeout value
Yu Watanabe [Sat, 1 Jun 2019 16:01:31 +0000 (01:01 +0900)] 
util: make device_wait_for_initialization() optionally takes timeout value

4 years agoutil: make argument "subsystem" in device_wait_for_initialization() optional
Yu Watanabe [Sat, 1 Jun 2019 15:44:02 +0000 (00:44 +0900)] 
util: make argument "subsystem" in device_wait_for_initialization() optional

4 years agoMerge pull request #12619 from zachsmith/refactor-parse-sleep-config
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jun 2019 15:30:05 +0000 (17:30 +0200)] 
Merge pull request #12619 from zachsmith/refactor-parse-sleep-config

systemd-sleep: refactor sleep conf parsing

4 years agosd-boot: Remove unnecessary call to GetEventLog
Joe Richey [Fri, 31 May 2019 18:24:20 +0000 (11:24 -0700)] 
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:
    https://github.com/rhboot/shim/commit/fd7c3bd920ba39082cb7c619afb7203d150a4cd3

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>
4 years agoMerge pull request #12666 from yuwata/networkctl-show-stats
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jun 2019 13:38:49 +0000 (15:38 +0200)] 
Merge pull request #12666 from yuwata/networkctl-show-stats

networkctl: show stats

4 years agoMerge pull request #12700 from yuwata/udev-propagate-critical-errors
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jun 2019 13:29:40 +0000 (15:29 +0200)] 
Merge pull request #12700 from yuwata/udev-propagate-critical-errors

udev: modernize code and propagate critical errors

4 years agoexecute: dump CPUAffinity as a range string instead of a list of CPUs
Michal Sekletar [Fri, 31 May 2019 16:02:20 +0000 (18:02 +0200)] 
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.

4 years agonetworkctl: drop unnecessary use of table_add_cell_full() 12666/head
Yu Watanabe [Mon, 3 Jun 2019 07:04:16 +0000 (16:04 +0900)] 
networkctl: drop unnecessary use of table_add_cell_full()

4 years agoudev: check formatting of attribute or value earlier 12700/head
Yu Watanabe [Tue, 30 Apr 2019 20:22:19 +0000 (22:22 +0200)] 
udev: check formatting of attribute or value earlier

4 years agoudev: evaluate formatting in RUN= key earlier
Yu Watanabe [Mon, 29 Apr 2019 20:24:25 +0000 (22:24 +0200)] 
udev: evaluate formatting in RUN= key earlier

Closes #12291.

4 years agoudev: use delete_trailing_chars() at one more place
Yu Watanabe [Tue, 30 Apr 2019 19:01:44 +0000 (21:01 +0200)] 
udev: use delete_trailing_chars() at one more place

4 years agoudev: replace xsprintf() + strpcpy() by strpcpyf()
Yu Watanabe [Tue, 30 Apr 2019 18:35:08 +0000 (20:35 +0200)] 
udev: replace xsprintf() + strpcpy() by strpcpyf()

4 years agoudev: make parser for attribute of $result harder
Yu Watanabe [Tue, 30 Apr 2019 18:30:49 +0000 (20:30 +0200)] 
udev: make parser for attribute of $result harder

4 years agoudev: split udev_event_apply_format() into small pieces
Yu Watanabe [Tue, 30 Apr 2019 18:09:49 +0000 (20:09 +0200)] 
udev: split udev_event_apply_format() into small pieces

Also, this makes the function refuse invalid formatting and
propagate error in substituing variable.

4 years agoudev: comment that $tempnode and $sysfs formats are deprecated
Yu Watanabe [Tue, 30 Apr 2019 17:23:44 +0000 (19:23 +0200)] 
udev: comment that $tempnode and $sysfs formats are deprecated

4 years agoudev: pass format type to udev_event_subst_format()
Yu Watanabe [Tue, 30 Apr 2019 17:18:33 +0000 (19:18 +0200)] 
udev: pass format type to udev_event_subst_format()

4 years agoudev: rename enum subst_type -> FormatSubstitutionType
Yu Watanabe [Tue, 30 Apr 2019 17:13:58 +0000 (19:13 +0200)] 
udev: rename enum subst_type -> FormatSubstitutionType

4 years agoudev: modernize udev-rules.c
Yu Watanabe [Wed, 24 Apr 2019 23:21:11 +0000 (01:21 +0200)] 
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.

4 years agonetworkctl: show link bit rates
Yu Watanabe [Sat, 25 May 2019 15:22:05 +0000 (00:22 +0900)] 
networkctl: show link bit rates

4 years agonetwork: monitor link bit rates
Yu Watanabe [Fri, 24 May 2019 20:08:13 +0000 (05:08 +0900)] 
network: monitor link bit rates

4 years agobash-completion: support --stats/-s option of networkctl
Yu Watanabe [Fri, 24 May 2019 15:40:38 +0000 (00:40 +0900)] 
bash-completion: support --stats/-s option of networkctl

4 years agonetworkctl: optionally show link statistics
Yu Watanabe [Fri, 24 May 2019 15:37:48 +0000 (00:37 +0900)] 
networkctl: optionally show link statistics

4 years agonetlink: set attribute size of IFLA_STATS and IFLA_STATS64
Yu Watanabe [Fri, 24 May 2019 15:37:00 +0000 (00:37 +0900)] 
netlink: set attribute size of IFLA_STATS and IFLA_STATS64

4 years agonetworkctl: shorten Minimum/Maximum to min/max
Zbigniew Jędrzejewski-Szmek [Fri, 31 May 2019 08:56:45 +0000 (10:56 +0200)] 
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 c06ff86e25db4fdb4e962baf812ed28d8d0c1050.

$ 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)

4 years agodbus-execute: make transfer of CPUAffinity endian safe (#12711)
Michal Sekletar [Fri, 31 May 2019 13:23:23 +0000 (15:23 +0200)] 
dbus-execute: make transfer of CPUAffinity endian safe (#12711)

We store the affinity mask in the native endian. However, over D-Bus we
must transfer the mask in little endian byte order.

This is the second part of c367f996f5f091a63f812f0140b304c649be77fc.

4 years agocoredump: fixed bug - some coredump temp files could be lost
Krayushkin Konstantin [Fri, 31 May 2019 08:16:17 +0000 (11:16 +0300)] 
coredump: fixed bug - some coredump temp files could be lost

If the machine was suddenly shutted down (hard reboot for example) while
processing core dump, temp files created manually (not with a O_TEMPFILE flag)
stay in the system. After reboot systemd-coredump treat them as usual files, so
they wouldn't be rotated and shall pollute the filesystem.

Solution is to simply add those temp files to systemd-tmpfiles configs.

4 years agoMerge pull request #12707 from yuwata/test-network-lsan-options
Zbigniew Jędrzejewski-Szmek [Fri, 31 May 2019 09:38:18 +0000 (11:38 +0200)] 
Merge pull request #12707 from yuwata/test-network-lsan-options

test-network: add --lsan-options option

4 years agonetworkctl: do not show zero maximum MTU
Yu Watanabe [Thu, 30 May 2019 18:30:31 +0000 (03:30 +0900)] 
networkctl: do not show zero maximum MTU

4 years agotest-network: show systemd-networkd.service 12707/head
Yu Watanabe [Fri, 31 May 2019 04:54:08 +0000 (13:54 +0900)] 
test-network: show systemd-networkd.service

As there may exist some other drop-in configs.

4 years agocore: add ExecStartXYZEx= with dbus support for executable prefixes 11778/head
Anita Zhang [Wed, 20 Feb 2019 22:53:58 +0000 (14:53 -0800)] 
core: add ExecStartXYZEx= with dbus support for executable prefixes

Closes #11654

4 years agotest-network: stop service before editing unit file
Yu Watanabe [Fri, 31 May 2019 00:52:27 +0000 (09:52 +0900)] 
test-network: stop service before editing unit file

4 years agotest-network: add --lsan-options option
Yu Watanabe [Thu, 30 May 2019 23:49:48 +0000 (08:49 +0900)] 
test-network: add --lsan-options option

4 years agoMerge pull request #12705 from keszybz/varlink-json-fix-and-two-cleanups
Yu Watanabe [Thu, 30 May 2019 23:28:37 +0000 (08:28 +0900)] 
Merge pull request #12705 from keszybz/varlink-json-fix-and-two-cleanups

Varlink json fix and two cleanups

4 years agosd-journal: voidify call 12705/head
Zbigniew Jędrzejewski-Szmek [Thu, 30 May 2019 21:05:31 +0000 (23:05 +0200)] 
sd-journal: voidify call

To appease coverity, CID#1400674.

4 years agonetworkd: shorter two error statements a bit
Zbigniew Jędrzejewski-Szmek [Thu, 30 May 2019 20:56:03 +0000 (22:56 +0200)] 
networkd: shorter two error statements a bit

Also let's not use a cast if we don't have to.

4 years agobasic/memory-util: do not "return" anything from memzero() macro
Zbigniew Jędrzejewski-Szmek [Thu, 30 May 2019 20:49:00 +0000 (22:49 +0200)] 
basic/memory-util: do not "return" anything from memzero() macro

The macro is not used in expressions, so we don't need the ternary statement.

4 years agosystemctl: process all units matched by a glob in the cat verb by default
Frantisek Sumsal [Thu, 11 Apr 2019 12:34:32 +0000 (14:34 +0200)] 
systemctl: process all units matched by a glob in the cat verb by default

Originally, `systemctl cat` would match only active units, for example:

$ systemctl cat sshd.service

would cat the sshd.service unit file even if the service was inactive.
However:

$ systemctl cat ssh*

would show it only if it was active.

Let's unify the behavior and cat all unit files regardless of a state,
if no state was given explicitly to filter.

4 years agoshared/varlink: add missing va_end()
Zbigniew Jędrzejewski-Szmek [Thu, 30 May 2019 18:36:54 +0000 (20:36 +0200)] 
shared/varlink: add missing va_end()

Coverity CID#1401347.

4 years agoRevert "varlink: initialize Varlink with 0"
Zbigniew Jędrzejewski-Szmek [Thu, 30 May 2019 17:39:05 +0000 (19:39 +0200)] 
Revert "varlink: initialize Varlink with 0"

This reverts commit 8688c29b5aece49805a244676cba5bba0196f509, but leaves the
reproducer. Structured assignment should be enough to fully initialize the
variable and new0 is not necessary.

4 years agoMerge pull request #12699 from yuwata/test-network-argparse
Yu Watanabe [Thu, 30 May 2019 17:33:10 +0000 (02:33 +0900)] 
Merge pull request #12699 from yuwata/test-network-argparse

test-network: make path to networkd or friends configurable

4 years agoshared/varlink: add missing terminator in json strings
Zbigniew Jędrzejewski-Szmek [Thu, 30 May 2019 16:35:22 +0000 (18:35 +0200)] 
shared/varlink: add missing terminator in json strings

Should finally fix oss-fuzz-14688.
8688c29b5aece49805a244676cba5bba0196f509 wasn't enough.

The buffer retrieved from memstream has the size that the same as the written
data. When we write do write(f, s, strlen(s)), then no terminating NUL is written,
and the buffer is not (necessarilly) a proper C string.

4 years agonetworkd: rewrite condition to make it easier to understand
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 14:11:55 +0000 (16:11 +0200)] 
networkd: rewrite condition to make it easier to understand

4 years agotest-user-util: add simple test for make_salt()
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 12:35:20 +0000 (14:35 +0200)] 
test-user-util: add simple test for make_salt()

4 years agosystemd-sleep: (bug) honor s2h and hybrid_sleep disable settings 12619/head
Zach Smith [Thu, 30 May 2019 13:06:51 +0000 (06:06 -0700)] 
systemd-sleep: (bug) honor s2h and hybrid_sleep disable settings

4 years agosystemd-sleep: refactor sleep config parsing
Zach Smith [Mon, 20 May 2019 05:43:29 +0000 (22:43 -0700)] 
systemd-sleep: refactor sleep config parsing

remove verb from parse

refactor required fields checks

refactor allow settings

4 years agobash-completion: correctly react to an unescaped unit name
Frantisek Sumsal [Thu, 25 Apr 2019 10:33:25 +0000 (12:33 +0200)] 
bash-completion: correctly react to an unescaped unit name

4 years agoMerge pull request #12636 from mbroz/master
Zbigniew Jędrzejewski-Szmek [Thu, 30 May 2019 12:27:22 +0000 (14:27 +0200)] 
Merge pull request #12636 from mbroz/master

Cryptsetup: call crypt_load() once for LUKS and support LUKS2 tokens

4 years agoutil: introduce strnpcpy() and strnscpy()
Yu Watanabe [Tue, 30 Apr 2019 16:56:33 +0000 (18:56 +0200)] 
util: introduce strnpcpy() and strnscpy()

4 years agoutil: introduce PTR_TO_MODE and MODE_TO_PTR macros
Yu Watanabe [Wed, 24 Apr 2019 23:19:07 +0000 (01:19 +0200)] 
util: introduce PTR_TO_MODE and MODE_TO_PTR macros

4 years agonetworkctl: fix memleak 12699/head
Yu Watanabe [Thu, 30 May 2019 11:58:33 +0000 (20:58 +0900)] 
networkctl: fix memleak

Closes #12701.