platform/upstream/systemd.git
5 years agotest: add test for sd_netlink_message_enter_array()
Yu Watanabe [Thu, 4 Jul 2019 05:56:54 +0000 (14:56 +0900)]
test: add test for sd_netlink_message_enter_array()

5 years agosd-netlink: add CTRL_ATTR_MCAST_GROUPS
Yu Watanabe [Thu, 4 Jul 2019 05:31:23 +0000 (14:31 +0900)]
sd-netlink: add CTRL_ATTR_MCAST_GROUPS

5 years agosd-netlink: drop unnecessary 'else'
Yu Watanabe [Thu, 4 Jul 2019 08:11:05 +0000 (17:11 +0900)]
sd-netlink: drop unnecessary 'else'

5 years agosd-netlink: introduce sd_netlink_message_enter_array()
Yu Watanabe [Fri, 28 Jun 2019 18:30:53 +0000 (03:30 +0900)]
sd-netlink: introduce sd_netlink_message_enter_array()

5 years agosd-netlink: fix inverted log message
Yu Watanabe [Fri, 28 Jun 2019 18:27:24 +0000 (03:27 +0900)]
sd-netlink: fix inverted log message

5 years agoMerge pull request #12946 from poettering/blockdev-tweaks
Yu Watanabe [Thu, 4 Jul 2019 03:36:11 +0000 (12:36 +0900)]
Merge pull request #12946 from poettering/blockdev-tweaks

three small blockdev-util.[ch] tweaks

5 years agovarlink: allow using varlink_wait() even with a server
Lennart Poettering [Wed, 29 May 2019 11:56:27 +0000 (13:56 +0200)]
varlink: allow using varlink_wait() even with a server

This call can be useful even if a server object is declared.

(Originally this was not supported, because a server typically needs to
handle multiple connections, and thus a synchronous wait on one would
starve the others out. But in some cases it might make sense to have
varlink point-to-point connections — i.e. where the server only handles
a single connection ever — and there it makes sense to synchronously
wait on the one connection).

5 years agojson: use JSON_VARIANT_ARRAY_FOREACH() where we can
Lennart Poettering [Tue, 28 May 2019 12:19:51 +0000 (14:19 +0200)]
json: use JSON_VARIANT_ARRAY_FOREACH() where we can

5 years agologind: drop old-style header from .sym file in favour of SPDX
Lennart Poettering [Wed, 29 May 2019 20:10:12 +0000 (22:10 +0200)]
logind: drop old-style header from .sym file in favour of SPDX

5 years agoAdded ACCEL_MOUNT_MATRIX for Asus Q551LN in hwdb/60-sensor.hwdb
Connor Reeder [Wed, 3 Jul 2019 18:42:45 +0000 (14:42 -0400)]
Added ACCEL_MOUNT_MATRIX for Asus Q551LN in hwdb/60-sensor.hwdb

5 years agoblockdev-util: let us know if block_get_whole_disk() did anything
Lennart Poettering [Tue, 21 May 2019 16:00:54 +0000 (18:00 +0200)]
blockdev-util: let us know if block_get_whole_disk() did anything

5 years agoblockdev: filter out invalid block devices early
Lennart Poettering [Tue, 21 May 2019 16:00:09 +0000 (18:00 +0200)]
blockdev: filter out invalid block devices early

5 years agoblockdev-util: propagate actual error
Lennart Poettering [Tue, 21 May 2019 16:00:32 +0000 (18:00 +0200)]
blockdev-util: propagate actual error

5 years agoman: document tmpfiles.d/ user/group resolvability needs
Lennart Poettering [Wed, 3 Jul 2019 11:04:11 +0000 (13:04 +0200)]
man: document tmpfiles.d/ user/group resolvability needs

5 years agodebug-generator: enable custom systemd.debug_shell tty
Jan Synacek [Thu, 25 Apr 2019 10:19:16 +0000 (12:19 +0200)]
debug-generator: enable custom systemd.debug_shell tty

