Commit graph

41112 commits

Author SHA1 Message Date
Yu Watanabe 693283cd58 Revert "test-network: extend sleep time"
This reverts commit 7d7bb5c861.

Still the CIs are flaky and the commit just slow down them.
2019-07-17 23:13:40 +09:00
Yu Watanabe 9fdae8d5b2 man: fix wrong section name 2019-07-17 23:13:40 +09:00
Yu Watanabe 26a65470ba network: fix use after free()
The hashmap will be accessed by client_stop().
2019-07-17 23:13:40 +09:00
Yu Watanabe 2eff7cc59c network: drop unnecessary line breaks 2019-07-17 23:13:40 +09:00
Yu Watanabe 8107f4731e 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.
2019-07-17 23:13:40 +09:00
Lennart Poettering 81c07a9555
Merge pull request #13080 from keszybz/firstboot-fixes
Firstboot fixes
2019-07-17 14:43:15 +02:00
Zbigniew Jędrzejewski-Szmek 6176e89c20 systemctl: call the unit dbus path dbus_path everywhere
Similar variables had differing names: unit, path, unit_path. We also
have file system paths in surrounding code. Let's make this easier for
the reader and use "dbus_path" consistently.
2019-07-17 14:35:35 +02:00
Zbigniew Jędrzejewski-Szmek 043fdc4010 pid1: kill unit_file_find_dropin_paths() helper
It had two users, but it is just a very thin wrapper around
unit_file_find_dropin_paths(), so using it seems more complicated than directly
invoking unit_file_find_dropin_paths() twice.
2019-07-17 14:27:23 +02:00
Zbigniew Jędrzejewski-Szmek b5328434c9 man: rework the description of Aliases and .wants/.requires directories
The description of Alias= wasn't incorrect, but it sounded like Alias= creates
a different type of dependency, while it's just a glorified way to create
symlinks. Also recommend 'preset' in addition to 'enable'.

Describe .wants/.requires dirs as equals, without implying that the [Install]
section can only be used for .wants.

