Yu Watanabe [Tue, 30 Apr 2019 18:30:49 +0000 (20:30 +0200)]
udev: make parser for attribute of $result harder
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.
Yu Watanabe [Tue, 30 Apr 2019 17:23:44 +0000 (19:23 +0200)]
udev: comment that $tempnode and $sysfs formats are deprecated
Yu Watanabe [Tue, 30 Apr 2019 17:18:33 +0000 (19:18 +0200)]
udev: pass format type to udev_event_subst_format()
Yu Watanabe [Tue, 30 Apr 2019 17:13:58 +0000 (19:13 +0200)]
udev: rename enum subst_type -> FormatSubstitutionType
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.
Yu Watanabe [Tue, 30 Apr 2019 16:56:33 +0000 (18:56 +0200)]
util: introduce strnpcpy() and strnscpy()
Yu Watanabe [Wed, 24 Apr 2019 23:19:07 +0000 (01:19 +0200)]
util: introduce PTR_TO_MODE and MODE_TO_PTR macros
Michal Sekletar [Thu, 30 May 2019 10:32:53 +0000 (12:32 +0200)]
Merge pull request #12628 from keszybz/dbus-execute
Rework cpu affinity parsing
Yu Watanabe [Thu, 30 May 2019 01:22:18 +0000 (10:22 +0900)]
nspawn: also support ifindex when specifying network interface
Zbigniew Jędrzejewski-Szmek [Thu, 30 May 2019 09:02:03 +0000 (11:02 +0200)]
Merge pull request #12646 from yuwata/networkctl-use-table
networkctl: use Table
Yu Watanabe [Thu, 30 May 2019 01:32:36 +0000 (10:32 +0900)]
dhcp4: use memdup_suffix0() instead of strndup() for binary data
C.f.
ac0a94f7438b49a0890d9806db1fa211a5bca10a.
Fixes #12693.
Felix Riemann [Wed, 29 May 2019 19:17:42 +0000 (21:17 +0200)]
pager: Fix deadlock when using built-in pager
The parent is waiting for an EOF on the pipe transmitting the pager name
before starting to send data. With external pagers this happens due to
execlp() CLOEXEC'ing the pipe, so the internal pager needs to close it
manually.
Roberto Santalla [Sun, 26 May 2019 11:55:30 +0000 (13:55 +0200)]
cryptsetup: Add dependency for detached header
Fixes #12650
cryptsetup: Extract dependency check to a separate function
cryptsetup: style improvements, error checking
Return early on failure/nothing to do
Removed braces from single-line ifs
Check return value of fstab_filter_options
cryptsetup: code style
Evgeny Vereshchagin [Thu, 30 May 2019 01:29:50 +0000 (03:29 +0200)]
tests: skip test-bpf only when we're 100% sure it's run in containers
This is just a follow-up to https://github.com/systemd/systemd/pull/12617.
Evgeny Vereshchagin [Wed, 29 May 2019 20:11:01 +0000 (23:11 +0300)]
Merge pull request #12617 from mbiebl/skip-test-bpf-containers
test-bpf: skip test when run inside containers
Zbigniew Jędrzejewski-Szmek [Wed, 29 May 2019 08:17:43 +0000 (10:17 +0200)]
shared/cpu-set-util: only force range printing one time
The idea is to have at least one range to make the new format clearly
distinguishable from the old. But it is enough to just do it once.
In particular, in case the affinity would be specified like 0, 2, 4, 6…,
this gives much shorter output.
Michal Sekletar [Wed, 22 May 2019 15:14:21 +0000 (17:14 +0200)]
systemctl: present CPUAffinity mask as a list of CPU index ranges
Michal Sekletar [Thu, 23 May 2019 12:27:18 +0000 (14:27 +0200)]
shared/cpu-set-util: introduce cpu_set_to_range()
Zbigniew Jędrzejewski-Szmek [Wed, 29 May 2019 07:44:16 +0000 (09:44 +0200)]
test-cpu-set-util: add test for dbus conversions
Michal Sekletar [Wed, 22 May 2019 11:55:49 +0000 (13:55 +0200)]
shared/cpu-set-util: make transfer of cpu_set_t over bus endian safe
Zbigniew Jędrzejewski-Szmek [Wed, 29 May 2019 10:39:58 +0000 (12:39 +0200)]
Merge pull request #12690 from yuwata/test-network-and-man-netdev
test-network,man: trivial cleanups
Feldwor [Wed, 29 May 2019 08:38:56 +0000 (11:38 +0300)]
hwdb: add axis range corrections for the Asus N53SV
Yu Watanabe [Wed, 29 May 2019 03:07:36 +0000 (12:07 +0900)]
test-network: bump time limit for wait_address()
Maximum time interval of DHCPv4 request is 63sec.
So, setting 100sec is enough.
Lennart Poettering [Wed, 29 May 2019 10:23:13 +0000 (12:23 +0200)]
Merge pull request #12449 from ljmf00/hwdb-accel-location-patch
hwdb: Add support for Teclast F6 Pro base sensor
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 19:40:10 +0000 (21:40 +0200)]
shared/cpu-set-util: drop now-unused cleanup function
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 19:38:41 +0000 (21:38 +0200)]
test-execute: use CPUSet too
cpu_set_malloc() was the last user. It doesn't seem useful to keep
it just to save the allocation of a few hundred bytes in a test, so
it is dropped and a fixed maximum is allocated (1024 bytes).
Zbigniew Jędrzejewski-Szmek [Fri, 24 May 2019 07:41:44 +0000 (09:41 +0200)]
pid1: when reloading configuration, forget old settings
If we had a configuration setting from a configuration file, and it was
removed, we'd still remember the old value, because there's was no mechanism to
"reset" everything, just to assign new values.
Note that the effect of this is limited. For settings that have an "ongoing" effect,
like systemd.confirm_spawn, the new value is simply used. But some settings can only
be set at start.
In particular, CPUAffinity= will be updated if set to a new value, but if
CPUAffinity= is fully removed, it will not be reset, simply because we don't
know what to reset it to. We might have inherited a setting, or we might have
set it ourselves. In principle we could remember the "original" value that was
set when we were executed, but propagate this over reloads and reexecs, but
that would be a lot of work for little gain. So this corner case of removal of
CPUAffinity= is not handled fully, and a reboot is needed to execute the
change. As a work-around, a full mask of CPUAffinity=0-8191 can be specified.
Zbigniew Jędrzejewski-Szmek [Fri, 24 May 2019 06:59:23 +0000 (08:59 +0200)]
pid1: don't reset setting from /proc/cmdline upon restart
We have settings which may be set on the kernel command line, and also
in /proc/cmdline (for pid1). The settings in /proc/cmdline have higher priority
of course. When a reload was done, we'd reload just the configuration file,
losing the overrides.
So read /proc/cmdline again during reload.
Also, when initially reading the configuration file when program starts,
don't treat any errors as fatal. The configuration done in there doesn't
seem important enough to refuse boot.
Zbigniew Jędrzejewski-Szmek [Fri, 24 May 2019 06:35:51 +0000 (08:35 +0200)]
pid1: parse CPUAffinity= in incremental fashion
This makes the handling of this option match what we do in unit files. I think
consistency is important here. (As it happens, it is the only option in
system.conf that is "non-atomic", i.e. where there's a list of things which can
be split over multiple assignments. All other options are single-valued, so
there's no issue of how to handle multiple assignments.)
Zbigniew Jędrzejewski-Szmek [Fri, 24 May 2019 06:50:41 +0000 (08:50 +0200)]
test-cpu-set-util: add a smoke test for test_parse_cpu_set_extend()
Zbigniew Jędrzejewski-Szmek [Tue, 21 May 2019 07:01:34 +0000 (09:01 +0200)]
test-cpu-set-util: add simple test for cpus_in_affinity_mask()
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 19:28:31 +0000 (21:28 +0200)]
Move cpus_in_affinity_mask() to cpu-set-util.[ch]
It just seems to fit better there and it's always better to have things
in shared/ rather than basic/.
Zbigniew Jędrzejewski-Szmek [Tue, 21 May 2019 06:45:19 +0000 (08:45 +0200)]
Rework cpu affinity parsing
The CPU_SET_S api is pretty bad. In particular, it has a parameter for the size
of the array, but operations which take two (CPU_EQUAL_S) or even three arrays
(CPU_{AND,OR,XOR}_S) still take just one size. This means that all arrays must
be of the same size, or buffer overruns will occur. This is exactly what our
code would do, if it received an array of unexpected size over the network.
("Unexpected" here means anything different from what cpu_set_malloc() detects
as the "right" size.)
Let's rework this, and store the size in bytes of the allocated storage area.
The code will now parse any number up to 8191, independently of what the current
kernel supports. This matches the kernel maximum setting for any architecture,
to make things more portable.
Fixes #12605.
Yu Watanabe [Wed, 29 May 2019 08:17:08 +0000 (17:17 +0900)]
man: re-indent systemd.netdev.xml
Yu Watanabe [Wed, 29 May 2019 07:38:08 +0000 (16:38 +0900)]
test-network: drop 25-nlmon.network
Franz Pletz [Thu, 23 May 2019 14:14:10 +0000 (16:14 +0200)]
man: add vrf section
Yu Watanabe [Wed, 29 May 2019 05:18:41 +0000 (14:18 +0900)]
tree-wide: replace if_indextoname() with format_ifname()
Yu Watanabe [Wed, 29 May 2019 05:03:18 +0000 (14:03 +0900)]
util: introduce format_ifname()
Yu Watanabe [Wed, 22 May 2019 20:13:13 +0000 (05:13 +0900)]
networkctl: use Table for 'lldp' command
Yu Watanabe [Wed, 22 May 2019 20:03:42 +0000 (05:03 +0900)]
networkctl: use Table for 'label' command
Yu Watanabe [Wed, 22 May 2019 16:43:21 +0000 (01:43 +0900)]
networkctl: use Table for 'status' command
Yu Watanabe [Wed, 22 May 2019 17:21:17 +0000 (02:21 +0900)]
networkctl: use Table for 'list' command
Yu Watanabe [Fri, 24 May 2019 09:11:13 +0000 (18:11 +0900)]
table: add TABLE_IFINDEX type
Yu Watanabe [Fri, 24 May 2019 09:01:04 +0000 (18:01 +0900)]
table: add more basic types
Yu Watanabe [Thu, 23 May 2019 10:59:06 +0000 (19:59 +0900)]
table: add teble_add_string_cell()
Yu Watanabe [Wed, 29 May 2019 05:20:36 +0000 (14:20 +0900)]
Merge pull request #12687 from yuwata/parse_ifindex_or_ifname
util: introduce parse_ifindex_or_ifname() and use it in networkctl and resolvectl
Yu Watanabe [Wed, 29 May 2019 02:02:09 +0000 (11:02 +0900)]
networkctl: use parse_ifindex_or_ifname()
Yu Watanabe [Wed, 29 May 2019 01:56:55 +0000 (10:56 +0900)]
resolvectl: use parse_ifindex_or_ifname()
Yu Watanabe [Wed, 29 May 2019 04:21:43 +0000 (13:21 +0900)]
util: add assertions
Yu Watanabe [Wed, 29 May 2019 01:43:12 +0000 (10:43 +0900)]
util: introduce parse_ifindex_or_ifname()
Susant Sahani [Wed, 22 May 2019 09:46:41 +0000 (15:16 +0530)]
networkctl: add support to delete virtual netdevs
We now don't have the support to delete netdevs and dependent
upon iproute to delete. With this we can delete via networkctl
and use in our test cases too.
Note that it supports deleting multiple links at once.
```
sudo ./networkctl delete test1 test2 test3 test4
```
Yu Watanabe [Wed, 29 May 2019 01:22:09 +0000 (10:22 +0900)]
Merge pull request #12635 from yuwata/nlmon-support
network: add nlmon support
Yu Watanabe [Wed, 29 May 2019 01:21:31 +0000 (10:21 +0900)]
Merge pull request #12573 from yuwata/network-dhcp-issue-12490
network: set preferred source in removing route entry on address lost
Zach Smith [Thu, 16 May 2019 16:12:41 +0000 (11:12 -0500)]
systemd-sleep: replace rtc wakealarm with CLOCK_BOOTTIME_ALARM s2h
refactor to use timerfd in place of rtc wakealarm
confirm CLOCK_BOOTTIME_ALARM support in can_s2h
Remove CLOCK_BOOTTIME_ALARM task from TODO
remove unnecessary check on clock_supported return
Lennart Poettering [Tue, 28 May 2019 13:06:49 +0000 (15:06 +0200)]
seccomp: add new 5.1 syscall pidfd_send_signal() to filter set list
Lennart Poettering [Fri, 24 May 2019 19:09:07 +0000 (21:09 +0200)]
test: exit cleanly on success
Yu Watanabe [Thu, 23 May 2019 02:37:53 +0000 (11:37 +0900)]
test-network: add a basic test for nlmon
Yu Watanabe [Thu, 23 May 2019 02:36:25 +0000 (11:36 +0900)]
network: add nlmon support
nlmon is a Netlink monitor device.
Yu Watanabe [Thu, 23 May 2019 02:27:12 +0000 (11:27 +0900)]
network: add NetDevVTable::generate_mac flag
Yu Watanabe [Mon, 27 May 2019 20:45:10 +0000 (05:45 +0900)]
network: do not send DHCPRELEASE when CriticalConnection= is enabled
Yu Watanabe [Fri, 24 May 2019 06:43:14 +0000 (15:43 +0900)]
test-network: use wait_online() in NetworkdDHCPServerTests or friends
Yu Watanabe [Fri, 24 May 2019 06:34:19 +0000 (15:34 +0900)]
test-network: move test_domain() to NetworkdNetworkTests class
Yu Watanabe [Fri, 24 May 2019 06:17:41 +0000 (15:17 +0900)]
test-network: rename needlessly long class names
Yu Watanabe [Fri, 24 May 2019 04:59:34 +0000 (13:59 +0900)]
test-network: use wait_online() instead of waiting for 10 seconds
But some tests requires both IPv4 and IPv6 addresses are configured.
Only in that case wait for addresses to be configured.
Yu Watanabe [Fri, 24 May 2019 05:03:07 +0000 (14:03 +0900)]
test-network: drop unused link
Yu Watanabe [Fri, 24 May 2019 04:50:51 +0000 (13:50 +0900)]
test-network: rename link_remove() to remove_links()
Yu Watanabe [Fri, 24 May 2019 04:49:51 +0000 (13:49 +0900)]
test-network: remove routes even on failure
Yu Watanabe [Fri, 24 May 2019 04:44:49 +0000 (13:44 +0900)]
test-network: use setUp() and tearDown() to delete routing policy rule tables
Yu Watanabe [Fri, 24 May 2019 04:39:50 +0000 (13:39 +0900)]
test-network: remove fou ports on failure
Yu Watanabe [Fri, 24 May 2019 04:38:08 +0000 (13:38 +0900)]
test-network: stop dnsmasq before removing links
Yu Watanabe [Fri, 24 May 2019 03:04:59 +0000 (12:04 +0900)]
test-network: warn when firewalld.service is running
Yu Watanabe [Fri, 24 May 2019 02:39:26 +0000 (11:39 +0900)]
test-network: add tests for issue #12490
Yu Watanabe [Fri, 24 May 2019 05:14:12 +0000 (14:14 +0900)]
network: lower log level about critical connection
Yu Watanabe [Fri, 24 May 2019 07:47:47 +0000 (16:47 +0900)]
network: split dhcp_lease_lost() into small pieces
Yu Watanabe [Tue, 28 May 2019 13:14:13 +0000 (22:14 +0900)]
network: set dhcp4_configured flag false before configuring address
Otherwise, even if dhcp_lease_acquired() fails, the flag is still on.
Yu Watanabe [Tue, 28 May 2019 13:13:01 +0000 (22:13 +0900)]
network: reset Link::dhcp4_configured flag earlier
Yu Watanabe [Wed, 15 May 2019 05:55:31 +0000 (14:55 +0900)]
network: set preferred source in removing route entry on address lost
Closes #12490.
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 13:12:20 +0000 (15:12 +0200)]
Merge pull request #12437 from poettering/chmod-and-chown-rewrite
chmod_and_chown() rewrite
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 12:42:55 +0000 (14:42 +0200)]
Merge pull request #12390 from poettering/string-file-mkdir
fileio: add a WRITE_STRING_FILE_MKDIR_0755 flag to write_string_file() that creates parent directories if needed
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 12:36:54 +0000 (14:36 +0200)]
Merge pull request #12392 from poettering/firstboot-salt
generalize crypt_r() salt generation code
Lennart Poettering [Tue, 28 May 2019 12:34:53 +0000 (14:34 +0200)]
Merge pull request #12597 from keszybz/analyze-timestamp
Analyze timestamps
Lennart Poettering [Tue, 28 May 2019 12:28:59 +0000 (14:28 +0200)]
Merge pull request #12682 from keszybz/pull-in-user-targets
rules: enable hardware-related targets also for user instances
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 10:36:34 +0000 (12:36 +0200)]
NEWS: add some entries
For #12680, #12571.
Lennart Poettering [Wed, 24 Apr 2019 16:41:25 +0000 (18:41 +0200)]
capability-util: be more careful with types
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 12:20:34 +0000 (14:20 +0200)]
Merge pull request #12679 from yuwata/journal-issue-12400
journal: do not trigger assertion when journal_file_close() get NULL
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 12:10:44 +0000 (14:10 +0200)]
rules: enable hardware-related targets also for user instances
> the odd thing is that these units are also defined for the systemd user
> instance. However, because these are bound to SYSTEMD_USER_WANTS rather than
> SYSTEMD_WANTS they are effectively useless unless some other software
> installs the corresponding udev rules first.
This adds the rules and starts those targets also for user instances.
Fixes #12330.
Yu Watanabe [Tue, 28 May 2019 09:07:01 +0000 (18:07 +0900)]
journal: use cleanup attribute at one more place
Yu Watanabe [Tue, 28 May 2019 03:40:17 +0000 (12:40 +0900)]
journal: do not trigger assertion when journal_file_close() get NULL
We generally expect destructors to not complain if a NULL argument is passed.
Closes #12400.
Yu Watanabe [Wed, 22 May 2019 16:30:02 +0000 (01:30 +0900)]
udev: fix error message
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 08:27:58 +0000 (10:27 +0200)]
Merge pull request #12653 from yuwata/test-network-improvements-2
network: fix configuring vxcan devices and several test-network follow-ups
Douglas Christman [Sat, 25 May 2019 07:50:49 +0000 (15:50 +0800)]
zsh-completion: fix completion for systemd-inhibit --what
Yu Watanabe [Sat, 25 May 2019 22:21:00 +0000 (07:21 +0900)]
udev: suppress warning when interface matches 99-default.link
This suppress the following warning:
```
systemd-udevd[437]: Config file /usr/lib/systemd/network/99-default.link
applies to device based on potentially unpredictable interface name 'wlan0'
```
Follow-up for
84ea567eb4326eb970a33188649fde6bea2a0d4e.
Yu Watanabe [Sun, 26 May 2019 19:58:30 +0000 (04:58 +0900)]
bash-completion: update options for bootctl
Yu Watanabe [Tue, 28 May 2019 01:52:55 +0000 (10:52 +0900)]
coredumpctl: fix --debugger option
Closes #12660.
Frantisek Sumsal [Mon, 27 May 2019 17:59:26 +0000 (19:59 +0200)]
test: correctly fail when system is borked
In certain situations, the systemctl commands may fail (e.g. due to
missing shared libraries), but the 'script' continues and creates a
/testok file, marking the test incorrectly as passed. Let's fix this and
bail out immediately when a command exits with a non-zero exit code.
Evgeny Vereshchagin [Mon, 27 May 2019 16:59:53 +0000 (19:59 +0300)]
Merge pull request #12663 from mrc0mmand/clang-asan-improvements
test: improve handling of ASan under clang
Frantisek Sumsal [Mon, 27 May 2019 12:14:26 +0000 (14:14 +0200)]
docs: add documentation for sanitizers
Frantisek Sumsal [Fri, 24 May 2019 20:35:52 +0000 (22:35 +0200)]
test: improve handling of ASan under clang
Running integration tests with ASan is somewhat tricky to begin with, as
we need to pre-load the ASan runtime DSO for certain services (like
dbus), otherwise they won't start or behave as expected. In case of gcc
this is pretty easy, as we need the runtime DSO during compilation, so
it's already present on the host system. For clang things get more
complicated, as ASan is compiled in statically by default, thus to
enable the necessary dynamic-ish behavior one needs to compile with
-shared-libasan and then correctly set LD_PRELOAD_PATH, as the runtime
libraries are not in a standard library path.
Oliver Harley [Sun, 26 May 2019 05:31:29 +0000 (07:31 +0200)]
--bind-device does not take a bool
See https://github.com/systemd/systemd/blob/
e95be7def26c6c5feaf08a4135aa4f50c53263a8/src/mount/mount-tool.c#L164
Also makes the man page consistent with the `--help` option