5 years agoMerge pull request #12912 from yuwata/network-move-functions
Zbigniew Jędrzejewski-Szmek [Tue, 2 Jul 2019 07:46:38 +0000 (09:46 +0200)]
Merge pull request #12912 from yuwata/network-move-functions

network: move functions

5 years agotest-network: add udev related tests for networkctl
Yu Watanabe [Sat, 1 Jun 2019 01:31:09 +0000 (10:31 +0900)]
test-network: add udev related tests for networkctl

5 years agoMerge pull request #12888 from yuwata/network-udev-property-support
Zbigniew Jędrzejewski-Szmek [Mon, 1 Jul 2019 18:33:24 +0000 (20:33 +0200)]
Merge pull request #12888 from yuwata/network-udev-property-support

network,udev: add Property= setting in [Match] section

5 years agoudev: accept lines which have only PROGRAM=
Yu Watanabe [Sat, 29 Jun 2019 20:33:53 +0000 (05:33 +0900)]
udev: accept lines which have only PROGRAM=

As PROGRAM= may cause side effect, and users may expect that.

5 years agoMerge pull request #12916 from yuwata/meson-drop-duplicated-line
Michael Biebl [Sun, 30 Jun 2019 23:39:35 +0000 (01:39 +0200)]
Merge pull request #12916 from yuwata/meson-drop-duplicated-line

meson: drop duplicated source

5 years agotest-network: add test for Property= in [Match] section
Yu Watanabe [Sat, 29 Jun 2019 17:28:42 +0000 (02:28 +0900)]
test-network: add test for Property= in [Match] section

5 years agomeson: drop duplicated source
Yu Watanabe [Sun, 30 Jun 2019 21:44:40 +0000 (06:44 +0900)]
meson: drop duplicated source

5 years agotest: add tests for config_parse_match_{strv,ifnames}()
Yu Watanabe [Thu, 27 Jun 2019 13:03:02 +0000 (22:03 +0900)]
test: add tests for config_parse_match_{strv,ifnames}()

5 years agoman: fix wrong udev property name
Yu Watanabe [Sat, 22 Jun 2019 19:05:51 +0000 (04:05 +0900)]
man: fix wrong udev property name

5 years agonetwork,udev: add Property= setting in [Match] section
Yu Watanabe [Sat, 22 Jun 2019 16:44:13 +0000 (01:44 +0900)]
network,udev: add Property= setting in [Match] section

Closes #5665.

5 years agonetwork,udev: make net_match_config() take sd_device
Yu Watanabe [Sat, 22 Jun 2019 16:08:51 +0000 (01:08 +0900)]
network,udev: make net_match_config() take sd_device

5 years agonetwork,udev: fix multiple invert matching lines
Yu Watanabe [Sat, 22 Jun 2019 18:18:52 +0000 (03:18 +0900)]
network,udev: fix multiple invert matching lines

Previously,
```
[Match]
Name=!aaa
Name=!bbb
```
does not work. This fixes the issue.

5 years agonetworkctl: do not show '(null)' in HW Address entry
Yu Watanabe [Sat, 29 Jun 2019 17:54:35 +0000 (02:54 +0900)]
networkctl: do not show '(null)' in HW Address entry

This also fixes indentation.

5 years agonetwork: move prototypes related to network Network bus objects to networkd-network...
Yu Watanabe [Sat, 29 Jun 2019 20:10:35 +0000 (05:10 +0900)]
network: move prototypes related to network Network bus objects to networkd-network-bus.h

5 years agoMerge pull request #12910 from keszybz/udev-kvm
Yu Watanabe [Sat, 29 Jun 2019 19:51:05 +0000 (04:51 +0900)]
Merge pull request #12910 from keszybz/udev-kvm

Fix permissions on /dev/kvm

5 years agonetwork: move DHCP server related functions to networkd-dhcp-server.c
Yu Watanabe [Sat, 29 Jun 2019 19:33:34 +0000 (04:33 +0900)]
network: move DHCP server related functions to networkd-dhcp-server.c

