Yu Watanabe [Wed, 17 Jul 2019 14:12:07 +0000 (23:12 +0900)]
network: update state file after dhcp6 events
E.g. DNS servers may be received from DHCPv6 server. If the link is
already in configured state, the DNS servers are not written in the
state file.
Yu Watanabe [Wed, 17 Jul 2019 14:03:01 +0000 (23:03 +0900)]
Revert "test-network: extend sleep time"
This reverts commit
7d7bb5c8613b774bf77c531f46d31ee20d7a1b1e.
Still the CIs are flaky and the commit just slow down them.
Yu Watanabe [Wed, 17 Jul 2019 01:07:42 +0000 (10:07 +0900)]
man: fix wrong section name
Yu Watanabe [Wed, 17 Jul 2019 01:21:07 +0000 (10:21 +0900)]
network: fix use after free()
The hashmap will be accessed by client_stop().
Yu Watanabe [Wed, 17 Jul 2019 00:46:36 +0000 (09:46 +0900)]
network: drop unnecessary line breaks
Yu Watanabe [Wed, 17 Jul 2019 00:40:06 +0000 (09:40 +0900)]
network: drop fallback mechanism to assign DHCPv6 addresses with IFA_F_NOPREFIXROUTE
The flag IFA_F_NOPREFIXROUTE was introduced in kernel-3.14. But even if
the kernel does not support the flag, it should be just ignored. So, it
is not necessary to do the fallback logic. Moreover, the current logic
is not a fallback mechanism but just retrying. So, it should not work.
Let's drop that.
Lennart Poettering [Wed, 17 Jul 2019 12:43:15 +0000 (14:43 +0200)]
Merge pull request #13080 from keszybz/firstboot-fixes
Firstboot fixes
Dan Streetman [Sun, 14 Jul 2019 04:24:28 +0000 (00:24 -0400)]
test/TEST-16: don't copy systemd-notify or lib from $BUILD_DIR
On Ubuntu CI, these don't exist because it tests installed
binaries, not just-built binaries.
Lennart Poettering [Wed, 17 Jul 2019 12:18:49 +0000 (14:18 +0200)]
Merge pull request #13092 from keszybz/coverity-fixes
Coverity fixes
Lennart Poettering [Wed, 17 Jul 2019 12:10:06 +0000 (14:10 +0200)]
Merge pull request #13091 from poettering/nspawn-copy
nspawn: allow nspawn's copy operation to be abortable via C-c
Lennart Poettering [Wed, 17 Jul 2019 10:07:39 +0000 (12:07 +0200)]
Merge pull request #12675 from yuwata/network-set-dns
resolvectl: support to modify interfaces managed by networkd
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 16:48:15 +0000 (18:48 +0200)]
firstboot: actually accept empty input to mean skip
We'd loop if the input was empty. We need to return to the caller.
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 16:35:34 +0000 (18:35 +0200)]
firstboot: fix hang waiting for second Enter on input
The comment explains the reason: we'd wait for the second \n
and then ungetc() it. Then the buffered \n would cause a problem
when the next prompt was issued, so in effect it wasn't possible
to answer the second question.
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 15:17:29 +0000 (17:17 +0200)]
firstboot: only list all options on demand
The user most likely knows the name of their locale/keymap/whatever,
and paging through multiple pages of output has little benefit.
The header that was printed before is now not printed anymore. But
now it's obvious from the context what we are printing, so we don't
need to print the header.
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 15:16:42 +0000 (17:16 +0200)]
firstboot: use free_and_strdup, free_and_replace
Jakob Unterwurzacher [Tue, 16 Jul 2019 21:09:07 +0000 (23:09 +0200)]
mount-util: bind_remount: avoid calling statvfs
The commit
"util: Do not clear parent mount flags when setting up namespaces"
introduced a statvfs call read the flags of the original mount
and have them applied to the bind mount.
This has two problems:
(1) The mount flags returned by statvfs(2) do not match the flags
accepted by mount(2). For example, the value 4096 means ST_RELATIME
when returned by statvfs(2), but means MS_BIND when passed to mount(2).
(2) A call to statvfs blocks indefinitely when ran against a disconnected
network drive ( https://github.com/systemd/systemd/issues/12667 ).
We already use libmount to parse `/proc/self/mountinfo` but did not use the
mount flag information from there. This patch changes that to use the mount
flags parsed by libmount instead of calling statvfs. Only if getting the
flags through libmount fails we call statvfs.
Fixes https://github.com/systemd/systemd/issues/12667
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 09:30:04 +0000 (11:30 +0200)]
sd-device: voidify and simplify calls to ordered_hashmap_iterate()
Coverity CID#1402356 and CID#1402335.
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 09:20:36 +0000 (11:20 +0200)]
sd-bus: voidify two calls to hashmap_iterate()
Coverity CID#1402304 and CID#1402307.
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 09:16:53 +0000 (11:16 +0200)]
test-networkd-conf: add missing assert
The test would not pass before, because EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE
didn't work (we'd get "KEY3=val with \\quotation\\" as the last string. Now we
are only doing EXTRACT_UNQUOTE, so we get the expected "KEY3=val with \"quotation\"".
Coverity CID#1402781.
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 09:13:20 +0000 (11:13 +0200)]
shared/conf-parser,networkd: EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE → EXTRACT_UNQUOTE
It's hard to even say what exactly this combination means. Escaping is
necessary when quoting to have quotes within the string. So the escaping of
quote characters is inherently tied to quoting. When unquoting, it seems
natural to remove escaping which was done for the quoting purposes. But with
both flags we would be expected to re-add this escaping after unqouting? Or
maybe keep the escaping which is not necessary for quoting but otherwise
present? This all seems too complicated, let's just forbid such usage and
always fully unescape when unquoting.
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 08:14:34 +0000 (10:14 +0200)]
nspawn: fix misplaced parenthesis and merge two error handling paths
I don't think we need to provide the two separate error messages,
let's shorten the code a bit by merging them.
Coverity CID#1402320.
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 08:09:18 +0000 (10:09 +0200)]
nspawn: fix memleak in argument parsing
Coverity CID#1402297.
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 08:02:13 +0000 (10:02 +0200)]
coredumpctl: check return value
retrieve() allocates memory, so it may fail.
Coverity CID#1402338.
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 08:01:24 +0000 (10:01 +0200)]
coredumpctl: use free_and_replace in one more place
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 07:49:01 +0000 (09:49 +0200)]
shared: voidify call to loop_write() and trim duplicate code
Coverity CID#1402375.
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 07:39:39 +0000 (09:39 +0200)]
shared: fix assert call
Fixup for
3572d3df8f8. Coverity CID#1403013.
Anita Zhang [Sat, 29 Jun 2019 00:02:30 +0000 (17:02 -0700)]
core: ExecCondition= for services
Closes #10596
Lennart Poettering [Wed, 17 Jul 2019 08:59:29 +0000 (10:59 +0200)]
nspawn: make use of SIGINT handling when copying files
Fixes: #13079
Lennart Poettering [Wed, 17 Jul 2019 08:58:49 +0000 (10:58 +0200)]
btrfs-util: expose SIGINT behaviour in snapshot copy fallback, too
Lennart Poettering [Wed, 17 Jul 2019 08:58:22 +0000 (10:58 +0200)]
copy: optionally check for SIGINT regularly, and abort operation safely
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 07:14:20 +0000 (09:14 +0200)]
Merge pull request #12927 from fbuihuu/coredump-cleanup-part-2
Coredump cleanup part 2
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jul 2019 06:44:01 +0000 (08:44 +0200)]
Merge pull request #13082 from ddstreet/minor
Minor fixes in test framework
Dan Streetman [Sun, 14 Jul 2019 03:03:26 +0000 (23:03 -0400)]
test/test-functions: fix install_dmeventd to correctly install bin/libs
Evgeny Vereshchagin [Wed, 17 Jul 2019 02:48:02 +0000 (02:48 +0000)]
Free up some resources on Azure Pipelines
Let's drop the tests we also run on CentOS CI to free up some resources
for something more useful.
Dan Streetman [Sun, 14 Jul 2019 01:39:03 +0000 (21:39 -0400)]
test/test-functions: instmods call to find should use -type f
without using -type f, the logs print an error such as:
E: E: modprobe: FATAL: Module asymmetric_keys not found in directory /lib/modules/4.15.0-54-generic
while this doesn't appear to cause problems, it can be extremely
distracting when trying to debug real failures.
Dan Streetman [Sat, 13 Jul 2019 17:29:48 +0000 (13:29 -0400)]
test: when stripping binaries, ignore case in suppressing "File format not recognized"
The grep -v matches all lowercase, but "file" is captialized; just ignore case so
it's suppressed for either all lowercase or capital File.
Dan Streetman [Fri, 12 Jul 2019 18:09:48 +0000 (14:09 -0400)]
test: ignore errors during test cleanup, so cleanup can finish
Also move TESTDIR and STATEFILE removal into test_cleanup
Dan Streetman [Fri, 12 Jul 2019 15:47:26 +0000 (11:47 -0400)]
test: add create_empty_image_rootdir() to simplify testcase setup
Almost all tests were manually mounting/unmounting $TESTDIR/root
from the loopback image; this moves all that into test-functions
so the test setup functions are simplier.
Also add test_setup_cleanup() function, to cleanup what is mounted
by create_empty_image_rootdir()
Yu Watanabe [Tue, 16 Jul 2019 01:12:35 +0000 (10:12 +0900)]
test-network: drop warn_about_firewalld() as it is not necessary any more
Yu Watanabe [Tue, 16 Jul 2019 01:12:05 +0000 (10:12 +0900)]
test-network: stop firewalld in setUpModule()
Yu Watanabe [Mon, 3 Jun 2019 22:05:07 +0000 (07:05 +0900)]
test-network: add tests for link state file vs resolvectl or timedatectl
Yu Watanabe [Fri, 12 Jul 2019 05:19:36 +0000 (14:19 +0900)]
resolve: fix memleak
Yu Watanabe [Tue, 28 May 2019 03:48:46 +0000 (12:48 +0900)]
bash-completion: support ntp-servers and revert command for timedatectl
Yu Watanabe [Tue, 28 May 2019 03:07:47 +0000 (12:07 +0900)]
timedatectl: add 'ntp-servers' and 'revert' commands to modify link NTP servers
Yu Watanabe [Mon, 27 May 2019 01:50:52 +0000 (10:50 +0900)]
resolvectl: support networkd managed interfaces
Closes #9808.
Yu Watanabe [Sun, 26 May 2019 23:52:27 +0000 (08:52 +0900)]
network: implement DBus methods to set DNS related properties
Yu Watanabe [Sun, 26 May 2019 23:35:28 +0000 (08:35 +0900)]
resolve: expose dns_server_address_valid()
Yu Watanabe [Fri, 12 Jul 2019 02:11:08 +0000 (11:11 +0900)]
network: introduce GetLinkByName and GetLinkByIndex bus methods
Yu Watanabe [Sun, 26 May 2019 20:35:52 +0000 (05:35 +0900)]
network: implement ListLinks DBus method
Yu Watanabe [Tue, 2 Jul 2019 14:26:03 +0000 (23:26 +0900)]
network: move manager dbus prototypes to networkd-manager-bus.h
Yu Watanabe [Tue, 16 Jul 2019 21:56:32 +0000 (06:56 +0900)]
Merge pull request #13069 from yuwata/network-do-not-set-routes-when-carrier-lost
network: do not configure routes when dropping addresses
Franck Bui [Wed, 10 Jul 2019 15:00:46 +0000 (17:00 +0200)]
pid1: make sure to restore correct default values for some rlimits
Commit
fb39af4ce42d7ef9af63009f271f404038703704 forgot to restore the default
rlimit values (RLIMIT_NOFILE and RLIMIT_MEMLOCK) while PID1 is reloading.
This patch extracts the code in charge of initializing the default values for
those rlimits in order to create dedicated functions, which take care of their
initialization.
These functions are then called in parse_configuration() so we make sure that
the default values for these rlimits get restored every time PID1 is reloading
its configuration.
Frantisek Sumsal [Tue, 16 Jul 2019 18:51:59 +0000 (18:51 +0000)]
Merge pull request #12851 from evverx/test-01-basic-asan
tests: run TEST-01-BASIC under ASAN+UBSan again
Frantisek Sumsal [Tue, 16 Jul 2019 18:46:30 +0000 (18:46 +0000)]
Merge pull request #13077 from poettering/activate-n-fds
activate: move array allocation to heap
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 18:02:26 +0000 (20:02 +0200)]
Merge pull request #13076 from keszybz/pr/13062
Timer formatting fixes
Yu Watanabe [Tue, 16 Jul 2019 16:01:07 +0000 (01:01 +0900)]
test-network: extend sleep time
Even if addresses provided by DHCP is assigned, the state file may not
be written yet, or resolved may not receive the state change signal
yet, or resolved may not process the signal yet...
Yu Watanabe [Tue, 16 Jul 2019 04:02:38 +0000 (13:02 +0900)]
network: do not configure routes when dropping addresses
Follow-up for
4ff296b02411bb4f0dc38f48cbab06f8645d2a08.
Franck Bui [Fri, 5 Jul 2019 13:35:47 +0000 (15:35 +0200)]
coredump: (void)ify all calls of iovw_put_string_field() where we ignore failure on purpose
All those calls are dealing with optional metadata.
Franck Bui [Thu, 27 Jun 2019 16:23:01 +0000 (18:23 +0200)]
coredump: gather all process metadata in iovecs first and then cache them
Now we first gather all process metadata and populate the process info cache
with them. In this way, the cache only references metadata recorded in iovecs[]
so there's no need to bother freeing (part of) cached metadata later.
The other advantage is that the coredump handler mode and the service mode are
more similar as the cache is populated in the same way for both cases.
It also renames the array indexes so it becomes clear which metadata are passed
by the kernel and which ones are retrieved from the runtime environment.
Franck Bui [Fri, 28 Jun 2019 04:52:07 +0000 (06:52 +0200)]
coredump: use 'input_fd' name for the pipe fd passed by the kernel everywhere
'input_fd' variable name is used mostly everywhere except in process_socket()
where it's named 'coredump_fd', which is pretty confusing since 'coredump_fd'
is used for the coredump filename in submit_coredump().
So let's use 'input_fd' consistently as name for the pipe fd passed by the
kernel.
No functional changes.
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 15:09:29 +0000 (17:09 +0200)]
Merge pull request #13038 from poettering/pam-fixes
tmpfiles factory PAM tweaks
Evgeny Vereshchagin [Tue, 16 Jul 2019 15:01:26 +0000 (15:01 +0000)]
tests: bump up QEMU_MEM
Evgeny Vereshchagin [Tue, 16 Jul 2019 15:01:04 +0000 (15:01 +0000)]
tests: run TEST-01-BASIC under ASAN+UBSan again
Not that `journalctl --flush` is no longer flaky, it should be
safe to bring the test back.
Lennart Poettering [Tue, 16 Jul 2019 14:23:42 +0000 (16:23 +0200)]
Merge pull request #12925 from yuwata/network-generator
network-generator: introduce new tool systemd-network-generator
Lennart Poettering [Tue, 16 Jul 2019 14:03:54 +0000 (16:03 +0200)]
Merge pull request #13074 from poettering/format-tree-many
table_add_many() improvements
Lennart Poettering [Tue, 16 Jul 2019 13:59:31 +0000 (15:59 +0200)]
Merge pull request #13073 from poettering/variety-galore
Variety galore
Lennart Poettering [Tue, 16 Jul 2019 13:22:26 +0000 (15:22 +0200)]
journal: properly read unaligned le64 integers
Fixes: #13051
Replaces: #13064
Lennart Poettering [Tue, 16 Jul 2019 12:52:07 +0000 (14:52 +0200)]
activate: move array allocation to heap
In theory 'n' could get quite large, and some sanitizers notice that,
let's hence avoid the stack, and use the heap instead.
Moreover, there's no need to include the first 3 fds in the array,
close_all() excludes those anyway.
See: #13064
Yu Watanabe [Tue, 16 Jul 2019 01:21:18 +0000 (10:21 +0900)]
wait-online: change log level
During boot, systemd-networkd-wait-online writes following logs many
times:
```
systemd-networkd-wait-online[753]: lo: link is ignored
```
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 12:38:24 +0000 (14:38 +0200)]
Merge pull request #13067 from yuwata/news-network-section
NEWS: update section name
Yu Watanabe [Tue, 16 Jul 2019 01:46:27 +0000 (10:46 +0900)]
doc: update explanation of IPv6AcceptRA=
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 11:32:51 +0000 (13:32 +0200)]
tree-wide: use lowercase table headers
https://github.com/systemd/systemd/pull/13062#discussion_r303847484
> the formatter uppercases them anyway, and this way the JSON output of the
> formatter is nicer as it uses the table header fields 1:1 for the json
> output.
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 11:08:41 +0000 (13:08 +0200)]
pid1: split out another helper func for two similar code paths
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 10:54:05 +0000 (12:54 +0200)]
pid1: split out helper func for two similar code paths
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 10:22:37 +0000 (12:22 +0200)]
run: move comment to appropriate place
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 10:16:24 +0000 (12:16 +0200)]
systemctl: print non-elapsing timers as "n/a" not "(null)"
TimersCalendar={ OnCalendar=1970-01-01 00:00:00 UTC ; next_elapse=(null) }
↓
TimersCalendar={ OnCalendar=1970-01-01 00:00:00 UTC ; next_elapse=n/a }
Zbigniew Jędrzejewski-Szmek [Tue, 16 Jul 2019 11:28:34 +0000 (13:28 +0200)]
Merge pull request #13062 from yuwata/analyze-use-table
systemd-analyze: use Table
Lennart Poettering [Tue, 16 Jul 2019 10:45:38 +0000 (12:45 +0200)]
analyze: port over one part of systemd-analyze to use new table_add_many() concepts
Lennart Poettering [Tue, 16 Jul 2019 10:45:13 +0000 (12:45 +0200)]
format-table: add some minimal testing for new table_add_many() features
Lennart Poettering [Tue, 16 Jul 2019 10:43:42 +0000 (12:43 +0200)]
format-table: add ability to set cell attributes within table_add_many()
table_add_many() is so much shorter and easier to read than
table_add_cell() with its accessors. Let's teach table_add_many() more
tricks, so that reverting to table_add_cell() is not needed that often
anymore.
Lennart Poettering [Tue, 16 Jul 2019 10:42:43 +0000 (12:42 +0200)]
test: make sure colors don't confuse our test
Lennart Poettering [Tue, 16 Jul 2019 10:42:19 +0000 (12:42 +0200)]
format-table: fix parameter name
Lennart Poettering [Tue, 16 Jul 2019 10:09:02 +0000 (12:09 +0200)]
shared: no need to check result of strndupa()
Lennart Poettering [Tue, 16 Jul 2019 10:08:47 +0000 (12:08 +0200)]
tree-wide: use empty-to-root a bit more
Lennart Poettering [Tue, 16 Jul 2019 09:54:12 +0000 (11:54 +0200)]
cryptsetup: no need to zero-initialize zero-initialized structures
Lennart Poettering [Tue, 16 Jul 2019 09:53:31 +0000 (11:53 +0200)]
Merge pull request #13063 from keszybz/cgroup-path-fixes
Cgroup path fixes
Yu Watanabe [Tue, 16 Jul 2019 01:30:47 +0000 (10:30 +0900)]
NEWS: update section name
Yu Watanabe [Tue, 16 Jul 2019 00:38:39 +0000 (09:38 +0900)]
Merge pull request #13058 from yuwata/network-enter-failed
network: make link enter failed state when a configuration fails
Zbigniew Jędrzejewski-Szmek [Mon, 15 Jul 2019 17:11:16 +0000 (19:11 +0200)]
analyze: fix formatting of timestamps with 0 µs
There is a rule that "%.0d" formats 0 as "". There is no such rule for
"%0d" and 0 :(. The output had an extra 0 if usec was 0.
Yu Watanabe [Sun, 14 Jul 2019 16:59:14 +0000 (01:59 +0900)]
tree-wide: drop duplicated blank lines
```
$ for i in */*.[ch] */*/*.[ch]; do sed -e '/^$/ {N; s/\n$//g}' -i $i; done
$ git checkout HEAD -- basic/linux shared/linux
```
Zbigniew Jędrzejewski-Szmek [Mon, 15 Jul 2019 16:16:03 +0000 (18:16 +0200)]
Apply empty_to_root() in three more spots for safety
Zbigniew Jędrzejewski-Szmek [Mon, 15 Jul 2019 15:29:56 +0000 (17:29 +0200)]
pid1: fix GetUnitProcesses
This effectively reverts one chunk of
657ee2d82b73818d0ee8c3c5962c1cb2dbd52b76.
For a while I couldn't figure out why 'systemctl status -- -.slice' fails to
list any processes...
Zbigniew Jędrzejewski-Szmek [Mon, 15 Jul 2019 15:27:26 +0000 (17:27 +0200)]
systemctl: emit warning when we get an invalid process entry from pid1 and continue
Output looks like this:
Invalid process description in GetUnitProcesses reply: cgroup="machine.slice/machine-rawhide.scope/payload/system.slice/systemd-journald.service" pid=638367 command="/usr/lib/systemd/systemd-journald", ignoring: Invalid argument
Yu Watanabe [Mon, 15 Jul 2019 05:18:06 +0000 (14:18 +0900)]
test-network: make wait_online() check setup state
Previously, event if link's setup state is in failed, tests may pass,
as systemd-networkd-wait-online success if the state is in failed state.
This makes tests be checked more strictly.
Yu Watanabe [Mon, 15 Jul 2019 16:15:57 +0000 (01:15 +0900)]
bash-completion: add missing 'systemd-analyze timestamp'
Yu Watanabe [Mon, 15 Jul 2019 16:14:20 +0000 (01:14 +0900)]
analyze: format output of 'systemd-analyze timestamp' by using Table
Yu Watanabe [Mon, 15 Jul 2019 16:07:31 +0000 (01:07 +0900)]
analyze: format output of 'systemd-analyze timespan' by using Table
Yu Watanabe [Mon, 15 Jul 2019 15:45:05 +0000 (00:45 +0900)]
analyze: format output of 'systemd-analyze calendar' by using Table
Yu Watanabe [Mon, 15 Jul 2019 15:44:14 +0000 (00:44 +0900)]
format-table: add TABLE_TIMESTAMP_UTC and _RELATIVE
Yu Watanabe [Mon, 15 Jul 2019 15:19:59 +0000 (00:19 +0900)]
analyze: format output of 'systemd-analyze blame' by using Table