platform/upstream/systemd.git
5 years agojson: always allocate at least sizeof(JsonVariant) bytes
Lennart Poettering [Thu, 11 Jul 2019 09:15:06 +0000 (11:15 +0200)]
json: always allocate at least sizeof(JsonVariant) bytes

ubsan apparently doesn't like us being too smart here. Given the
difference is just a few bytes, let's avoid the noise.

Fixes: #13020

5 years agoMerge pull request #13018 from yuwata/network-tunnel-follow-up-13016
Lennart Poettering [Thu, 11 Jul 2019 10:10:39 +0000 (12:10 +0200)]
Merge pull request #13018 from yuwata/network-tunnel-follow-up-13016

network: drop assertions about Tunnel.family

5 years agotest-network: drop test_udev_driver as it is unstable
Yu Watanabe [Mon, 8 Jul 2019 12:08:10 +0000 (21:08 +0900)]
test-network: drop test_udev_driver as it is unstable

The test unexpectedly succeeds on KVM with sanitizer CI.
At least tentatively, let's drop the test.

5 years agoMerge pull request #13006 from yuwata/network-split-dhcp-12917
Lennart Poettering [Thu, 11 Jul 2019 08:28:03 +0000 (10:28 +0200)]
Merge pull request #13006 from yuwata/network-split-dhcp-12917

networkd: DHCPv6 - separate DHCPv6 options from DHCPv4 options

5 years agoMerge pull request #13010 from poettering/fsck-usr-wants
Yu Watanabe [Thu, 11 Jul 2019 06:13:51 +0000 (15:13 +0900)]
Merge pull request #13010 from poettering/fsck-usr-wants

generator: downgrade Requires= → Wants= of fsck from /usr mount unit

5 years agotest-network: add testcases Tunnel.Remote=any and Local=any
Yu Watanabe [Thu, 11 Jul 2019 02:39:27 +0000 (11:39 +0900)]
test-network: add testcases Tunnel.Remote=any and Local=any

5 years agonetwork: ip6tnl and vti6 does not support the case both Local= and Remote= are any
Yu Watanabe [Thu, 11 Jul 2019 02:05:15 +0000 (11:05 +0900)]
network: ip6tnl and vti6 does not support the case both Local= and Remote= are any

This partially revert feb0c8b86f05330c8c7581463b8adf35ea68e5a9.

This also drop assertions about Tunnel.family.

5 years agoMerge pull request #13013 from yuwata/network-xfrm-follow-ups
Yu Watanabe [Thu, 11 Jul 2019 06:08:13 +0000 (15:08 +0900)]
Merge pull request #13013 from yuwata/network-xfrm-follow-ups

network: follow-ups for XFRM netdevs and introduce AssignToLoopback= for Tunnel devices

5 years agotest-network: add test for Xfrm netdev
Yu Watanabe [Wed, 10 Jul 2019 14:54:26 +0000 (23:54 +0900)]
test-network: add test for Xfrm netdev

5 years agotest-network: add test for AssignToLoopback= setting
Yu Watanabe [Wed, 10 Jul 2019 14:53:30 +0000 (23:53 +0900)]
test-network: add test for AssignToLoopback= setting

5 years agonetwork: add AssignToLoopback= setting to [Tunnel] section
Yu Watanabe [Wed, 10 Jul 2019 14:49:17 +0000 (23:49 +0900)]
network: add AssignToLoopback= setting to [Tunnel] section

networkd does not manage loopback interface lo. So, previously, we have
no way to assign tunnel devices to lo.

5 years agonetwork: simplify the condition about xfrm
Yu Watanabe [Wed, 10 Jul 2019 14:48:37 +0000 (23:48 +0900)]
network: simplify the condition about xfrm

5 years agoMerge pull request #13011 from keszybz/auto-erase
Lennart Poettering [Wed, 10 Jul 2019 23:05:01 +0000 (01:05 +0200)]
Merge pull request #13011 from keszybz/auto-erase

Remove string_erase and friends

5 years agonetwork: support gre tunnel or friends with Local=any Remote=any
Yu Watanabe [Wed, 10 Jul 2019 16:37:24 +0000 (01:37 +0900)]
network: support gre tunnel or friends with Local=any Remote=any