5 years agonetwork: move DHCP6 related code from networkd-manager.c to networkd-dhcp6.c
Yu Watanabe [Sat, 29 Jun 2019 19:09:51 +0000 (04:09 +0900)]
network: move DHCP6 related code from networkd-manager.c to networkd-dhcp6.c

5 years agonetwork: move conf parsers and function prototypes
Yu Watanabe [Sat, 29 Jun 2019 18:57:47 +0000 (03:57 +0900)]
network: move conf parsers and function prototypes

5 years agoMerge pull request #12903 from keszybz/condition-quoting
Yu Watanabe [Sat, 29 Jun 2019 19:10:40 +0000 (04:10 +0900)]
Merge pull request #12903 from keszybz/condition-quoting

Condition quoting

5 years agotest-condition: do not accidentally treat error as passing condition
Zbigniew Jędrzejewski-Szmek [Sat, 29 Jun 2019 15:06:30 +0000 (17:06 +0200)]
test-condition: do not accidentally treat error as passing condition

condition_test returns 0, 1, or error.

5 years agoTreat kernel version condition as a list of quoted checks
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jun 2019 08:58:06 +0000 (10:58 +0200)]
Treat kernel version condition as a list of quoted checks

Before only one comparison was allowed. Let's make this more flexible:
ConditionKernelVersion = ">=4.0" "<=4.5"

Fixes #12881.

This also fixes expressions like "ConditionKernelVersion=>" which would
evaluate as true.

5 years agotest-execute: add test for ConditionKernelVersion= with quotation
Yu Watanabe [Thu, 27 Jun 2019 14:11:34 +0000 (23:11 +0900)]
test-execute: add test for ConditionKernelVersion= with quotation

5 years agoMerge pull request #12907 from yuwata/meson-default-libidn2
Zbigniew Jędrzejewski-Szmek [Sat, 29 Jun 2019 14:25:52 +0000 (16:25 +0200)]
Merge pull request #12907 from yuwata/meson-default-libidn2

meson: use libidn2 and drop udev debug option

5 years agoudev: fix wrong event source to set description
Yu Watanabe [Fri, 28 Jun 2019 22:26:02 +0000 (07:26 +0900)]
udev: fix wrong event source to set description

5 years agoMerge pull request #12908 from yuwata/udevadm-completion-action
Zbigniew Jędrzejewski-Szmek [Sat, 29 Jun 2019 14:22:22 +0000 (16:22 +0200)]
Merge pull request #12908 from yuwata/udevadm-completion-action

udevadm: support special value 'help' for --action option

5 years agoudev: don't force device ownership and mode on every event
Zbigniew Jędrzejewski-Szmek [Sat, 29 Jun 2019 13:08:11 +0000 (15:08 +0200)]
udev: don't force device ownership and mode on every event

This partially reverts 25de7aa7b90c23d33ea50ada1e50c5834a414237. I don't think the
change was intended there.

The problem I'm trying to solve: for /dev/kvm we get first an ADD uevent, and
then CHANGE whenever something connects or disconnects to the character device.
The rules in 50-default-udev.rules set UID, GID, and MODE on ADD, but not on
CHANGE. When the change event happens, we would reset the ownership and
permissions.

This happens because node_permissions_apply() would (after 25de7aa7b90c23d33)
set uid=gid=0 if they weren't set by the rules.

So let's only pass uid/gid/mode to node_permissions_apply() if appropriately
configured. Also let node_permissions_apply() do the skip of uid/gid/mode if
not set, and rename "always_apply" to more closely reflect its meaning.

5 years agoudev: tiny fix to debug message
Zbigniew Jędrzejewski-Szmek [Sat, 29 Jun 2019 12:56:45 +0000 (14:56 +0200)]
udev: tiny fix to debug message

5 years agobash-completion: udevadm: list all possible values for --action option
Yu Watanabe [Fri, 28 Jun 2019 19:08:18 +0000 (04:08 +0900)]
bash-completion: udevadm: list all possible values for --action option

5 years agoudevadm: support special value 'help' for --action option
Yu Watanabe [Fri, 28 Jun 2019 19:03:06 +0000 (04:03 +0900)]
udevadm: support special value 'help' for --action option

