]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agohwdb/sdio.ids: add BCM43438 + minor rewording of class name
Burt P [Sun, 30 Dec 2018 03:49:49 +0000 (21:49 -0600)] 
hwdb/sdio.ids: add BCM43438 + minor rewording of class name

* BCM43438 is used in the Raspberry Pi 3 B and B+
  https://www.raspberrypi.org/products/raspberry-pi-3-model-b/
  "BCM43438 wireless LAN and Bluetooth Low Energy (BLE) on board"
* With this minor change to "C 00", each class name could be prefixed
  with "Is a" and still make sense.

Signed-off-by: Burt P <pburt0@gmail.com>
5 years agoMerge pull request #11297 from yuwata/fix-11295
Zbigniew Jędrzejewski-Szmek [Wed, 2 Jan 2019 07:19:27 +0000 (08:19 +0100)] 
Merge pull request #11297 from yuwata/fix-11295

ask-password: fix assertion

5 years agotest: add test for sending/receiving an invalid device 11244/head
Yu Watanabe [Sat, 22 Dec 2018 18:28:28 +0000 (03:28 +0900)] 
test: add test for sending/receiving an invalid device

5 years agoRevert "udevd: configure a child process name for worker processes"
Yu Watanabe [Sat, 22 Dec 2018 10:49:47 +0000 (19:49 +0900)] 
Revert "udevd: configure a child process name for worker processes"

This reverts commit 49f3ee7e74c714f55aab395c080b1099fc17f7fd.

5 years agoRevert "sd-device: ignore bind/unbind events for now"
Yu Watanabe [Tue, 1 Jan 2019 19:00:14 +0000 (04:00 +0900)] 
Revert "sd-device: ignore bind/unbind events for now"

This reverts commit 56c886dc7ed5b2bb0882ba85136f4070545bfc1b.

Fixes #11277 and #11299.

5 years agomeson: check whether C.UTF-8 exists or not and use it if exists 11291/head
Yu Watanabe [Sat, 29 Dec 2018 13:00:07 +0000 (22:00 +0900)] 
meson: check whether C.UTF-8 exists or not and use it if exists

If C.UTF-8 does not exist, then fallback to en_US.UTF-8 or C.

5 years agozsh/coredumpctl: don't print warnings from completion function 11273/head
Paul Seyfert [Mon, 31 Dec 2018 20:27:09 +0000 (21:27 +0100)] 
zsh/coredumpctl: don't print warnings from completion function

5 years agosd-device: fix segfault when error occurs in device_new_from_{nulstr,strv}()
Yu Watanabe [Sat, 22 Dec 2018 18:06:47 +0000 (03:06 +0900)] 
sd-device: fix segfault when error occurs in device_new_from_{nulstr,strv}()

As devpath may not be set yet.

When debug logging is enabled, log_device_*() calls
sd_device_get_sysname(). So, we should not assume that devpath is always
set.

Fixes #11258.

5 years agoask-password-api: do not call ask_password_keyring() if keyname == NULL 11297/head
Yu Watanabe [Sun, 30 Dec 2018 12:13:43 +0000 (21:13 +0900)] 
ask-password-api: do not call ask_password_keyring() if keyname == NULL

Fixes #11295.

5 years agoask-password: make ask_password_keyring() static
Yu Watanabe [Sun, 30 Dec 2018 12:09:41 +0000 (21:09 +0900)] 
ask-password: make ask_password_keyring() static