Fixes #13014.

5 years agoMerge pull request #12755 from keszybz/short-identifiers
Lennart Poettering [Wed, 10 Jul 2019 22:00:51 +0000 (00:00 +0200)]
Merge pull request #12755 from keszybz/short-identifiers

Allow using unit names in status messages

5 years agoMerge pull request #12926 from keszybz/urlify-logs
Lennart Poettering [Wed, 10 Jul 2019 22:00:34 +0000 (00:00 +0200)]
Merge pull request #12926 from keszybz/urlify-logs

Urlify CONFIG_FILE and improve SYSTEMD_LOG_LOCATION

5 years agoMerge pull request #13009 from keszybz/efi-feature-xbootldr
Lennart Poettering [Wed, 10 Jul 2019 22:00:12 +0000 (00:00 +0200)]
Merge pull request #13009 from keszybz/efi-feature-xbootldr

sd-boot feature xbootldr

5 years agoMerge pull request #12965 from keszybz/auto-erase
Lennart Poettering [Wed, 10 Jul 2019 14:20:50 +0000 (16:20 +0200)]
Merge pull request #12965 from keszybz/auto-erase

_cleanup_(erase_and_freep)

5 years agoMerge pull request #13005 from keszybz/fix-gcc-warning
Lennart Poettering [Wed, 10 Jul 2019 14:20:31 +0000 (16:20 +0200)]
Merge pull request #13005 from keszybz/fix-gcc-warning

Fix two gcc warnings

5 years agotmpfiles: use log_syntax() for complaining about configuration file errors
Lennart Poettering [Wed, 10 Jul 2019 11:00:44 +0000 (13:00 +0200)]
tmpfiles: use log_syntax() for complaining about configuration file errors

In the light of #12926 I needed some log messages for testing. This
tmpfiles one came to mind, since it's frequently seen on typical Fedora
systems. Alas, they didn't actually use log_syntax, and thus weren't
recognizable by the new config file urlifaction code. Let's fix that.

5 years agogenerator: downgrade Requires= → Wants= of fsck from /usr mount unit
Lennart Poettering [Wed, 10 Jul 2019 14:18:28 +0000 (16:18 +0200)]
generator: downgrade Requires= → Wants= of fsck from /usr mount unit

Fixes #5099

5 years agocore: spaces rock
Lennart Poettering [Wed, 10 Jul 2019 14:18:05 +0000 (16:18 +0200)]
core: spaces rock

5 years agoMerge pull request #12863 from 1848/if_xfrm
Yu Watanabe [Wed, 10 Jul 2019 14:04:49 +0000 (23:04 +0900)]
Merge pull request #12863 from 1848/if_xfrm

Added support for xfrm interfaces

5 years agoFixed condition checked twice
1848 [Mon, 8 Jul 2019 15:10:26 +0000 (17:10 +0200)]
Fixed condition checked twice

5 years agoAdded support for xfrm interfaces
1848 [Mon, 8 Jul 2019 15:09:46 +0000 (17:09 +0200)]
Added support for xfrm interfaces

5 years agobootctl,sd-boot: define EFI_LOADER_FEATURE_XBOOTLDR
Zbigniew Jędrzejewski-Szmek [Tue, 2 Jul 2019 11:02:22 +0000 (13:02 +0200)]
bootctl,sd-boot: define EFI_LOADER_FEATURE_XBOOTLDR

It was added back in fa2a3bbdd8bfcc3402c2ad9e941eb3911971e09a, but we
forgot to add the feature define.

5 years agoboot,shared: share the definitions of EFI_LOADER_FEATURE macros
Zbigniew Jędrzejewski-Szmek [Tue, 2 Jul 2019 11:01:23 +0000 (13:01 +0200)]
boot,shared: share the definitions of EFI_LOADER_FEATURE macros

This means the the code needs to be kept compatible in the shared header,
but I think that still nicer than having two places to declare the same
things.

I added src/boot to -I, so that efi/foo.h needs to be used. This reduces
the potential for accidentally including the wrong header.

5 years agoMerge pull request #12939 from yuwata/lgtm-fixes
Lennart Poettering [Wed, 10 Jul 2019 12:57:14 +0000 (14:57 +0200)]
Merge pull request #12939 from yuwata/lgtm-fixes

