Commit graph

26400 commits

Author SHA1 Message Date
Lennart Poettering 81c07a9555
Merge pull request #13080 from keszybz/firstboot-fixes
Firstboot fixes
2019-07-17 14:43:15 +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
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
Yu Watanabe 2400ae29a5 resolve: fix memleak 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
Yu Watanabe 1576154957 network: implement DBus methods to set DNS related properties 2019-07-17 06:59:12 +09:00
Yu Watanabe 00d28db322 resolve: expose dns_server_address_valid() 2019-07-17 06:59:12 +09:00
Yu Watanabe 071712b281 network: introduce GetLinkByName and GetLinkByIndex bus methods 2019-07-17 06:59:12 +09:00
Yu Watanabe 37d577c895 network: implement ListLinks DBus method 2019-07-17 06:59:12 +09:00
Yu Watanabe 79a59fa51d network: move manager dbus prototypes to networkd-manager-bus.h 2019-07-17 06:59:12 +09:00
Yu Watanabe 26408c7d5f
Merge pull request #13069 from yuwata/network-do-not-set-routes-when-carrier-lost
network: do not configure routes when dropping addresses
2019-07-17 06:56:32 +09:00
Franck Bui a9fd4cd120 pid1: make sure to restore correct default values for some rlimits
Commit fb39af4ce4 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.
2019-07-17 06:24:27 +09:00
Frantisek Sumsal 64c3b40c25
Merge pull request #13077 from poettering/activate-n-fds
activate: move array allocation to heap
2019-07-16 18:46:30 +00:00
Zbigniew Jędrzejewski-Szmek 3151b668c2
Merge pull request #13076 from keszybz/pr/13062
Timer formatting fixes
2019-07-16 20:02:26 +02:00
Yu Watanabe 4e2ef9d9d1 network: do not configure routes when dropping addresses
Follow-up for 4ff296b024.
2019-07-17 00:51:46 +09:00
Franck Bui 2a3bebd02a coredump: (void)ify all calls of iovw_put_string_field() where we ignore failure on purpose
All those calls are dealing with optional metadata.
2019-07-16 17:41:07 +02:00
Franck Bui f46c706bdd 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.
2019-07-16 17:40:35 +02:00
Franck Bui f8540bde72 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.
2019-07-16 17:39:19 +02:00
Lennart Poettering 15bcd9fa09
Merge pull request #12925 from yuwata/network-generator
network-generator: introduce new tool systemd-network-generator
2019-07-16 16:23:42 +02:00
Lennart Poettering c1b71f3a61
Merge pull request #13074 from poettering/format-tree-many
table_add_many() improvements
2019-07-16 16:03:54 +02:00
Lennart Poettering 4119ad492f
Merge pull request #13073 from poettering/variety-galore
Variety galore
2019-07-16 15:59:31 +02:00
Lennart Poettering 4094c4bfb7 journal: properly read unaligned le64 integers
Fixes: #13051

Replaces: #13064
2019-07-16 15:22:26 +02:00
Lennart Poettering 49aca3b152 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
2019-07-16 14:56:25 +02:00
Yu Watanabe 476da0fe00 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
```
2019-07-16 14:39:02 +02:00
Zbigniew Jędrzejewski-Szmek 4252171a94 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.
2019-07-16 14:29:04 +02:00
Zbigniew Jędrzejewski-Szmek cd87f6340f pid1: split out another helper func for two similar code paths 2019-07-16 14:29:04 +02:00
Zbigniew Jędrzejewski-Szmek d00a52c737 pid1: split out helper func for two similar code paths 2019-07-16 14:29:04 +02:00
Zbigniew Jędrzejewski-Szmek 7842c5f2e2 run: move comment to appropriate place 2019-07-16 14:29:04 +02:00