The text was partially out of date (systemd-networkd.service now creates as
alias in /etc, not /usr/lib, let's just not say anything about the full path).
2019-07-17 14:27:23 +02:00
Dan Streetman 2a2aeed460 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.
2019-07-17 14:25:27 +02:00
Zbigniew Jędrzejewski-Szmek d268ab389c Rewrite IN_SET()
This restores proper speed with asan builds with gcc 9.1.1.
Fixes #12997.

$ rpm -q gcc
gcc-9.1.1-2.fc31.x86_64

$ time ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1 UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1 build-rawhide-sanitize/test-conf-parser

(old) 86.99s user 20.22s system 361% cpu 29.635 total
(new)  3.05s user  0.29s system  99% cpu  3.377 total

Size is increased a bit:

$ size build/systemd
(old) 1683421	 246100	   1208	1930729	 1d75e9	build/systemd
(new) 1688237	 246100	   1208	1935545	 1d88b9	build/systemd

... but that's <0.1%, so we don't really care.
2019-07-17 14:22:53 +02:00
Lennart Poettering 76c887fdaa
Merge pull request #13092 from keszybz/coverity-fixes
Coverity fixes
2019-07-17 14:18:49 +02:00
Lennart Poettering 5f3626bb13
Merge pull request #13091 from poettering/nspawn-copy
nspawn: allow nspawn's copy operation to be abortable via C-c
2019-07-17 14:10:06 +02:00
Zbigniew Jędrzejewski-Szmek ab1a1ba5dc Drop trailing slash from assert_cc() definition
We use assert_cc(...); almost everywhere. Let's always require that.

https://github.com/systemd/systemd/issues/12997#issuecomment-510103988
2019-07-17 12:57:20 +02:00
Zbigniew Jędrzejewski-Szmek cfec3117d4 basic/macro: drop do {} while(0) from assert_not_reached
log_assert_failed_unreachable is just a normal function call, no need to wrap
it.

https://github.com/systemd/systemd/issues/12997#issuecomment-510103988
2019-07-17 12:27:33 +02:00
Lennart Poettering 52f4b5ac8a
Merge pull request #12675 from yuwata/network-set-dns
resolvectl: support to modify interfaces managed by networkd
2019-07-17 12:07:39 +02:00
Zbigniew Jędrzejewski-Szmek 03d9429468 firstboot: actually accept empty input to mean skip
We'd loop if the input was empty. We need to return to the caller.
2019-07-17 12:07:19 +02:00
Zbigniew Jędrzejewski-Szmek ee41670ffb 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.
2019-07-17 12:07:19 +02:00
Zbigniew Jędrzejewski-Szmek ecada8f25e 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.
2019-07-17 12:07:19 +02:00
Zbigniew Jędrzejewski-Szmek bfbf5f7408 firstboot: use free_and_strdup, free_and_replace 2019-07-17 12:07:19 +02:00
Jakob Unterwurzacher d34a40082d 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
2019-07-17 11:37:09 +02:00
Zbigniew Jędrzejewski-Szmek 7b9103a622 sd-device: voidify and simplify calls to ordered_hashmap_iterate()
Coverity CID#1402356 and CID#1402335.
2019-07-17 11:35:04 +02:00
Zbigniew Jędrzejewski-Szmek 3d4d5abf2a sd-bus: voidify two calls to hashmap_iterate()
Coverity CID#1402304 and CID#1402307.
2019-07-17 11:35:04 +02:00
Zbigniew Jędrzejewski-Szmek 4337b0afae 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.
2019-07-17 11:35:04 +02:00
Zbigniew Jędrzejewski-Szmek 8a07b4033e 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.
2019-07-17 11:35:04 +02:00
Zbigniew Jędrzejewski-Szmek fa8b675ae0 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.
2019-07-17 11:35:04 +02:00
Zbigniew Jędrzejewski-Szmek 622ecfa869 nspawn: fix memleak in argument parsing
Coverity CID#1402297.
2019-07-17 11:35:04 +02:00
Zbigniew Jędrzejewski-Szmek 2d0a880fea coredumpctl: check return value
retrieve() allocates memory, so it may fail.
Coverity CID#1402338.
2019-07-17 11:35:04 +02:00
Zbigniew Jędrzejewski-Szmek eba048bb6e coredumpctl: use free_and_replace in one more place 2019-07-17 11:35:04 +02:00
Zbigniew Jędrzejewski-Szmek ba5d26ccb2 shared: voidify call to loop_write() and trim duplicate code
Coverity CID#1402375.
2019-07-17 11:35:04 +02:00
Zbigniew Jędrzejewski-Szmek 60b17d6fcd shared: fix assert call
Fixup for 3572d3df8f. Coverity CID#1403013.
2019-07-17 11:35:04 +02:00
Anita Zhang 31cd5f63ce core: ExecCondition= for services
Closes #10596
2019-07-17 11:35:02 +02:00
Lennart Poettering 7bf011e355 nspawn: make use of SIGINT handling when copying files
Fixes: #13079
2019-07-17 11:14:11 +02:00
Lennart Poettering 07a30bb18a btrfs-util: expose SIGINT behaviour in snapshot copy fallback, too 2019-07-17 11:14:11 +02:00
Lennart Poettering 85559592a6 copy: optionally check for SIGINT regularly, and abort operation safely 2019-07-17 11:14:11 +02:00
Zbigniew Jędrzejewski-Szmek cc2f3f05a7
Merge pull request #12927 from fbuihuu/coredump-cleanup-part-2
Coredump cleanup part 2
2019-07-17 09:14:20 +02:00
Zbigniew Jędrzejewski-Szmek 4a747647b3
Merge pull request #13082 from ddstreet/minor
Minor fixes in test framework
2019-07-17 08:44:01 +02:00
Dan Streetman 59279e9618 test/test-functions: fix install_dmeventd to correctly install bin/libs 2019-07-17 08:34:48 +02:00
Evgeny Vereshchagin b5efca2a65 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.
2019-07-17 13:28:38 +09:00
Dan Streetman e96386521c 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.
2019-07-16 18:05:15 -04:00
Dan Streetman d391ee10a0 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.
2019-07-16 18:05:15 -04:00
Dan Streetman f85bc044e5 test: ignore errors during test cleanup, so cleanup can finish
Also move TESTDIR and STATEFILE removal into test_cleanup
2019-07-16 18:05:15 -04:00
Dan Streetman ec4cab49c9 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()
2019-07-16 18:05:15 -04:00
Yu Watanabe 217246a990 test-network: drop warn_about_firewalld() as it is not necessary any more 2019-07-17 06:59:12 +09:00
Yu Watanabe 2225e7fd88 test-network: stop firewalld in setUpModule() 2019-07-17 06:59:12 +09:00
Yu Watanabe 336d18f0ff test-network: add tests for link state file vs resolvectl or timedatectl 2019-07-17 06:59:12 +09:00
Yu Watanabe 2400ae29a5 resolve: fix memleak 2019-07-17 06:59:12 +09:00
Yu Watanabe 0a0564a1b5 bash-completion: support ntp-servers and revert command for timedatectl 2019-07-17 06:59:12 +09:00
Yu Watanabe 159a855b34 timedatectl: add 'ntp-servers' and 'revert' commands to modify link NTP servers 2019-07-17 06:59:12 +09:00
Yu Watanabe 65856bf208 resolvectl: support networkd managed interfaces
Closes #9808.
2019-07-17 06:59:12 +09:00