make LGTM quiet

5 years agotest-strv: test strv_free_erase() a little bit
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jul 2019 11:57:52 +0000 (13:57 +0200)]
test-strv: test strv_free_erase() a little bit

5 years agoRemove string_erase
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jul 2019 11:54:50 +0000 (13:54 +0200)]
Remove string_erase

5 years agoshared/logs-show: urlify CONFIG_FILE in verbose mode
Zbigniew Jędrzejewski-Szmek [Mon, 1 Jul 2019 18:20:23 +0000 (20:20 +0200)]
shared/logs-show: urlify CONFIG_FILE in verbose mode

Now all short-*, verbose, with-unit modes are handled. cat, export, json-* are
not, but those are usually used for post-processing, so I don't think it'd be
useful there.

5 years agoshared/logs-show: urlify CONFIG_FILE in short mode
Zbigniew Jędrzejewski-Szmek [Mon, 1 Jul 2019 15:03:11 +0000 (17:03 +0200)]
shared/logs-show: urlify CONFIG_FILE in short mode

v2:
- check that the filename is terminated by ':', ' ', or EOS
- fix grep highlight overlap check

5 years agoRemove string_free_erase
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jul 2019 11:48:55 +0000 (13:48 +0200)]
Remove string_free_erase

5 years agoUse unit->id instead of description in messages
Zbigniew Jędrzejewski-Szmek [Thu, 6 Jun 2019 15:33:59 +0000 (17:33 +0200)]
Use unit->id instead of description in messages

v2:
- rename unit_identifier to unit_status_string

5 years agoAdd config and kernel commandline option to use short identifiers
Zbigniew Jędrzejewski-Szmek [Thu, 6 Jun 2019 17:22:20 +0000 (19:22 +0200)]
Add config and kernel commandline option to use short identifiers

No functional change, just docs and configuration and parsing.

v2:
- change ShortIdentifiers=yes|no to StatusUnitFormat=name|description.

5 years agopid1: tiny simplification
Zbigniew Jędrzejewski-Szmek [Thu, 6 Jun 2019 15:33:25 +0000 (17:33 +0200)]
pid1: tiny simplification

v2:
- use empty_to_root()

5 years agosystemctl: allow "cat" on units with bad settings
Zbigniew Jędrzejewski-Szmek [Mon, 1 Jul 2019 13:31:08 +0000 (15:31 +0200)]
systemctl: allow "cat" on units with bad settings

That's precisely the state where 'cat' is particularly useful ;).

5 years agonetwork: fix memleak
Yu Watanabe [Tue, 9 Jul 2019 16:02:07 +0000 (01:02 +0900)]
network: fix memleak

set_put() does not return -EEXIST.

Fixes #12995 and oss-fuzz#15678.

5 years agoreply-password: define main through macro
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jul 2019 09:36:51 +0000 (11:36 +0200)]
reply-password: define main through macro

5 years agoUse _cleanup(free_and_erasep) where appropriate
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jul 2019 09:29:10 +0000 (11:29 +0200)]
Use _cleanup(free_and_erasep) where appropriate

Replaces #12959.

5 years agotest: add _cleanup_(erase_and_freep)
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jul 2019 08:37:53 +0000 (10:37 +0200)]
test: add _cleanup_(erase_and_freep)

Based on the macro and test case by Lennart Poettering and
Topi Miettinen suggestion.

5 years agotest-network: add tests for UseDNS= in [DHCP] section
Yu Watanabe [Wed, 3 Jul 2019 02:55:40 +0000 (11:55 +0900)]
test-network: add tests for UseDNS= in [DHCP] section

5 years agotest-network: enable systemd-resolved.service
Yu Watanabe [Mon, 3 Jun 2019 22:05:07 +0000 (07:05 +0900)]
test-network: enable systemd-resolved.service

5 years agonetwork: rename [DHCP] section to [DHCPv4]
Yu Watanabe [Wed, 10 Jul 2019 08:33:05 +0000 (17:33 +0900)]
network: rename [DHCP] section to [DHCPv4]

To keep the backward compatibility broken by the previous commit.