5 years agosd-device: introduce dump_device_action_table()
Yu Watanabe [Fri, 28 Jun 2019 18:49:20 +0000 (03:49 +0900)]
sd-device: introduce dump_device_action_table()

Will be used in later commits.

5 years agoMerge pull request #12905 from keszybz/udev-warnings
Yu Watanabe [Fri, 28 Jun 2019 18:35:12 +0000 (03:35 +0900)]
Merge pull request #12905 from keszybz/udev-warnings

Udev warnings

5 years agoNEWS: mention that the libidn2 is used by default
Yu Watanabe [Fri, 28 Jun 2019 18:18:43 +0000 (03:18 +0900)]
NEWS: mention that the libidn2 is used by default

5 years agomeson: default to use libidn2 if both libidn2 and libidn are installed
Yu Watanabe [Fri, 28 Jun 2019 18:13:30 +0000 (03:13 +0900)]
meson: default to use libidn2 if both libidn2 and libidn are installed

5 years agomeson: drop unused debug option
Yu Watanabe [Fri, 28 Jun 2019 18:06:11 +0000 (03:06 +0900)]
meson: drop unused debug option

5 years agoMerge pull request #12887 from fbuihuu/coredump-cleanup-part-1
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jun 2019 14:25:46 +0000 (16:25 +0200)]
Merge pull request #12887 from fbuihuu/coredump-cleanup-part-1

Coredump cleanup part 1

5 years agoudev-rules: add more info to errors about attr formats
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jun 2019 14:17:30 +0000 (16:17 +0200)]
udev-rules: add more info to errors about attr formats

5 years agoudev-rules: add precise information to rule failure logs
Zbigniew Jędrzejewski-Szmek [Thu, 27 Jun 2019 08:47:56 +0000 (10:47 +0200)]
udev-rules: add precise information to rule failure logs

It is pretty hard to figure out what the problem actually is, esp. when the rule
is long.

On my machine:
systemd[1]: Starting udev Kernel Device Manager...
systemd-udevd[217399]: /usr/lib/udev/rules.d/11-dm-lvm.rules:40 Invalid value for OPTIONS key, ignoring: 'event_timeout=180'
systemd-udevd[217399]: /usr/lib/udev/rules.d/11-dm-lvm.rules:40 The line takes no effect, ignoring.
systemd-udevd[217399]: /etc/udev/rules.d/60-ipath.rules:4 Invalid value "kcopy/%02n" for NAME (char 7: invalid substitution type), ignoring, but please fix it.
systemd-udevd[217399]: /usr/lib/udev/rules.d/65-md-incremental.rules:28 Invalid value "/sbin/mdadm -I $env{DEVNAME} --export $devnode --offroot ${DEVLINKS}" for IMPORT (char 58: invalid substitution type), ignoring, but please fix it.
systemd-udevd[217399]: /etc/udev/rules.d/73-special-net-names.rules:14 Invalid value "/bin/sh -ec 'D=${DEVPATH#*/vio/}; D=${D%%%%/*}; D=${D#????}; D=${D#0}; D=${D#0}; D=${D#0}; D=${D#0}; echo ${D:-0}'" for PROGRAM (char 16: invalid substitution type), ignoring, but please fix it.
systemd-udevd[217399]: /usr/lib/udev/rules.d/84-nm-drivers.rules:10 Invalid value "/bin/sh -c 'ethtool -i $1 | sed -n s/^driver:\ //p' -- $env{INTERFACE}" for PROGRAM (char 24: invalid substitution type), ignoring, but please fix it.
systemd-udevd[217399]: /usr/lib/udev/rules.d/90-libgpod.rules:19 IMPORT key takes '==' or '!=' operator, assuming '==', but please fix it.
systemd-udevd[217399]: /usr/lib/udev/rules.d/90-libgpod.rules:23 IMPORT key takes '==' or '!=' operator, assuming '==', but please fix it.
systemd-udevd[217399]: /usr/lib/udev/rules.d/99-vmware-scsi-udev.rules:5 Invalid value "/bin/sh -c 'echo 180 >/sys$DEVPATH/device/timeout'" for RUN (char 27: invalid substitution type), ignoring, but please fix it.
systemd-udevd[217399]: /usr/lib/udev/rules.d/99-vmware-scsi-udev.rules:6 Invalid value "/bin/sh -c 'echo 180 >/sys$DEVPATH/device/timeout'" for RUN (char 27: invalid substitution type), ignoring, but please fix it.
systemd[1]: Started udev Kernel Device Manager.