5 years agoImprove kernel-install support for initrd files. (#11281)
ikelos [Sat, 29 Dec 2018 19:01:10 +0000 (19:01 +0000)] 
Improve kernel-install support for initrd files. (#11281)

The current support in kernel-install for initrd images doesn't copy
over the initrd file or allow a means for it to be specified (it
requires a specific filename in a particular directory).

This patchset adds support for (optionally) providing the name of
initial ramdisk file to copied over and used by kernel-install.

5 years agotests: introduce check_asan_reports and use it in check_result_{qemu|nspawn} 11252/head
Evgeny Vereshchagin [Tue, 25 Dec 2018 07:31:50 +0000 (08:31 +0100)] 
tests: introduce check_asan_reports and use it in check_result_{qemu|nspawn}

5 years agotests: look for ASan+UBSan reports in the journal
Evgeny Vereshchagin [Sun, 23 Dec 2018 14:48:18 +0000 (15:48 +0100)] 
tests: look for ASan+UBSan reports in the journal

5 years agotests: double DefaultTimeoutStartSec when systemd is run under ASan+UBSan
Evgeny Vereshchagin [Tue, 25 Dec 2018 05:13:45 +0000 (06:13 +0100)] 
tests: double DefaultTimeoutStartSec when systemd is run under ASan+UBSan

5 years agotravis: also run TEST-01-BASIC with QEMU to cover udevd and so on
Evgeny Vereshchagin [Tue, 25 Dec 2018 04:56:46 +0000 (05:56 +0100)] 
travis: also run TEST-01-BASIC with QEMU to cover udevd and so on

5 years agotravis: pass $TRAVIS when running the tests so that they can be skipped properly
Evgeny Vereshchagin [Mon, 24 Dec 2018 03:44:47 +0000 (04:44 +0100)] 
travis: pass $TRAVIS when running the tests so that they can be skipped properly

5 years agotravis: merge RUN_CLANG into RUN
Evgeny Vereshchagin [Mon, 24 Dec 2018 03:03:40 +0000 (04:03 +0100)] 
travis: merge RUN_CLANG into RUN

They are basically the same except that a couple of environment variables
have to be passed for building systemd with clang.

5 years agotests: overwrite a hard-coded timeout in systemd-hwdb-update.service
Evgeny Vereshchagin [Mon, 24 Dec 2018 00:15:43 +0000 (01:15 +0100)] 
tests: overwrite a hard-coded timeout in systemd-hwdb-update.service

5 years agojournal: rely on _cleanup_free_ to free a temporary string used in client_context_rea...
Evgeny Vereshchagin [Sun, 23 Dec 2018 23:29:56 +0000 (00:29 +0100)] 
journal: rely on _cleanup_free_ to free a temporary string used in client_context_read_cgroup

Closes https://github.com/systemd/systemd/issues/11253.

5 years agotests: fail if asan has found issues in journald
Evgeny Vereshchagin [Sun, 23 Dec 2018 14:30:41 +0000 (15:30 +0100)] 
tests: fail if asan has found issues in journald

5 years agotests: reproduce https://github.com/systemd/systemd/issues/11251
Evgeny Vereshchagin [Sun, 23 Dec 2018 13:46:00 +0000 (14:46 +0100)] 
tests: reproduce https://github.com/systemd/systemd/issues/11251

5 years agoMake default locale a compile time option
Dave Reisner [Fri, 28 Dec 2018 12:38:36 +0000 (07:38 -0500)] 
Make default locale a compile time option

Default to a locale that's guaranteed to exist everywhere, but let
distros override this with something more exotic if they choose to.

Closes #11259.

5 years agobuild: don't include shared's "serialize.h" in basic's "time-util.c"
Thomas Haller [Fri, 28 Dec 2018 16:14:01 +0000 (17:14 +0100)] 
build: don't include shared's "serialize.h" in basic's "time-util.c"

"src/basic/time-util.c" is part of src/basic and should not include
"src/shared/serialize.h". It is one of the few cases where this
is done. Also, it's not even required.

5 years agoReplace 'older then' with 'older than'
Jani Uusitalo [Fri, 28 Dec 2018 18:35:46 +0000 (20:35 +0200)] 
Replace 'older then' with 'older than'

5 years agoudev-event: do not read stdout or stderr if the pipefd is not created
Yu Watanabe [Tue, 25 Dec 2018 15:36:55 +0000 (00:36 +0900)] 
udev-event: do not read stdout or stderr if the pipefd is not created

Fixes #11255.

5 years agoswitch-root: fix error message
Yu Watanabe [Tue, 25 Dec 2018 04:10:18 +0000 (13:10 +0900)] 
switch-root: fix error message

Fixes #11261.

5 years agocore: free lines after reading them
Evgeny Vereshchagin [Sun, 23 Dec 2018 14:01:03 +0000 (15:01 +0100)] 
core: free lines after reading them

Closes https://github.com/systemd/systemd/issues/11251.

5 years agoDo not start server if it is already runnning (#11245)
rogerjames99 [Fri, 28 Dec 2018 06:34:43 +0000 (06:34 +0000)] 
Do not start server if it is already runnning (#11245)

5 years agomeson: use cross compilation compatible c++ check
James Hilliard [Thu, 27 Dec 2018 01:16:20 +0000 (09:16 +0800)] 
meson: use cross compilation compatible c++ check

5 years agozsh/coredumpctl: offer --quiet
Paul Seyfert [Wed, 26 Dec 2018 13:02:06 +0000 (14:02 +0100)] 
zsh/coredumpctl: offer --quiet

5 years agozsh/coredumpctl: offer --directory option
Paul Seyfert [Tue, 25 Dec 2018 21:57:23 +0000 (22:57 +0100)] 
zsh/coredumpctl: offer --directory option

After `-D <TAB>` and `--directory=<TAB>` _directories is called to
suggest directories.

5 years agozsh/coredumpctl: complete argument for --debugger=
Paul Seyfert [Tue, 25 Dec 2018 18:30:50 +0000 (19:30 +0100)] 
zsh/coredumpctl: complete argument for --debugger=

This way external commands (i.e. executables in the PATH) are suggested
at --debugger=<TAB>. Upon starting a path (e.g. --debugger=/<TAB> or
--debugger=./<TAB>), filenames of executables are completed.

5 years agotest: don't run TEST-01-BASIC in unprivileged containers on Travis CI
Evgeny Vereshchagin [Sun, 23 Dec 2018 13:28:01 +0000 (14:28 +0100)] 
test: don't run TEST-01-BASIC in unprivileged containers on Travis CI

5 years agotests: use systemd-journald to check whether everything has been built with ASan
Evgeny Vereshchagin [Sun, 23 Dec 2018 13:12:20 +0000 (14:12 +0100)] 
tests: use systemd-journald to check whether everything has been built with ASan

5 years agotravis: add another stage to really run everything under ASan+UBsan
Evgeny Vereshchagin [Sun, 23 Dec 2018 12:31:14 +0000 (13:31 +0100)] 
travis: add another stage to really run everything under ASan+UBsan

This should help to catch issues like https://github.com/systemd/systemd/issues/11253
and https://github.com/systemd/systemd/issues/11251.

5 years agotravis: switch to Debian Testing
Evgeny Vereshchagin [Sun, 23 Dec 2018 12:01:41 +0000 (13:01 +0100)] 
travis: switch to Debian Testing

Turns out Fedora is the least stable distribution in terms of
downloading packages. Debian is much more stable so let's use it.

5 years agotravis: skip test-bpf on Travis CI
Evgeny Vereshchagin [Sun, 23 Dec 2018 11:04:20 +0000 (12:04 +0100)] 
travis: skip test-bpf on Travis CI

More generally IPAddress[Allow|Deny] are broken in docker and lxc containers.

5 years agotravis: use xenial instead of trusty
Evgeny Vereshchagin [Sun, 23 Dec 2018 10:10:06 +0000 (11:10 +0100)] 
travis: use xenial instead of trusty

This should also fix an issue mentioned in
https://github.com/systemd/systemd/pull/11196#issuecomment-448123946.

5 years agotest: add a testcase for Address.Peer= in .network unit 11232/head
Yu Watanabe [Fri, 21 Dec 2018 06:53:41 +0000 (15:53 +0900)] 
test: add a testcase for Address.Peer= in .network unit

5 years agonetwork: always check link is ready when address is updated
Yu Watanabe [Fri, 21 Dec 2018 06:52:33 +0000 (15:52 +0900)] 
network: always check link is ready when address is updated

5 years agonetwork: fix indentation 11250/head
Yu Watanabe [Sat, 22 Dec 2018 22:59:54 +0000 (07:59 +0900)] 
network: fix indentation

5 years agodhcp: drop unnecessary brackets
Yu Watanabe [Sat, 22 Dec 2018 22:59:20 +0000 (07:59 +0900)] 
dhcp: drop unnecessary brackets

5 years agodhcp: use cast-to-bool for pointers
Yu Watanabe [Sat, 22 Dec 2018 22:58:58 +0000 (07:58 +0900)] 
dhcp: use cast-to-bool for pointers

5 years agodhcp: fix indentation
Yu Watanabe [Sat, 22 Dec 2018 22:57:28 +0000 (07:57 +0900)] 
dhcp: fix indentation

5 years agonetwork: decrease and fix indentation
Yu Watanabe [Fri, 21 Dec 2018 02:31:00 +0000 (11:31 +0900)] 
network: decrease and fix indentation

5 years agocore: support %j in unit dependency resolution
Patrick Williams [Thu, 20 Dec 2018 14:59:18 +0000 (08:59 -0600)] 
core: support %j in unit dependency resolution

Commit 250e9fadbcc0ca90e697d7efb40855b054ed3b8f introduced
support for %j/%J specifier in unit files.  The function
unit_name_printf is used in unit dependency resolution,
such as Wants / After directives, but was missing support
for the %j.  Add to allow directives such as:

    [Unit]
    Wants=bar-%j.target

Fixes: systemd/systemd#11217
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
5 years agoNEWS: add one more name and adjust location v240
Zbigniew Jędrzejewski-Szmek [Fri, 21 Dec 2018 18:52:16 +0000 (19:52 +0100)] 
NEWS: add one more name and adjust location

5 years agoMerge pull request #11239 from poettering/news-v240-final
Zbigniew Jędrzejewski-Szmek [Fri, 21 Dec 2018 18:49:54 +0000 (19:49 +0100)] 
Merge pull request #11239 from poettering/news-v240-final

NEWS and build system bump for 240

5 years agotree-wide: use assert_se() for signal operations with constants
Zbigniew Jędrzejewski-Szmek [Fri, 21 Dec 2018 08:20:15 +0000 (09:20 +0100)] 
tree-wide: use assert_se() for signal operations with constants

Continuation of a3ebe5eb620e49f0d24082876cafc7579261e64f:
in other places we sometimes use assert_se(), and sometimes normal error
handling. sigfillset and sigaddset can only fail if mask is NULL (which cannot
happen if we are passing in a reference), or if the signal number is invalid
(which really shouldn't happen when we are using a constant like SIGCHLD. If
SIGCHLD is invalid, we have a bigger problem). So let's simplify things and
always use assert_se() in those cases.

In sigset_add_many() we could conceivably pass an invalid signal, so let's keep
normal error handling here. The caller can do assert_se() around the
sigprocmask_many() call if appropriate.

'>= 0' is used for consistency with the rest of the codebase.

5 years agoMerge pull request #11206 from cdown/cgroup_no_v1
Zbigniew Jędrzejewski-Szmek [Fri, 21 Dec 2018 18:48:51 +0000 (19:48 +0100)] 
Merge pull request #11206 from cdown/cgroup_no_v1

cgroup: Imply systemd.unified_cgroup_hierarchy=1 on cgroup_no_v1=all

5 years agosd-device: ignore bind/unbind events for now
Dmitry Torokhov [Sun, 9 Dec 2018 19:59:34 +0000 (11:59 -0800)] 
sd-device: ignore bind/unbind events for now

Until systemd/udev are ready for the new events and do not flush entire
device state on each new event received, we should ignore them.

5 years agoRevert "sleep: offer hibernation only if the kernel image still exists"
Zbigniew Jędrzejewski-Szmek [Fri, 21 Dec 2018 10:01:34 +0000 (11:01 +0100)] 
Revert "sleep: offer hibernation only if the kernel image still exists"

This reverts commit edda44605f06a41fb86b7ab8128dcf99161d2344.

The kernel explicitly supports resuming with a different kernel than the one
used before hibernation. If this is something that shouldn't be supported, the
place to change this is in the kernel. We shouldn't censor something that this
exclusively in the kernel's domain.

People might be using this to switch kernels without restaring programs, and
we'd break this functionality for them.

Also, even if resuming with a different kernel was a bad idea, we don't really
prevent that with this check, since most users have more than one kernel and
can freely pick a different one from the menu. So this only affected the corner
case where the kernel has been removed, but there is no reason to single it
out.

5 years agoMerge pull request #11050 from poettering/resolved-domain-route
Lennart Poettering [Fri, 21 Dec 2018 17:03:58 +0000 (18:03 +0100)] 
Merge pull request #11050 from poettering/resolved-domain-route

resolved: beef up domain routing

5 years agoMerge pull request #11210 from thom311/dhcp-set-client-id-no-inval
Lennart Poettering [Fri, 21 Dec 2018 17:00:42 +0000 (18:00 +0100)] 
Merge pull request #11210 from thom311/dhcp-set-client-id-no-inval

dhcp: don't enforce hardware address length for sd_dhcp_client_set_client_id()

5 years agolldp: add 802.3 OUI subtype definitions 11241/head
Beniamino Galvani [Fri, 21 Dec 2018 16:29:37 +0000 (17:29 +0100)] 
lldp: add 802.3 OUI subtype definitions

5 years agolldp: fix references to IEEE standard
Beniamino Galvani [Fri, 21 Dec 2018 16:07:13 +0000 (17:07 +0100)] 
lldp: fix references to IEEE standard

It's 802.1AB, not 802.3AB. Also, the clause numbers referenced the old 2005
standard superseded by one from 2009.

5 years agotree-wide: make new/new0/malloc_multiply/reallocarray safe for size 0
Zbigniew Jędrzejewski-Szmek [Fri, 21 Dec 2018 09:21:41 +0000 (10:21 +0100)] 
tree-wide: make new/new0/malloc_multiply/reallocarray safe for size 0

All underlying glibc calls are free to return NULL if the size argument
is 0. We most often call those functions with a fixed argument, or at least
something which obviously cannot be zero, but it's too easy to forget.

E.g. coverity complains about "rows = new0(JsonVariant*, n_rows-1);" in
format-table.c There is an assert that n_rows > 0, so we could hit this
corner case here. Let's simplify callers and make those functions "safe".

CID #1397035.

The compiler is mostly able to optimize this away:
$ size build{,-opt}/src/shared/libsystemd-shared-239.so
(before)
   text    data     bss     dec     hex filename
2643329  580940    3112 3227381  313ef5 build/src/shared/libsystemd-shared-239.so     (-O0 -g)
2170013  578588    3089 2751690  29fcca build-opt/src/shared/libsystemd-shared-239.so (-03 -flto -g)
(after)
   text    data     bss     dec     hex filename
2644017  580940    3112 3228069  3141a5 build/src/shared/libsystemd-shared-239.so
2170765  578588    3057 2752410  29ff9a build-opt/src/shared/libsystemd-shared-239.so

5 years agoanalyze: add assert to verify we are not dividing by 0
Zbigniew Jędrzejewski-Szmek [Fri, 21 Dec 2018 07:20:41 +0000 (08:20 +0100)] 
analyze: add assert to verify we are not dividing by 0

CID #1397051.

5 years agoudevadm: add two more assertions
Yu Watanabe [Fri, 21 Dec 2018 07:12:45 +0000 (16:12 +0900)] 
udevadm: add two more assertions

Suggested by Coverity.

Closes CID#1397033 and CID#1395708.

5 years agoNEWS: prepare for v240 11239/head
Lennart Poettering [Fri, 21 Dec 2018 14:02:11 +0000 (15:02 +0100)] 
NEWS: prepare for v240

5 years agobuild-sys: bump package/library versions
Lennart Poettering [Fri, 21 Dec 2018 13:58:49 +0000 (14:58 +0100)] 
build-sys: bump package/library versions

5 years agocgroup: Add NEWS entry for cgroup_no_v1=all implying unified usage 11206/head
Chris Down [Fri, 21 Dec 2018 13:07:45 +0000 (13:07 +0000)] 
cgroup: Add NEWS entry for cgroup_no_v1=all implying unified usage

5 years agocgroup: Imply systemd.unified_cgroup_hierarchy=1 on cgroup_no_v1=all
Chris Down [Wed, 19 Dec 2018 03:33:53 +0000 (03:33 +0000)] 
cgroup: Imply systemd.unified_cgroup_hierarchy=1 on cgroup_no_v1=all

cgroup_no_v1=all doesn't make a whole lot of sense with legacy hierarchy
(where we use v1 hierarchy for everything), or hybrid hierarchy (where
we still use v1 hierarchy for resource control).

Right now we have to tell people to add both cgroup_no_v1=all and
systemd.unified_cgroup_hierarchy=1 to get the desired behaviour,
however in reality it's hard to imagine any situation where someone
passes cgroup_no_v1=all but *doesn't* want to use the unified cgroup
hierarchy.

Make it so that cgroup_no_v1=all produces intuitive behaviour in systemd
by default, although it can still be disabled by passing
systemd.unified_cgroup_hierarchy=0 explicitly.

5 years agomeson: use /bin/bash for script
Zbigniew Jędrzejewski-Szmek [Fri, 21 Dec 2018 06:09:23 +0000 (07:09 +0100)] 
meson: use /bin/bash for script

It seems -o pipefail does not work on Ubunut. /bin/sh is most likely resolved
to dash.

5 years agomeson: declare version.h as dep for fuzzers
Zbigniew Jędrzejewski-Szmek [Thu, 20 Dec 2018 21:33:24 +0000 (22:33 +0100)] 
meson: declare version.h as dep for fuzzers

This is supposed an error when building fuzzers for sanitization (that is a
nested build with the sanitization options):

In file included from ../../../../src/basic/util.c:21:0:
../../../../src/basic/build.h:4:21: fatal error: version.h: No such file or directory
 #include "version.h"
                     ^
compilation terminated.

Internally we do 'ninja -C test/fuzz/sanitize-address-fuzzers fuzzers'.
I'm not quite sure why version.h is not built in this case. But declaring
version_h as the dependency forces it to be built and solves the issue.

It would be better to define the dependency on individual exe's, but this
doesn't work:

meson.build:2884:8: ERROR:  Argument is of an unacceptable type 'CustomTarget'.
Must be either an external dependency (returned by find_library() or
dependency()) or an internal dependency (returned by declare_dependency()).

Let's treat this a hack for another hack, which the nested build is.

5 years agomeson: simplify handling of pkgconfigdatadir=no, pkgconfiglibdir=no
Zbigniew Jędrzejewski-Szmek [Thu, 20 Dec 2018 20:31:32 +0000 (21:31 +0100)] 
meson: simplify handling of pkgconfigdatadir=no, pkgconfiglibdir=no

The idea was that those vars could be configured to 'no' to not install the .pc
files, or they could be set to '', and then they would be built but not
installed. This was inherited from the autoconf build system. This couldn't
work because '' is replaced by the default value. Also, having this level of
control doesn't seem necessary, since creating those files is very
quick. Skipping with 'no' was implemented only for systemd.pc and not the other
.pc files. Let's simplify things and skip installation if the target dir
is configured as 'no' for all .pc files.

5 years agomeson: allow setting the version string during configuration
Zbigniew Jędrzejewski-Szmek [Wed, 19 Dec 2018 12:33:09 +0000 (13:33 +0100)] 
meson: allow setting the version string during configuration

This will be useful when building distro packages, because we can set the
version string to the rpm/dpkg/whatever version string, and getter reports
from end users.

5 years agomeson-vcs-tag: add work-around for git bug
Zbigniew Jędrzejewski-Szmek [Wed, 19 Dec 2018 12:25:07 +0000 (13:25 +0100)] 
meson-vcs-tag: add work-around for git bug

5 years agomeson: generate version tag from git
Zbigniew Jędrzejewski-Szmek [Thu, 20 Dec 2018 19:35:25 +0000 (20:35 +0100)] 
meson: generate version tag from git

$ build/systemctl --version
systemd 239-3555-g6178cbb5b5
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN +PCRE2 default-hierarchy=hybrid
$ git tag v240 -m 'v240'
$ ninja -C build
ninja: Entering directory `build'
[76/76] Linking target fuzz-unit-file.
$ build/systemctl --version
systemd 240
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN +PCRE2 default-hierarchy=hybrid

This is very useful during development, because a precise version string is
embedded in the build product and displayed during boot, so we don't have to
guess answers for questions like "did I just boot the latest version or the one
from before?".

This change creates an overhead for "noop" builds. On my laptop, 'ninja -C
build' that does nothing goes from 0.1 to 0.5 s. It would be nice to avoid
this, but I think that <1 s is still acceptable.

Fixes #7183.

PACKAGE_VERSION is renamed to GIT_VERSION, to make it obvious that this is the
more dynamically changing version string.

Why save to a file? It would be easy to generate the version tag using
run_command(), but we want to go through a file so that stuff gets rebuilt when
this file changes. If we just defined an variable in meson, ninja wouldn't know
it needs to rebuild things.

5 years agoudev: modernize ctrl_send and use PROJECT_VERSION
Zbigniew Jędrzejewski-Szmek [Fri, 21 Dec 2018 12:36:26 +0000 (13:36 +0100)] 
udev: modernize ctrl_send and use PROJECT_VERSION

PROJECT_VERSION is used in preparation for future changes. Let's simplify the
code by using structured initialization. If the string written to .version ever
became to long, the compiler will truncate it and tell us:

../src/udev/udev-ctrl.c: In function ‘ctrl_send’:
../src/udev/udev-ctrl.c:221:28: warning: initializer-string for array of chars is too long
                 .version = "udev-" STRINGIFY(R_VERSION),
                            ^~~~~~~
../src/udev/udev-ctrl.c:221:28: note: (near initialization for ‘ctrl_msg_wire.version’)

No functional change.

5 years agoman: document new systemd-resolved.service(8) routing features in more detail 11050/head
Lennart Poettering [Tue, 4 Dec 2018 15:09:11 +0000 (16:09 +0100)] 
man: document new systemd-resolved.service(8) routing features in more detail

5 years agoman: split long section in systemd-resolved.service man page into three
Lennart Poettering [Tue, 4 Dec 2018 15:08:40 +0000 (16:08 +0100)] 
man: split long section in systemd-resolved.service man page into three

Also, do some minor updating.

5 years agoresolved: read DNS default route option from networkd
Lennart Poettering [Tue, 4 Dec 2018 12:48:28 +0000 (13:48 +0100)] 
resolved: read DNS default route option from networkd

5 years agosd-network: add new API sd_network_link_get_dns_default_route()
Lennart Poettering [Tue, 4 Dec 2018 12:47:53 +0000 (13:47 +0100)] 
sd-network: add new API sd_network_link_get_dns_default_route()

This simply reads from networkd's state files whether a link shall be
used as DNS default route.

5 years agonetworkd: permit DNS "DefaultRoute" configuration in .network files
Lennart Poettering [Tue, 4 Dec 2018 14:34:04 +0000 (15:34 +0100)] 
networkd: permit DNS "DefaultRoute" configuration in .network files

5 years agonetworkd: small simplification
Lennart Poettering [Tue, 4 Dec 2018 14:34:37 +0000 (15:34 +0100)] 
networkd: small simplification

5 years agoresolvectl: add support for reading/writing per-link 'default-route' boolean
Lennart Poettering [Tue, 4 Dec 2018 12:29:41 +0000 (13:29 +0100)] 
resolvectl: add support for reading/writing per-link 'default-route' boolean

5 years agoresolvectl: minor whitespace fix
Lennart Poettering [Tue, 4 Dec 2018 12:30:14 +0000 (13:30 +0100)] 
resolvectl: minor whitespace fix

5 years agoresolved: add bus API to set per-link "default route" boolean
Lennart Poettering [Tue, 4 Dec 2018 12:10:11 +0000 (13:10 +0100)] 
resolved: add bus API to set per-link "default route" boolean

5 years agoresolved: add an explicit way to configure whether a link is useful as default route
Lennart Poettering [Tue, 4 Dec 2018 11:40:07 +0000 (12:40 +0100)] 
resolved: add an explicit way to configure whether a link is useful as default route

Previously, we'd use a link as "default" route depending on whether
there are route-only domains defined on it or not. (If there are, it
would not be used as default route, if there aren't it would.)

Let's make this explicit and add a link variable controlling this. The
variable is not changeable from the outside yet, but subsequent commits
are supposed to add that.

Note that making this configurable adds a certain amount of redundancy,
as there are now two ways to ensure a link does not receive "default"
lookup (i.e. DNS queries matching no configured route):

1. By ensuring that at least one other link configures a route on it
   (for example by add "." to its search list)

2. By setting this new boolean to false.

But this is exactly what is intended with this patch: that there is an
explicit way to configure on the link itself whether it receives
'default' traffic, rather than require this to be configured on other
links.

The variable added is a tri-state: if true, the link is suitable for
recieving "default" traffic. If false, the link is not suitable for it.
If unset (i.e. negative) the original logic of "has this route-only
routes" is used, to ensure compatibility with the status quo ante.

5 years agoresolved: rework dns_server_limited_domains(), replace by dns_scope_has_route_only_do...
Lennart Poettering [Tue, 4 Dec 2018 11:08:18 +0000 (12:08 +0100)] 
resolved: rework dns_server_limited_domains(), replace by dns_scope_has_route_only_domains()

The function dns_server_limited_domains() was very strange as it
enumerate the domains associated with a DnsScope object to determine
whether any "route-only" domains, but did so as a function associated
with a DnsServer object.

Let's clear this up, and replace it by a function associated with a
DnsScope instead. This makes more sense philosphically and allows us to
reduce the loops through which we need to jump to determine whether a
scope is suitable for default routing a bit.

5 years agoresolved: bind .local domains to mDNS with DNS_SCOPE_YES, similar LLMNR
Lennart Poettering [Mon, 3 Dec 2018 21:27:19 +0000 (22:27 +0100)] 
resolved: bind .local domains to mDNS with DNS_SCOPE_YES, similar LLMNR

Previously, we'd return DNS_SCOPE_MAYBE for all domain lookups matching
LLMNR or mDNS. Let's upgrade this to DNS_SCOPE_YES, to make the binding
stronger.

The effect of this is that even if "local" is defined as routing domain
on some iface, we'll still lookup domains in local via mDNS — if mDNS is
turned on. This should not be limiting, as people who don't want such
lookups should turn off mDNS altogether, as it is useless if nothing is
routed to it.

This also has the nice benefit that mDNS/LLMR continue to work if people
use "~." as routing domain on some interface.

Similar for LLMNR and single label names.

Similar also for the link local IPv4 and IPv6 reverse lookups.

Fixes: #10125
5 years agoresolved: rework how we determine which scope to send a query to
Lennart Poettering [Mon, 3 Dec 2018 15:25:00 +0000 (16:25 +0100)] 
resolved: rework how we determine which scope to send a query to

Fixes: #10830 #9825 #9472
5 years agoresolved: add comment, explaining when Scope variables are copied from Link
Lennart Poettering [Tue, 4 Dec 2018 12:00:19 +0000 (13:00 +0100)] 
resolved: add comment, explaining when Scope variables are copied from Link

5 years agoresolved: rename_DNS_SCOPE_INVALID → _DNS_SCOPE_MATCH_INVALID
Lennart Poettering [Mon, 3 Dec 2018 21:26:46 +0000 (22:26 +0100)] 
resolved: rename_DNS_SCOPE_INVALID → _DNS_SCOPE_MATCH_INVALID

The _INVALID and _MAX enum fields should always use the full name of
thenum.

5 years agoresolved: check dns_over_tls_mode in link_needs_save()
Lennart Poettering [Tue, 4 Dec 2018 12:49:03 +0000 (13:49 +0100)] 
resolved: check dns_over_tls_mode in link_needs_save()

This was forgotten when DoT was added.

5 years agoresolved: use structured initialization for DnsScope
Lennart Poettering [Tue, 4 Dec 2018 12:31:29 +0000 (13:31 +0100)] 
resolved: use structured initialization for DnsScope

5 years agohwdb: update database
Zbigniew Jędrzejewski-Szmek [Thu, 20 Dec 2018 15:37:31 +0000 (16:37 +0100)] 
hwdb: update database

I looked over the diff, and it seems it's only additions and fixes, no removals.
The diff for the source files is much bigger, but it seems that the sorting
code is working well.

5 years agomeson: define PROJECT_VERSION as the "bare" project version
Zbigniew Jędrzejewski-Szmek [Wed, 19 Dec 2018 10:23:42 +0000 (11:23 +0100)] 
meson: define PROJECT_VERSION as the "bare" project version

Let's not use atoi() if we can simply provide the project version as a number.

In C code, this is the numerical project version. In substitutions in other
files, this is just the bare substitution.

The "PACKAGE_" prefix is from autotools, and is strange. We call systemd a
"project", and "package" is something that distros build. Let's rename.

PACKAGE_URL is renamed to PROJECT_URL for the same reasons and for consistency.

(This leave PACKAGE_VERSION as the stringified define for C code.)

5 years agoNEWS: mention DynamicUser= is disabled for networkd, resolved and timesyncd
Yu Watanabe [Thu, 20 Dec 2018 18:27:26 +0000 (03:27 +0900)] 
NEWS: mention DynamicUser= is disabled for networkd, resolved and timesyncd

Which was disabled by #10117.

5 years agotests: explicitly enable user namespaces for TEST-13-NSPAWN-SMOKE
Frantisek Sumsal [Sat, 15 Dec 2018 19:22:31 +0000 (20:22 +0100)] 
tests: explicitly enable user namespaces for TEST-13-NSPAWN-SMOKE

5 years agohwdb: Add accelerometer orientation quirk for the PoV TAB-P1006W-232-3G
Hans de Goede [Thu, 20 Dec 2018 15:08:46 +0000 (16:08 +0100)] 
hwdb: Add accelerometer orientation quirk for the PoV TAB-P1006W-232-3G

Add accelerometer orientation quirk for the Point of View TAB-P1006W-232-3G
tablet.

5 years agoMerge pull request #11223 from poettering/read-line-0x00-0xff
Lennart Poettering [Thu, 20 Dec 2018 13:53:23 +0000 (14:53 +0100)] 
Merge pull request #11223 from poettering/read-line-0x00-0xff

fileio: fix read_one_line() when reading bytes > 0x7F

5 years agohwdb: Add support for HP ProBook 645 wifi and slash key (#11207)
Jeremy Su [Thu, 20 Dec 2018 12:58:02 +0000 (20:58 +0800)] 
hwdb: Add support for HP ProBook 645 wifi and slash key (#11207)

hwdb: Add support for HP ProBook 645 wifi and slash key

5 years agoMerge pull request #11222 from keszybz/tmpfiles-crash
Lennart Poettering [Thu, 20 Dec 2018 12:57:16 +0000 (13:57 +0100)] 
Merge pull request #11222 from keszybz/tmpfiles-crash

tmpfiles: fix crash with NULL in arg_root and other fixes and tests

5 years agodhcp6: don't enforce DUID content for sd_dhcp6_client_set_duid() 11210/head
Thomas Haller [Thu, 20 Dec 2018 10:56:02 +0000 (11:56 +0100)] 
dhcp6: don't enforce DUID content for sd_dhcp6_client_set_duid()

There are various functions to set the DUID of a DHCPv6 client.
However, none of them allows to set arbitrary data. The closest is
sd_dhcp6_client_set_duid(), which would still do validation of the
DUID's content via dhcp_validate_duid_len().

Relax the validation and only log a debug message if the DUID
does not validate.

Note that dhcp_validate_duid_len() already is not very strict. For example
with DUID_TYPE_LLT it only ensures that the length is suitable to contain
hwtype and time. It does not further check that the length of hwaddr is non-zero
or suitable for hwtype. Also, non-well-known DUID types are accepted for
extensibility. Why reject certain DUIDs but allowing clearly wrong formats
otherwise?

The validation and failure should happen earlier, when accepting the
unsuitable DUID. At that point, there is more context of what is wrong,
and a better failure reason (or warning) can be reported to the user. Rejecting
the DUID when setting up the DHCPv6 client seems not optimal, in particular
because the DHCPv6 client does not care about actual content of the
DUID and treats it as opaque blob.

Also, NetworkManager (which uses this code) allows to configure the entire
binary DUID in binary. It intentionally does not validate the binary
content any further. Hence, it needs to be able to set _invalid_ DUIDs,
provided that some basic constraints are satisfied (like the maximum length).

sd_dhcp6_client_set_duid() has two callers: both set the DUID obtained
from link_get_duid(), which comes from configuration.
`man networkd.conf` says: "The configured DHCP DUID should conform to
the specification in RFC 3315, RFC 6355.". It does not not state that
it MUST conform.

Note that dhcp_validate_duid_len() has another caller: DHCPv4's
dhcp_client_set_iaid_duid_internal(). In this case, continue with
strict validation, as the callers are more controlled. Also, there is
already sd_dhcp_client_set_client_id() which can be used to bypass
this check and set arbitrary client identifiers.

5 years agodhcp: don't enforce hardware address length for sd_dhcp_client_set_client_id()
Thomas Haller [Wed, 19 Dec 2018 09:05:37 +0000 (10:05 +0100)] 
dhcp: don't enforce hardware address length for sd_dhcp_client_set_client_id()

sd_dhcp_client_set_client_id() is the only API for setting a raw client-id.
All other setters are more restricted and only allow to set a type 255 DUID.

Also, dhcp4_set_client_identifier() is the only caller, which already
does:

                r = sd_dhcp_client_set_client_id(link->dhcp_client,
                                                 ARPHRD_ETHER,
                                                 (const uint8_t *) &link->mac,
                                                 sizeof(link->mac));

and hence ensures that the data length is indeed ETH_ALEN.

Drop additional input validation from sd_dhcp_client_set_client_id(). The client-id
is an opaque blob, and if a caller wishes to set type 1 (ethernet) or type 32
(infiniband) with unexpected address length, it should be allowed. The actual
client-id is not relevant to the DHCP client, and it's the responsibility of the
caller to generate a suitable client-id.

For example, in NetworkManager you can configure all the bytes of the
client-id, including such _invalid_ settings. I think it makes sense,
to allow the user to fully configure the identifier. Even if such configuration
would be rejected, it would be the responsibility of the higher layers (including
a sensible error message to the user) and not fail later during
sd_dhcp_client_set_client_id().

Still log a debug message if the length is unexpected.

5 years agodhcp: fix sd_dhcp_client_set_client_id() for infiniband addresses
Thomas Haller [Thu, 20 Dec 2018 12:05:13 +0000 (13:05 +0100)] 
dhcp: fix sd_dhcp_client_set_client_id() for infiniband addresses

Infiniband addresses are 20 bytes (INFINIBAND_ALEN), but only the last
8 bytes are suitable for putting into the client-id.

This bug had no effect for networkd, because sd_dhcp_client_set_client_id()
has only one caller which always uses ARPHRD_ETHER type.

I was unable to find good references for why this is correct ([1]). Fedora/RHEL
has patches for ISC dhclient that also only use the last 8 bytes ([2], [3]).
RFC 4390 (Dynamic Host Configuration Protocol (DHCP) over InfiniBand) [4] does
not discuss the content of the client-id either.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1658057#c29
[2] https://bugzilla.redhat.com/show_bug.cgi?id=660681
[3] https://src.fedoraproject.org/rpms/dhcp/blob/3ccf3c8d815df4b8e11e1a04850975f099273d5d/f/dhcp-lpf-ib.patch
[4] https://tools.ietf.org/html/rfc4390

5 years agotest-fileio: add explicit check for safe_fgetc() with 0xFF 11223/head
Lennart Poettering [Thu, 20 Dec 2018 10:21:36 +0000 (11:21 +0100)] 
test-fileio: add explicit check for safe_fgetc() with 0xFF

5 years agofileio: fix read_one_line() when reading bytes > 0x7F
Lennart Poettering [Thu, 20 Dec 2018 09:21:16 +0000 (10:21 +0100)] 
fileio: fix read_one_line() when reading bytes > 0x7F

Fixes: #11218