5 years agonetworkd: silence bogus gcc warning about %s
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jul 2019 08:30:12 +0000 (10:30 +0200)]
networkd: silence bogus gcc warning about %s

Fixes #12931.

In file included from ../src/basic/macro.h:558,
                 from ../src/basic/alloc-util.h:9,
                 from ../src/network/networkd-link.c:7:
../src/network/networkd-link.c: In function ‘link_sysctl_ipv6_enabled’:
../src/basic/log.h:107:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  107 |         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/log-link.h:21:25: note: in expansion of macro ‘log_internal’
   21 |                         log_internal(level, error, _FILE_, __LINE__, __func__, ##__VA_ARGS__); \
      |                         ^~~~~~~~~~~~
../src/shared/log-link.h:33:50: note: in expansion of macro ‘log_link_full’
   33 | #define log_link_warning_errno(link, error, ...) log_link_full(link, LOG_WARNING, error, ##__VA_ARGS__)
      |                                                  ^~~~~~~~~~~~~
../src/network/networkd-link.c:83:24: note: in expansion of macro ‘log_link_warning_errno’
   83 |                 return log_link_warning_errno(link, r,
      |                        ^~~~~~~~~~~~~~~~~~~~~~
../src/network/networkd-link.c:84:77: note: format string is defined here
   84 |                                               "Failed to read net.ipv6.conf.%s.disable_ipv6 sysctl property: %m",
      |                                                                             ^~
cc1: some warnings being treated as errors

5 years agoshared/dm-util: use strncpy_exact() to silence gcc
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jul 2019 08:22:48 +0000 (10:22 +0200)]
shared/dm-util: use strncpy_exact() to silence gcc

With gcc-9.1.1-2.fc31.x86_64 and -Doptimization=2:
../src/shared/dm-util.c: In function ‘dm_deferred_remove’:
../src/shared/dm-util.c:35:9: warning: ‘strncpy’ specified bound 128 equals destination size [-Wstringop-truncation]
   35 |         strncpy(dm.name, name, sizeof(dm.name));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

gcc is plain wrong here, because we checked strlen(name) a few lines above, so
there can be no truncation and even the terminator always fits. But let's avoid
the warning.

5 years agonetworkd: DHCPv6 - separate DHCPv6 options from DHCPv4 options
Susant Sahani [Tue, 9 Jul 2019 14:23:28 +0000 (19:53 +0530)]
networkd: DHCPv6 - separate DHCPv6 options from DHCPv4 options

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

5 years agofuzzbuzz: rename fuzz.yaml to fuzzbuzz.yaml
Evgeny Vereshchagin [Wed, 10 Jul 2019 01:46:35 +0000 (03:46 +0200)]
fuzzbuzz: rename fuzz.yaml to fuzzbuzz.yaml

fuzz.yaml will stop working in a week

5 years agoimportd: Avoid need for fd translation table
Dave Reisner [Sat, 6 Jul 2019 16:20:53 +0000 (12:20 -0400)]
importd: Avoid need for fd translation table

Make use of curl_multi_assign to associate each IO sd_event_source with
a CURL object. This means we always get passed the right event source
and don't need to worry about looking up the associated CURL object,
particularly in the case where the FD has been closed on a REMOVE event.

5 years agonetwork: read sysctl value only once (#12990)
Yu Watanabe [Tue, 9 Jul 2019 07:56:50 +0000 (16:56 +0900)]
network: read sysctl value only once (#12990)

Follow-up for bafa9641446852f7fa15ca12d08a223d345c78ea.

When the value is changed, networkd needs to be restarted.

5 years agoutil: fix sign-compare warning
Yu Watanabe [Fri, 21 Jun 2019 03:56:54 +0000 (12:56 +0900)]
util: fix sign-compare warning

5 years agotest/udev-test.pl: cleanup if skipping test
Dan Streetman [Fri, 5 Jul 2019 15:24:55 +0000 (11:24 -0400)]
test/udev-test.pl: cleanup if skipping test

In Ubuntu CI, udev-test.pl is run from the debian/test/udev script,
in a test dir created for it; but udev-test.pl setup mounts a
dir, so if it doesn't cleanup/unmount before exiting, the test dir
autopkgtest created for it can't be removed, and autopkgtest
aborts the entire test suite, for example this output (from a
test run inside an armhf container):

autopkgtest [12:45:36]: test udev: [-----------------------
umount: test/tmpfs: no mount point specified.
mknod: test/tmpfs/dev/null: Operation not permitted
unable to create test/tmpfs/dev/null at ./udev-test.pl line 1611.
Failed to set up the environment, skipping the test at ./udev-test.pl line 1731.
autopkgtest [12:45:41]: test udev: -----------------------]
autopkgtest [12:45:44]: test udev:  - - - - - - - - - - results - - - - - - - - - -
udev                 FAIL non-zero exit status 77
rm: cannot remove '/tmp/autopkgtest.ocPFA6/autopkgtest_tmp/test/tmpfs': Device or resource busy
autopkgtest [12:46:22]: ERROR: "rm -rf /tmp/autopkgtest.ocPFA6/udev-artifacts /tmp/autopkgtest.ocPFA6/autopkgtest_tmp" failed with stderr "rm:

5 years agoMerge pull request #12992 from mrc0mmand/test-functions-fixes
Evgeny Vereshchagin [Mon, 8 Jul 2019 23:27:39 +0000 (02:27 +0300)]
Merge pull request #12992 from mrc0mmand/test-functions-fixes

Various test/test-functions fixes/improvements

5 years agopid1: fix serialization/deserialization of commmands with spaces
Zbigniew Jędrzejewski-Szmek [Mon, 8 Jul 2019 12:18:46 +0000 (14:18 +0200)]
pid1: fix serialization/deserialization of commmands with spaces

Fixes #12258.

This is enough to reproduce:
$ systemd-run bash -c 'sleep 10' && systemctl daemon-reload
would result in
Current command vanished from the unit file.

We would serialize as:
ExecStart 0 /usr/bin/bash /usr/bin/bash -c sleep 10000
which of course can't work.
Now we serialize as
ExecStart 0 /usr/bin/bash "/usr/bin/bash" "-c" "sleep 10".

5 years agonspawn: fix abort when we cannot execve
Zbigniew Jędrzejewski-Szmek [Mon, 8 Jul 2019 13:16:41 +0000 (15:16 +0200)]
nspawn: fix abort when we cannot execve

If execve failed, we would die in safe_close(), because master was already
closed by fdset_close_others() on line 3123. IIUC, we don't need to keep the
fd open after sending it, so let's just close it immediately.

Reproducer:
sudo build/systemd-nspawn -M rawhide fooooooo

Fixup for 3acc84ebd9aebe8cf1771b42644ebbfbecdfaa37.

5 years agoMerge pull request #12972 from intelfx/cryptsetup-enable-libcryptsetup-debug
Zbigniew Jędrzejewski-Szmek [Mon, 8 Jul 2019 22:47:06 +0000 (00:47 +0200)]
Merge pull request #12972 from intelfx/cryptsetup-enable-libcryptsetup-debug

cryptsetup: properly handle libcryptsetup debug logging

5 years agotest: install missing dependencies for CIs
Frantisek Sumsal [Mon, 8 Jul 2019 19:28:10 +0000 (21:28 +0200)]
test: install missing dependencies for CIs

5 years agotest: drop || return 1 expression which is incompatible with set -e
Frantisek Sumsal [Mon, 8 Jul 2019 19:11:32 +0000 (21:11 +0200)]
test: drop || return 1 expression which is incompatible with set -e

The `set -e` option is incompatible with a subshell/compound command,
which is followed by || <EXPR>. In such case, the -e option is ignored
in all affected subshells/functions (see man bash(1) for command `set`).

5 years agotest: be a little bit more verbose when installing service binaries
Frantisek Sumsal [Mon, 8 Jul 2019 19:10:21 +0000 (21:10 +0200)]
test: be a little bit more verbose when installing service binaries

5 years agotest: correctly handle installation of newly introduced binaries
Frantisek Sumsal [Mon, 8 Jul 2019 19:05:51 +0000 (21:05 +0200)]
test: correctly handle installation of newly introduced binaries

In certain cases we might attempt to install a binary which is already
present in the test image, yet it's missing from the host system.
In such cases, let's check if the binary indeed exists in the image
before doing any other chcecks. If it does, immediately return with
success.

This was discovered during installation of
/usr/lib/systemd/systemd-bless-boot, which was not present in Ubuntu CI
(as the installed systemd was from the Ubuntu repositories), and the
binary itself was already in the image thanks to `ninja install`.
However, during extraction of binaries from the systemd service files,
another attempt to install this binary was made, which failed due to
`find_binary` being unable to find it.

5 years agotest: make ASAN/UBSAN_OPTIONS overridable from the outside
Frantisek Sumsal [Mon, 8 Jul 2019 11:47:46 +0000 (13:47 +0200)]
test: make ASAN/UBSAN_OPTIONS overridable from the outside

This should allow us to tweak the ASAN_OPTIONS and UBSAN_OPTIONS env
variables for integration tests as well

5 years agoFUNDING: this needs to be yaml
Zbigniew Jędrzejewski-Szmek [Mon, 8 Jul 2019 14:55:31 +0000 (16:55 +0200)]
FUNDING: this needs to be yaml

5 years agoCreate FUNDING.yml
Zbigniew Jędrzejewski-Szmek [Mon, 8 Jul 2019 13:43:55 +0000 (15:43 +0200)]
Create FUNDING.yml

5 years agogrowfs: call crypt_set_debug_level() correctly, skip if not needed
Ivan Shapovalov [Sat, 6 Jul 2019 10:51:55 +0000 (13:51 +0300)]
growfs: call crypt_set_debug_level() correctly, skip if not needed

5 years agocryptsetup: enable libcryptsetup debug logging if we want it
Ivan Shapovalov [Sat, 6 Jul 2019 10:51:23 +0000 (13:51 +0300)]
cryptsetup: enable libcryptsetup debug logging if we want it

Even if we set a log callback that would accept debug messages, libcryptsetup
needs debug logging enabled explicitly for it to happen.

5 years agoMerge pull request #12970 from ddstreet/gh12969
Yu Watanabe [Mon, 8 Jul 2019 12:18:04 +0000 (21:18 +0900)]
Merge pull request #12970 from ddstreet/gh12969

src/network/networkd-dhcp4.c: set prefsrc for classless or static routes

5 years agoAdd accel mount matrix for Irbis TW90
RussianNeuroMancer [Sun, 7 Jul 2019 15:17:56 +0000 (23:17 +0800)]
Add accel mount matrix for Irbis TW90

5 years agounits: add SystemCallErrorNumber=EPERM to systemd-portabled.service
Lennart Poettering [Sun, 7 Jul 2019 15:28:57 +0000 (17:28 +0200)]
units: add SystemCallErrorNumber=EPERM to systemd-portabled.service

We use that on all other services, and hence should here too. Otherwise
the service will be killed with SIGSYS when doing something not
whitelisted, which is a bit crass.

5 years agosemaphore: pass allow-releaseinfo-change to apt-get
Evgeny Vereshchagin [Sun, 7 Jul 2019 16:17:17 +0000 (18:17 +0200)]
semaphore: pass allow-releaseinfo-change to apt-get

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=929248

5 years agocryptsetup: set libcryptsetup global log callback too
Ivan Shapovalov [Sat, 6 Jul 2019 10:48:50 +0000 (13:48 +0300)]
cryptsetup: set libcryptsetup global log callback too

5 years agobasic/log: fix SYSTEMD_LOG_* parsing error messages
Ivan Shapovalov [Sat, 6 Jul 2019 10:47:06 +0000 (13:47 +0300)]
basic/log: fix SYSTEMD_LOG_* parsing error messages

(likely a copy-paste gone wrong)

5 years agotest-network: add tests for DHCP.UseRoutes=no with custom route settings
Yu Watanabe [Fri, 5 Jul 2019 21:43:28 +0000 (06:43 +0900)]
test-network: add tests for DHCP.UseRoutes=no with custom route settings

This adds test for b5799eeb0787deacb30d5984f6ac78f88f23b97e.

Closes #12951.

5 years agotest-network: add testcase for DHCP client with static address
Yu Watanabe [Fri, 5 Jul 2019 22:39:17 +0000 (07:39 +0900)]
test-network: add testcase for DHCP client with static address

Testcase for #12969.

5 years agosrc/network/networkd-dhcp4.c: set prefsrc for classless or static routes
Dan Streetman [Fri, 5 Jul 2019 20:42:38 +0000 (16:42 -0400)]
src/network/networkd-dhcp4.c: set prefsrc for classless or static routes

When a DHCP server provides only a gateway, the networkd-dhcp4 code adds a
default route using that gateway, and sets the just-provided address as
the route's prefsrc; this was added in commit
46b0c76e2c355c0d0cc4792abb98cde07b28bc53

However, if the DHCP server has also provided classless route(s), these
are used instead of a default route using the provided gateway; the
networkd-dhcp4 code sets up the classless routes, but does not use the
just-provided dhcp address as the prefsrc of the route(s).  Note that
it also doesn't set the prefsrc for static routes, though it should.

If the interface has only the dhcp-provided address, this is not usually
a problem, but if it has another address (e.g. a static address), then
traffic sent through the dhcp-provided gateway might not use the
dhcp-provided source address.  If the gateway router only will route
traffic from the dhcp-provided address, then the dhcp client system's
networking through the router will not work.

Fixes: #12969

5 years agologin: move file definitions outside of the conditionalization
Lennart Poettering [Wed, 29 May 2019 20:09:26 +0000 (22:09 +0200)]
login: move file definitions outside of the conditionalization

5 years agoMerge pull request #12964 from yuwata/network-bridge-vlan-issue-12958
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jul 2019 11:58:21 +0000 (13:58 +0200)]
Merge pull request #12964 from yuwata/network-bridge-vlan-issue-12958

network: fix BridgeVLAN issue

5 years agoMerge pull request #12963 from keszybz/analyze-timestamp
Yu Watanabe [Fri, 5 Jul 2019 08:15:00 +0000 (17:15 +0900)]
Merge pull request #12963 from keszybz/analyze-timestamp

systemd-analyze dump fixup

5 years agotest-network: add tests for BridgeVLAN
Yu Watanabe [Thu, 4 Jul 2019 19:43:27 +0000 (04:43 +0900)]
test-network: add tests for BridgeVLAN

5 years agonetwork: fix issue found by UBSan
Yu Watanabe [Fri, 5 Jul 2019 07:37:34 +0000 (16:37 +0900)]
network: fix issue found by UBSan

5 years agonetwork: fix the initial value of the counter for brvlan
Yu Watanabe [Thu, 4 Jul 2019 20:48:21 +0000 (05:48 +0900)]
network: fix the initial value of the counter for brvlan

Fixes #12958.

5 years agonetwork: re-implement parse_vid_range()
Yu Watanabe [Thu, 4 Jul 2019 20:37:25 +0000 (05:37 +0900)]
network: re-implement parse_vid_range()

5 years agonetwork: minor coding-style update
Yu Watanabe [Fri, 5 Jul 2019 07:34:01 +0000 (16:34 +0900)]
network: minor coding-style update

5 years agovarlink: add varlink server to event loop only if there is one
Lennart Poettering [Tue, 28 May 2019 12:19:18 +0000 (14:19 +0200)]
varlink: add varlink server to event loop only if there is one

5 years agopid1: use monotonic timestamp in dump if realtime is not available
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jul 2019 17:12:03 +0000 (19:12 +0200)]
pid1: use monotonic timestamp in dump if realtime is not available

$ systemd-analyze dump | head -3
Timestamp firmware: (null)
Timestamp loader: (null)
Timestamp kernel: Mon 2019-07-01 17:21:02 CEST

Since this is a debugging interface, it is OK to change the output format.
The user can infer what "Timestamp firmware: 123.456ms" means.

5 years agotest-network: show debug logs of networkd
Yu Watanabe [Wed, 3 Jul 2019 18:46:14 +0000 (03:46 +0900)]
test-network: show debug logs of networkd

5 years agoportabled: Make use of SYNTHETIC_ERRNO()
Lennart Poettering [Thu, 4 Jul 2019 14:54:39 +0000 (16:54 +0200)]
portabled: Make use of SYNTHETIC_ERRNO()

5 years agofirewall-util: use fixed size array for chain name
Yu Watanabe [Wed, 3 Jul 2019 15:09:31 +0000 (00:09 +0900)]
firewall-util: use fixed size array for chain name

xt_chainlabel is defined as
```
typedef char xt_chainlabel[32];
```

5 years agotree-wide: introduce strerror_safe()
Yu Watanabe [Wed, 3 Jul 2019 14:56:17 +0000 (23:56 +0900)]
tree-wide: introduce strerror_safe()

5 years agodhcp: replace strerror() with %m
Yu Watanabe [Wed, 3 Jul 2019 14:55:45 +0000 (23:55 +0900)]
dhcp: replace strerror() with %m

5 years agosd-event: replace snprintf() with strpcpyf()
Yu Watanabe [Wed, 3 Jul 2019 14:27:27 +0000 (23:27 +0900)]
sd-event: replace snprintf() with strpcpyf()

5 years agofsck: split out fsck return code definitions into a header file of its own
Lennart Poettering [Sun, 23 Dec 2018 18:22:12 +0000 (19:22 +0100)]
fsck: split out fsck return code definitions into a header file of its own

This way we can make use of it from other components too, such as
systemd-homed.

5 years agodissect: split out DM deferred remove into src/shared/dm-util.c
Lennart Poettering [Sun, 23 Dec 2018 18:19:51 +0000 (19:19 +0100)]
dissect: split out DM deferred remove into src/shared/dm-util.c

The function is generally useful, let's split it out so that we can make
use of it later on in systemd-homed.

5 years agobasic/time-util: add helper function to check if timestamp is set
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jul 2019 17:10:11 +0000 (19:10 +0200)]
basic/time-util: add helper function to check if timestamp is set