5 years agoudev-event: use normal pointer ops where appropriate
Zbigniew Jędrzejewski-Szmek [Thu, 27 Jun 2019 06:58:00 +0000 (08:58 +0200)]
udev-event: use normal pointer ops where appropriate

5 years agoudev: move rule structure definitions into the .c file
Zbigniew Jędrzejewski-Szmek [Thu, 27 Jun 2019 06:51:53 +0000 (08:51 +0200)]
udev: move rule structure definitions into the .c file

They are (and should) only be used there, no need to expose them.

5 years agoudev: move rules logging functions into the .c file
Zbigniew Jędrzejewski-Szmek [Thu, 27 Jun 2019 06:36:20 +0000 (08:36 +0200)]
udev: move rules logging functions into the .c file

They are (and can) only be used there, no need to expose them.

5 years agoRename EXTRACT_QUOTES to EXTRACT_UNQUOTE
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jun 2019 09:15:05 +0000 (11:15 +0200)]
Rename EXTRACT_QUOTES to EXTRACT_UNQUOTE

Whenever I see EXTRACT_QUOTES, I'm always confused whether it means to
leave the quotes in or to take them out. Let's say "unquote", like we
say "cunescape".

5 years agoReindent some things for readability
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jun 2019 08:56:28 +0000 (10:56 +0200)]
Reindent some things for readability

5 years agocryptsetup-generator: fix luks-* entry parsing from crypttab
Lubomir Rintel [Thu, 27 Jun 2019 11:02:28 +0000 (13:02 +0200)]
cryptsetup-generator: fix luks-* entry parsing from crypttab