No functional change.

5 years agoman: Add some notes about variable $prefix for StateDirectory=
Philip Withnall [Wed, 3 Jul 2019 13:00:48 +0000 (14:00 +0100)]
man: Add some notes about variable $prefix for StateDirectory=

tl;dr: It isn’t supported.

Wording by Zbigniew Jędrzejewski-Szmek.

See https://twitter.com/pid_eins/status/1102639279614906369 and
https://gitlab.freedesktop.org/libfprint/fprintd/merge_requests/5#note_125536
onwards.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
5 years agoMerge pull request #12949 from yuwata/sd-netlink-sd-netlink-message-enter-array
Lennart Poettering [Thu, 4 Jul 2019 13:46:02 +0000 (15:46 +0200)]
Merge pull request #12949 from yuwata/sd-netlink-sd-netlink-message-enter-array

sd-netlink: introduce sd_netlink_message_enter_array()

5 years agoMerge pull request #12954 from keszybz/var-log-dir
Lennart Poettering [Thu, 4 Jul 2019 13:45:43 +0000 (15:45 +0200)]
Merge pull request #12954 from keszybz/var-log-dir

/var/log-related cleanups

5 years agoudevd: open log output early
Zbigniew Jędrzejewski-Szmek [Mon, 1 Jul 2019 14:44:48 +0000 (16:44 +0200)]
udevd: open log output early

We'd log to the "console", losing structured logs during configuration file parsing.
Let's be nice to journalctl users, and log to the journal immediately.

5 years agobasic/log: omit ":0" from message when line number is not specified
Zbigniew Jędrzejewski-Szmek [Mon, 1 Jul 2019 14:37:10 +0000 (16:37 +0200)]
basic/log: omit ":0" from message when line number is not specified

And obviously CONFIG_LINE=0 is also not logged.

The way that log_syntax_internal now looks is becoming a bit crazy, but we
can't easily conditionalize on both unit and config_file, and we have different
types, so it's not easy to make this more compact.

5 years agoudev: warn when we fail to parse udev.conf
Zbigniew Jędrzejewski-Szmek [Mon, 1 Jul 2019 14:15:40 +0000 (16:15 +0200)]
udev: warn when we fail to parse udev.conf

This should be like any other parse error and a warning should be emitted.
Let's use log_syntax() so we get the CONFIG_FILE= set.

5 years agotest: add test for sd_netlink_message_enter_array()
Yu Watanabe [Thu, 4 Jul 2019 05:56:54 +0000 (14:56 +0900)]
test: add test for sd_netlink_message_enter_array()