This reverts a part of commit 49fe5c099639 ('tree-wide: port various places
over to STARTSWITH_SET()') that replaced a pair of startswith() calls
with STARTSWITH_SET().

They were in fact for a different strings (device vs. name), botching
the crypttap parsing.

5 years agobash-completion: support systemd-analyze condition
Yu Watanabe [Thu, 27 Jun 2019 17:48:53 +0000 (02:48 +0900)]
bash-completion: support systemd-analyze condition

5 years agocoredump: make use of the iovec-array helpers
Franck Bui [Wed, 26 Jun 2019 09:38:44 +0000 (11:38 +0200)]
coredump: make use of the iovec-array helpers

Previous code was allocating an array of iovecs big enough to store all the
fields added later by various functions.

This forced us to calculate the size of the array in advance which is too error
prone if for example one wants to add new fields or simply rework the
code. Various assertions were added to make sure there's no overflow but it's
still more code for no good reasons.

Instead, this patch switches to the new iovec array handling interface so the
array is grown dynamically when needed.

The other contraint was that some iovecs were supposed to be freed whereas some
others were not. This makes the code hard to (re)organize. The new code always
allocates fields so it becomes easier to rework the code.

5 years agoMerge pull request #12889 from keszybz/analyze-condition
Yu Watanabe [Thu, 27 Jun 2019 17:37:20 +0000 (02:37 +0900)]
Merge pull request #12889 from keszybz/analyze-condition

Add systemd-analyze condition

5 years agoio-util: introduce iovw_put_string_field() helper
Franck Bui [Tue, 25 Jun 2019 14:57:06 +0000 (16:57 +0200)]
io-util: introduce iovw_put_string_field() helper

5 years agojournal-import: extract helpers for handling arrays of iovec and make them available...
Franck Bui [Tue, 25 Jun 2019 13:54:44 +0000 (15:54 +0200)]
journal-import: extract helpers for handling arrays of iovec and make them available for others

5 years agocoredump: drop 2 useless assertions
Franck Bui [Tue, 25 Jun 2019 12:08:16 +0000 (14:08 +0200)]
coredump: drop 2 useless assertions

5 years agocoredump: slighlty simplify stack trace generation logic
Franck Bui [Tue, 25 Jun 2019 12:04:46 +0000 (14:04 +0200)]
coredump: slighlty simplify stack trace generation logic

The main advantage is to avoid the code duplication used to build MESSAGE=
field.

No functional changes.

5 years agocoredump: fix the check on the number of passed args in backtrace mode
Franck Bui [Fri, 21 Jun 2019 14:18:39 +0000 (16:18 +0200)]
coredump: fix the check on the number of passed args in backtrace mode

In backtrace mode, '--backtrace' option should also be counted.

5 years agocoredump: gather_pid_metadata() doesn't return 1 anymore
Franck Bui [Fri, 21 Jun 2019 13:34:01 +0000 (15:34 +0200)]
coredump: gather_pid_metadata() doesn't return 1 anymore

Since commit 92e92d71faea0f107312f296b7756cc04281ba99, gather_pid_metadata()
returns only 0 or a negative value.

5 years agocoredump: rename set_iovec_field_free() into set_iovec_string_field_free()
Franck Bui [Fri, 21 Jun 2019 12:48:02 +0000 (14:48 +0200)]
coredump: rename set_iovec_field_free() into set_iovec_string_field_free()

It's more in line with its counterpart set_iovec_string_field().

Also move the definition to io-util next to set_iovec_string_field().

5 years agoMerge pull request #12760 from zachsmith/systemd-sleep_resume_offset
Zbigniew Jędrzejewski-Szmek [Thu, 27 Jun 2019 11:37:27 +0000 (13:37 +0200)]
Merge pull request #12760 from zachsmith/systemd-sleep_resume_offset

systemd-sleep: use resume_offset value if set

5 years agocore: skip whitespace after "|" and "!" in the condition parser
Zbigniew Jędrzejewski-Szmek [Wed, 26 Jun 2019 14:23:18 +0000 (16:23 +0200)]
core: skip whitespace after "|" and "!" in the condition parser

We'd skip any whitespace immediately after "=", but then we'd treat whitespace
that is between "|" or "!" and the value as significant. This is rather
confusing, let's ignore it too.

5 years agoshared/condition: fix printing of ConditionNull=
Zbigniew Jędrzejewski-Szmek [Wed, 26 Jun 2019 14:21:34 +0000 (16:21 +0200)]
shared/condition: fix printing of ConditionNull=

ConditionNull= is the only condition where parameter==NULL is allowed,
and we'd print ConditionNull=(null) or ConditionNull=!(null).

5 years agoanalyze: add 'condition' verb
Zbigniew Jędrzejewski-Szmek [Wed, 26 Jun 2019 12:58:45 +0000 (14:58 +0200)]
analyze: add 'condition' verb

We didn't have a straightforward way to parse and evaluate those strings.
Prompted by #12881.

5 years agoMerge pull request #12894 from stapelberg/patch-1
Zbigniew Jędrzejewski-Szmek [Thu, 27 Jun 2019 08:43:48 +0000 (10:43 +0200)]
Merge pull request #12894 from stapelberg/patch-1

cryptsetup: comment: crypt_setup → crypt_format

5 years agodocs: fix typos and duplicate words
Michael Prokop [Thu, 27 Jun 2019 07:54:20 +0000 (09:54 +0200)]
docs: fix typos and duplicate words

s/and and/and/
s/explicity/explicitly/
s/that that/that/
s/the the/the/
s/is is/it is/
s/overriden/overridden/

5 years agocryptsetup: comment: crypt_setup → crypt_format
Michael Stapelberg [Thu, 27 Jun 2019 07:38:30 +0000 (09:38 +0200)]
cryptsetup: comment: crypt_setup → crypt_format

5 years agoMerge pull request #12890 from yuwata/fix-conf-parser-12883
Zbigniew Jędrzejewski-Szmek [Thu, 27 Jun 2019 06:13:14 +0000 (08:13 +0200)]
Merge pull request #12890 from yuwata/fix-conf-parser-12883

conf-parse: fix continuation handling

5 years agosystemd-sleep: refuse to calculate swapfile offset on Btrfs
Zach Smith [Wed, 26 Jun 2019 13:55:37 +0000 (06:55 -0700)]
systemd-sleep: refuse to calculate swapfile offset on Btrfs

If hibernation is requested but /sys/power/resume and
/sys/power/resume_offset are not configured correctly, systemd-sleep
attempts to calculate swapfile offset using fstat and fiemap.
Btrfs returns virtual device number for stat and a virtual offset
for fiemap which results in incorrect offset calculations. In the
case where offset would be calculated and the user is using Btrfs,
log a debug message and fail to write device and offset values.

5 years agosystemd-sleep: (bug) use resume_offset value if set
Zach Smith [Sun, 9 Jun 2019 03:44:34 +0000 (20:44 -0700)]
systemd-sleep: (bug) use resume_offset value if set

Use hibernation configuration as defined in
/sys/power/resume and /sys/power/resume_offset
if present before inspecting /proc/swaps and
attempting to calculate swapfile offset

5 years agoMerge pull request #12892 from yuwata/fix-test-format-util-12891
Evgeny Vereshchagin [Thu, 27 Jun 2019 04:56:59 +0000 (07:56 +0300)]
Merge pull request #12892 from yuwata/fix-test-format-util-12891

test: fix argument type of test_format_bytes_one()

5 years agotest: fix argument type of test_format_bytes_one()
Yu Watanabe [Thu, 27 Jun 2019 01:20:18 +0000 (10:20 +0900)]
test: fix argument type of test_format_bytes_one()

Closes #12891.

5 years agoutil,test: rename variable non_iec -> si
Yu Watanabe [Thu, 27 Jun 2019 01:17:20 +0000 (10:17 +0900)]
util,test: rename variable non_iec -> si

5 years agotest: add testcase for issue #12883
Yu Watanabe [Wed, 26 Jun 2019 18:03:45 +0000 (03:03 +0900)]
test: add testcase for issue #12883

5 years agoconf-parser: fix continuation handling
Yu Watanabe [Wed, 26 Jun 2019 18:00:22 +0000 (03:00 +0900)]
conf-parser: fix continuation handling

Before this commit, empty lines cannot break continuation.
The bug was introduced by 9adbfeb38ac101d6f73a033bb120d63513ffb240.

Closes #12883.

5 years agocore: do not enumerate units in MANAGER_TEST_RUN_MINIMAL mode
Zbigniew Jędrzejewski-Szmek [Wed, 26 Jun 2019 12:56:59 +0000 (14:56 +0200)]
core: do not enumerate units in MANAGER_TEST_RUN_MINIMAL mode

In this mode we are not supposed to "interact with the environment", so loading
all units and printing warnings about syntax errors and /var/run usage seems
inappropriate.

5 years agoman: move description of how conditions are combined to the beginning
Zbigniew Jędrzejewski-Szmek [Wed, 26 Jun 2019 12:56:04 +0000 (14:56 +0200)]
man: move description of how conditions are combined to the beginning

Originally the description of conditions was brief, so it was acceptable
to put this part at the end. But now we have a myriad conditions, and
this crucial bit of information is easy to miss.

5 years agocore: move assert before actual use of the variable
Zbigniew Jędrzejewski-Szmek [Wed, 26 Jun 2019 09:52:57 +0000 (11:52 +0200)]
core: move assert before actual use of the variable

No point in using u->id first, and doing assert(u) later.
-std=c89 strikes again.

5 years agocoredump: rely on /proc exclusively to get the name of the crashing process
Franck Bui [Fri, 21 Jun 2019 11:12:41 +0000 (13:12 +0200)]
coredump: rely on /proc exclusively to get the name of the crashing process

I couldn't see any reason why the kernel could provide COMM to the coredump
handler via the core_pattern command line but could not make it available in
/proc. So let's assume that this info is always available in /proc.

For "backtrace" mode (when --backtrace option is passed), I assumed that the
crashing process still exists at the time systemd-coredump is called.

Also changing the core_pattern line is an API breakage for any users of the
backtrace mode but given that systemd-coredump is installed in
/usr/lib/systemd, it's a private tool which has no internal users. At least no
one complained when the hostname was added to the core_pattern line
(f45b8015513)...

Indeed it's much easier to get it from /proc since the kernel substitutes '%e'
specifier with multiple strings if the process name contains spaces (!).

5 years agocoredump: fix one memleak in backtrace mode
Franck Bui [Wed, 26 Jun 2019 05:23:10 +0000 (07:23 +0200)]
coredump: fix one memleak in backtrace mode

Journal importer internal structures need to be freed.

5 years agocoredump: make use of STRINGIFY
Franck Bui [Thu, 20 Jun 2019 14:09:51 +0000 (16:09 +0200)]
coredump: make use of STRINGIFY

5 years agoexecute: drop SYNTHETIC_ERRNO because error code was received from the apply_numa_pol...
Michal Sekletar [Tue, 25 Jun 2019 10:57:01 +0000 (12:57 +0200)]
execute: drop SYNTHETIC_ERRNO because error code was received from the apply_numa_policy()

5 years agonetwork: further log message update
Yu Watanabe [Tue, 25 Jun 2019 07:42:34 +0000 (16:42 +0900)]
network: further log message update

Follow-up for 44e891bbf6908e494856fcf3011e88a70a12e087.

5 years agocore: factor root_directory application out of apply_working_directory
Joerg Behrmann [Fri, 21 Jun 2019 11:51:53 +0000 (13:51 +0200)]
core: factor root_directory application out of apply_working_directory

Fixes: #12498

5 years agocore: move config_parse_* functions to a shared module
Frantisek Sumsal [Thu, 20 Jun 2019 16:51:42 +0000 (18:51 +0200)]
core: move config_parse_* functions to a shared module

Apart from making the code a little bit more clean, it should allow us
to write a fuzzer around the config-parsing functions in the future

5 years agoman: change true/false to yes/no for DefaultDependencies.
INSUN PYO [Tue, 25 Jun 2019 11:38:02 +0000 (20:38 +0900)]
man: change true/false to yes/no for DefaultDependencies.

5 years agoMerge pull request #12877 from poettering/dynamic-user-re-migrate2
Lennart Poettering [Tue, 25 Jun 2019 10:20:26 +0000 (12:20 +0200)]
Merge pull request #12877 from poettering/dynamic-user-re-migrate2

DynamicUser=1 → = 0 migration follow-up

5 years agosome CODING_STYLE additions
Lennart Poettering [Tue, 25 Jun 2019 07:59:24 +0000 (09:59 +0200)]
some CODING_STYLE additions

5 years agoman: say D-Bus, not dbus
Lennart Poettering [Tue, 25 Jun 2019 08:47:13 +0000 (10:47 +0200)]
man: say D-Bus, not dbus

5 years agoman: improve --test documentation
Lennart Poettering [Tue, 25 Jun 2019 08:44:59 +0000 (10:44 +0200)]
man: improve --test documentation

Incorporates some suggestions from:

https://github.com/systemd/systemd/pull/12868#discussion_r296738370
https://github.com/systemd/systemd/commit/cd69e88ba3a692618048117b26fc9ea339aa1845#commitcomment-34060775

5 years agotest: add test for DynamicUser=0 → =1 migration (and back)
Lennart Poettering [Tue, 25 Jun 2019 08:40:16 +0000 (10:40 +0200)]
test: add test for DynamicUser=0 → =1 migration (and back)

5 years agocore: mention why we do migration for everything but ConfigurationDirectory=
Lennart Poettering [Tue, 25 Jun 2019 08:39:52 +0000 (10:39 +0200)]
core: mention why we do migration for everything but ConfigurationDirectory=