Michal Sekletar [Fri, 22 Feb 2019 14:50:55 +0000 (15:50 +0100)]
logind: don't print warning when user@.service template is masked
User instance of systemd is optional feature and if user@.service
template is masked then administrator most likely doesn't want --user
instances of systemd for logged in users. We don't need to be verbose
about it.
Chris [Fri, 22 Feb 2019 15:47:31 +0000 (10:47 -0500)]
Fix manpage typo: abrubtly
Fix a minor typo: abrubtly -> abruptly.
Lennart Poettering [Fri, 22 Feb 2019 14:59:22 +0000 (15:59 +0100)]
Merge pull request #11797 from keszybz/analyze-calendar-highlight
Highlight in systemd-analyze calendar
Roman Kulikov [Tue, 15 Jan 2019 16:05:18 +0000 (19:05 +0300)]
logind: udev rule for Parallels video adapter
This enables graphical capability for a video adapter of Parallels
virtualization platform (Parallels Desktop for Mac product) which is not
a DRM device at the moment.
This fixes GUI in Fedora 29 guest on Parallels Desktop where gdm now
strictly checks for CanGraphical property of a seat, see [1].
Should be noted that there's no in-kernel driver for Parallels video at
the moment so device matching is done by vid/pid.
[1] https://gitlab.gnome.org/GNOME/gdm/merge_requests/37
Taro Yamada [Fri, 22 Feb 2019 08:16:34 +0000 (17:16 +0900)]
mkosi: (Archlinux) increase the size of root partition.
Currently "mkosi --default .mkosi/mkosi.arch" fails to build the image due to pacman error:
"error: Partition /var/tmp/mkosi-xxx/root too full: yyy blocks needed, zzz blocks free"
"error: not enough free disk space"
"error: failed to commit transaction (not enough free disk space)"
So increase the size to 3G.
Zbigniew Jędrzejewski-Szmek [Fri, 22 Feb 2019 08:51:50 +0000 (09:51 +0100)]
Merge pull request #11781 from yuwata/udev-rule-continuation-fix
udev-rules: fix line continuation
Zbigniew Jędrzejewski-Szmek [Fri, 22 Feb 2019 08:29:23 +0000 (09:29 +0100)]
analyze: add color highlighting when printing calendar elapses
With multiple iterations, I found it hard to pick out the interesting bits in
the column of text. I tried plain highlighting first, but it doesn't seem
enough. But blue/yellow makes it easy to jump to the right iteration.
Zbigniew Jędrzejewski-Szmek [Fri, 22 Feb 2019 08:18:42 +0000 (09:18 +0100)]
analyze: split out loop innards into a separate function
This was intended to be just a refactoring, but it also fixes a minor bug:
after printing "never", we would skip subsequent expressions:
$ systemd-analyze calendar --iterations=20 @0 @1
systemd-analyze calendar --iterations=20 @0 @1
Original form: @0
Normalized form: 1970-01-01 00:00:00 UTC
Next elapse: never
(the second expression was skipped).
Lennart Poettering [Thu, 21 Feb 2019 11:07:05 +0000 (12:07 +0100)]
analyze: optionally, show more than one elapse time for calendar expressions
Martin Pitt [Fri, 22 Feb 2019 07:04:37 +0000 (08:04 +0100)]
units: re-drop ProtectHostname from systemd-hostnamed.service (#11792)
This was an overzealous setting from commit
99894b867f. Without this,
`hostnamectl set-hostname` fails with
Could not set property: Access denied
as `sethostname()` fails with `EPERM`.
emersion [Thu, 21 Feb 2019 15:19:04 +0000 (16:19 +0100)]
libsystemd: check if _POSIX_C_SOURCE is defined
This can cause issues if sd-event.h is included in a source file that doesn't
define _POSIX_C_SOURCE and is compiled with -Wundef.
Yu Watanabe [Thu, 21 Feb 2019 09:04:12 +0000 (18:04 +0900)]
test-udev: fix alignment and drop unnecessary white spaces
Yu Watanabe [Thu, 21 Feb 2019 09:03:32 +0000 (18:03 +0900)]
test-udev: add more tests for line continuation
Yu Watanabe [Thu, 21 Feb 2019 08:29:29 +0000 (17:29 +0900)]
udev-rules: do not ignore short lines
Otherwise, a short line continues the previous continuation.
This fixes a bug introduced by
f10aa08e3e48de7dcb71be348f021c6b1385304f.
Hans de Goede [Thu, 21 Feb 2019 11:50:10 +0000 (12:50 +0100)]
hwdb: Add accelerometer orientation quirk for the Medion Akoya E2212T
Add accelerometer orientation quirk for the Medion Akoya E2212T 2-in-1.
Lennart Poettering [Thu, 21 Feb 2019 14:15:37 +0000 (15:15 +0100)]
Merge pull request #11608 from taro-yamada/add_persistent_randmized_delay
core: add "Persistent=delay" to delay persistent timers after boot
Lennart Poettering [Thu, 21 Feb 2019 14:15:11 +0000 (15:15 +0100)]
Merge pull request #11776 from keszybz/networkd-ordered-sets
Store domains lists in OrderedSets in networkd
Lennart Poettering [Thu, 21 Feb 2019 13:05:26 +0000 (14:05 +0100)]
Merge pull request #11784 from martinpitt/networkd-tests
Various networkd test fixes
Zbigniew Jędrzejewski-Szmek [Thu, 21 Feb 2019 06:58:24 +0000 (07:58 +0100)]
Add a work-around for memsan
Fixes #11735.
Martin Pitt [Thu, 21 Feb 2019 11:34:23 +0000 (12:34 +0100)]
networkd-test: fix test_dropin()
- This test needs resolved, so make sure it is started. In some Debian
environments it is not.
- It was an unnecessary, and now failing assumption that name servers
get atomically written to the resolved's resolv.conf. Wait until both
expected name servers are in the file.
Martin Pitt [Thu, 21 Feb 2019 11:26:44 +0000 (12:26 +0100)]
networkd-test: use a complete domain name in test_route_only_dns()
Since version 241 (commit ea4678?), querying MX type records for
single-label domains does not actually forward the query to the DNS
server any more. Use "example.com" instead, which is the recommended
test domain anyway.
Martin Pitt [Thu, 21 Feb 2019 11:24:16 +0000 (12:24 +0100)]
networkd-test: disable DNSSEC in domain-restricted DNS test
dnsmasq 2.80 changed behaviour when being queried by resolved with
enabled DNSSEC: It returns errors for SOA and DS queries which cause the
entire query to fail. As we don't configure DNSSEC in this test anyway,
just disable it so that we retain compatibility with old and new dnsmasq
versions.
Taro Yamada [Tue, 19 Feb 2019 12:01:50 +0000 (21:01 +0900)]
core: delay persistent timers by "RandomizedDelaySec=" at boot.
Fixes #5659.
Currently, if Persistent=true and the machine is off at the scheduled time of the timer unit, the timer
will be triggered immediately at the next boot even if RandomizedDelaySec= is specified.
As a result, if multiple timers meet that condition, they will be triggered at the same time and too
much CPU/IO work makes boot slow down.
With this commit, if the scheduled time of the persistent timer has already elapsed at boot,
set the time when systemd first started as the scheduled time and RandomizedDelaySec= is applied to it.
Zbigniew Jędrzejewski-Szmek [Thu, 21 Feb 2019 11:30:13 +0000 (12:30 +0100)]
tests: shorten the fuzz test case
The test was failing in Ubuntu CI with a 30s timeout. It makes
sense to keep the file so exercise the set allocation logic, but
we can make it shorter.
Zbigniew Jędrzejewski-Szmek [Thu, 21 Feb 2019 09:04:23 +0000 (10:04 +0100)]
shared/hashmap: trivial style updates
Zbigniew Jędrzejewski-Szmek [Wed, 20 Feb 2019 21:50:25 +0000 (22:50 +0100)]
networkd: use OrderedSets instead of strvs to store lists of domains
We were already using OrderedSets in the manager object, but strvs in the
configuration parsing code. Using sets gives us better scaling when many
domains are used.
In oss-fuzz #13059 the attached reproducer takes approximately 30.5 s to be
parsed. Converting to sets makes this go down to 10s. This is not _vastly_
faster, but using sets seems like a nicer approach anyway. In particular, we
avoid the quadratic de-unification operation after each addition.
Zbigniew Jędrzejewski-Szmek [Wed, 20 Feb 2019 21:39:47 +0000 (22:39 +0100)]
basic/ordered-set: export networkd function to print string sets
Tests are added.
Zbigniew Jędrzejewski-Szmek [Wed, 20 Feb 2019 21:29:20 +0000 (22:29 +0100)]
basic/ordered-set: add functions to operate on OrderedSets of strings
Yu Watanabe [Sat, 16 Feb 2019 18:27:57 +0000 (03:27 +0900)]
socket-util: re-implement socket_address_parse_netlink() by using extract_first_word()
This drops support of trailing white space when a multicast group is
specified.
Fixes one of issues in #11738.
Lennart Poettering [Thu, 21 Feb 2019 10:28:35 +0000 (11:28 +0100)]
Merge pull request #11748 from yuwata/fix-11711
network: handle disable_ipv6 sysctl property
Lennart Poettering [Thu, 21 Feb 2019 10:09:35 +0000 (11:09 +0100)]
Merge pull request #11772 from c0d3z3r0/master
Make systemd-boot compliant with the Linux Boot / EFI Handover Protocol
Yu Watanabe [Thu, 21 Feb 2019 09:11:20 +0000 (18:11 +0900)]
resolve: fix null pointer dereferences
Follow-up for
8227cfa137d8a930519717b752128b8d035b83e5.
Fixes CID#1398986.
Szabolcs Fruhwald [Wed, 20 Feb 2019 20:38:50 +0000 (12:38 -0800)]
cgtop: Fix processing of controllers other than CPU
After debugging the issue with gdb, I found that the following change
94ddb08 "cgtop: Still try to get CPU statistics if controller-free"
has introduced a bug, which prevents process(..) method processing
memory and io controllers when cpu_accounting_is_cheap() is true.
The obvious fix is to move this branch to be the last one, keeping
the intended behavior of the above change, without having a negative
effect on the other controllers.
Fixes #11773 [systemd-cgtop no longer shows memory (and io) usage]
Zbigniew Jędrzejewski-Szmek [Thu, 21 Feb 2019 06:29:25 +0000 (07:29 +0100)]
generator: rename systemd-mkfs@.service to systemd-makefs@.service
The second name was used in documentation, and the first in the code that
generated the unit. 'systemd-makefs' is the name we want, for example for
consistency with the systemd-makefs executable.
In principle this breaks compatibility, but in practice this is unlikely to be
noticeable. Each instance of the unit is created by writing out a full
definition, so the template was never defined. So the name could only be used
for ordering, and there is not reason to order things against this unit from
the outside: the ordering would rather be against the final mount unit.
Fixes #11769.
Yu Watanabe [Mon, 18 Feb 2019 06:26:26 +0000 (15:26 +0900)]
test-network: add testcases for handling disable_ipv6 sysctl property
Yu Watanabe [Mon, 18 Feb 2019 06:26:54 +0000 (15:26 +0900)]
test-network: update cosmetic workaround
Almost all tests call copy_unit_to_networkd_unit_path() at first.
So, let's move the line break there.
Yu Watanabe [Mon, 18 Feb 2019 06:00:15 +0000 (15:00 +0900)]
network: check whether ipv6 is enabled in sysctl
Currently, the value is read only once.
Fixes #11711.
Yu Watanabe [Mon, 18 Feb 2019 05:47:13 +0000 (14:47 +0900)]
network: use sysctl_read_ip_property()
Yu Watanabe [Mon, 18 Feb 2019 05:41:43 +0000 (14:41 +0900)]
sysctl-util: add sysctl_read_ip_property()
Yu Watanabe [Mon, 18 Feb 2019 05:30:32 +0000 (14:30 +0900)]
network: use sysctl_write_ip_property() and friends
Yu Watanabe [Mon, 18 Feb 2019 04:34:01 +0000 (13:34 +0900)]
sysctl-util: introduce sysctl_write_ip_property() and friends
Michael Niewöhner [Wed, 20 Feb 2019 20:09:09 +0000 (21:09 +0100)]
Make systemd-boot compliant with the Linux Boot / EFI Handover Protocol
The current implementation copied the *complete* header to boot_params,
thus making the kernel ignore many of the fields.
As mentioned in the code comment for the sentinel variable in
bootparam.h a bootloader should only copy the setup_header, set some
fields in boot_params and zero out anything else.
This change makes systemd-boot (mostly) compliant with the Linux Boot
Protocol and the EFI Handover Protocol described in bootparam.h and
Documentation/boot.txt to fix various issues:
- Secure boot not being detected corretly by Linux (#11717)
- tboot error message / warning on boot (#11717)
- Strange purple text color when booting in qemu with OVMF
- Hopefully even more ...
unixsysadmin [Wed, 20 Feb 2019 21:35:17 +0000 (21:35 +0000)]
Fix typo - "do note use guessable names"
Fix typo - "do note use guessable names" to "do not use guessable names"
Zbigniew Jędrzejewski-Szmek [Wed, 20 Feb 2019 21:12:48 +0000 (22:12 +0100)]
test-ordered-set: add a copy of test-set adapted to OrderedSet
Zbigniew Jędrzejewski-Szmek [Wed, 20 Feb 2019 20:30:06 +0000 (21:30 +0100)]
networkd: wrap long log lines
Michael Niewöhner [Wed, 20 Feb 2019 19:14:15 +0000 (20:14 +0100)]
Revert "Set secure_boot flag in Kernel Zero-Page (#7482)"
This reverts commit
b4f9f2a62fd003a30a304a25b3b6ffc4048d0f24.
Revert this because a) the quiet bug is fixed in linux and b)
Documentation/boot.txt says "All other fields should be zero."
Benjamin Dahlhoff [Wed, 20 Feb 2019 18:05:25 +0000 (19:05 +0100)]
hwdb: rotation for Trekstor Surf Tab Twin 11.6 aka VolksTablet (#11771)
Zbigniew Jędrzejewski-Szmek [Wed, 20 Feb 2019 18:03:13 +0000 (19:03 +0100)]
Merge pull request #11512 from poettering/resolved-stub-pipeline
support incoming pipelined TCP stream queries in DNS stub server
Zbigniew Jędrzejewski-Szmek [Wed, 20 Feb 2019 17:37:05 +0000 (18:37 +0100)]
Merge pull request #11725 from poettering/temp-dir
docs: document semantics of /tmp and /var/tmp
Zbigniew Jędrzejewski-Szmek [Wed, 20 Feb 2019 17:34:03 +0000 (18:34 +0100)]
Merge pull request #11482 from poettering/tmpfiles-bsd-lock
adds a fully safe way how apps can pin files into /tmp temporarily, excepting them from the tmpfiles aging algorithm, based on BSD file locks on dirs we descend into
Lennart Poettering [Mon, 18 Feb 2019 16:48:34 +0000 (17:48 +0100)]
man,units: link up new documentation about temporary directories
Lennart Poettering [Fri, 15 Feb 2019 15:52:13 +0000 (16:52 +0100)]
docs: document semantics of /tmp and /var/tmp
Anita Zhang [Thu, 7 Feb 2019 23:25:37 +0000 (15:25 -0800)]
core: add ':' prefix to ExecXYZ= skip env var substitution
Lennart Poettering [Wed, 20 Feb 2019 16:55:28 +0000 (17:55 +0100)]
Merge pull request #11556 from yuwata/udev-ctrl-use-sd-event
udev: make `udevadm control` send multiple control commands in a single connection
Lennart Poettering [Wed, 20 Feb 2019 13:12:15 +0000 (14:12 +0100)]
Merge pull request #11682 from topimiettinen/private-utsname
core: ProtectHostname feature
Topi Miettinen [Mon, 18 Feb 2019 22:30:12 +0000 (00:30 +0200)]
units: enable ProtectHostname=yes
Topi Miettinen [Fri, 8 Feb 2019 17:25:00 +0000 (19:25 +0200)]
core: ProtectHostname= feature
Let services use a private UTS namespace. In addition, a seccomp filter is
installed on set{host,domain}name and a ro bind mounts on
/proc/sys/kernel/{host,domain}name.
Franck Bui [Wed, 13 Feb 2019 17:45:36 +0000 (18:45 +0100)]
namespace: make MountFlags=shared work again
Since commit
0722b359342d2a9f9e0d453875624387a0ba1be2, the root mountpoint is
unconditionnally turned to slave which breaks units that are using explicitly
MountFlags=shared (and no other options that would implicitly require a slave
root mountpoint).
Here is a test case:
$ systemctl cat test-shared-mount-flag.service
# /etc/systemd/system/test-shared-mount-flag.service
[Service]
Type=simple
ExecStartPre=/usr/bin/mkdir -p /mnt/tmp
ExecStart=/bin/sh -c "/usr/bin/mount -t tmpfs -o size=10M none /mnt/tmp && sleep infinity"
ExecStop=-/bin/sh -c "/usr/bin/umount /mnt/tmp"
MountFlags=shared
$ systemctl start test-shared-mount-flag.service
$ findmnt /mnt/tmp
$
Mount on /mnt/tmp is not visible from the host although MountFlags=shared was
used.
This patch fixes that and turns the root mountpoint to slave when it's really
required.
Yu Watanabe [Fri, 25 Jan 2019 16:16:00 +0000 (01:16 +0900)]
man: udevadm: mention that no control command can be specified after --exit
Yu Watanabe [Fri, 25 Jan 2019 15:33:08 +0000 (00:33 +0900)]
udev-ctrl: split out logic of waiting for reply to udev_ctrl_wait()
This makes `udevadm control` can send multiple commands in one
connection.
Zbigniew Jędrzejewski-Szmek [Fri, 18 Jan 2019 15:39:58 +0000 (16:39 +0100)]
udevadm: print error if the commands fail
We'd exit with an error but no output. Print the error in the usual fashion.
Yu Watanabe [Fri, 25 Jan 2019 15:27:26 +0000 (00:27 +0900)]
udev-ctrl: use sd_event and introduce udev_ctrl_start()
Now the new callback function get enum udev_ctrl_msg_type.
So, this commit also drops udev_ctrl_connection and udev_ctrl_msg.
Yu Watanabe [Fri, 25 Jan 2019 15:13:16 +0000 (00:13 +0900)]
udev: drop unused Manager::uevent_event
Yu Watanabe [Thu, 24 Jan 2019 06:09:40 +0000 (15:09 +0900)]
udev-ctrl: refactor udev_ctrl_enable_receiving()
Yu Watanabe [Thu, 24 Jan 2019 06:00:06 +0000 (15:00 +0900)]
udev-ctrl: make udev_ctrl_new() return negative errno on failure
Yu Watanabe [Mon, 18 Feb 2019 23:30:02 +0000 (08:30 +0900)]
util: make base64_append() add a whitespace before appending data
Follow-up for
4bb91a950a0f2eae27bb4c7aaff9a87e86ef0c44.
Yu Watanabe [Tue, 19 Feb 2019 21:13:53 +0000 (06:13 +0900)]
Merge pull request #11764 from yuwata/network-verify
network: introduce network_verify() and drop incompatible settings
Yu Watanabe [Tue, 19 Feb 2019 04:13:04 +0000 (05:13 +0100)]
test-network: add tests for meaningless settings which should be ignored by networkd
Yu Watanabe [Tue, 19 Feb 2019 03:36:15 +0000 (12:36 +0900)]
network: introduce network_verify()
Some settings cannot set simultaneously. Let's warn and drop
incompatible settings.
Currently, it is not comprehensive. But this may be a good first step.
Yu Watanabe [Tue, 19 Feb 2019 03:35:51 +0000 (12:35 +0900)]
network: warn about deprecated value in DHCP=
Yu Watanabe [Tue, 19 Feb 2019 03:34:53 +0000 (12:34 +0900)]
network: update enum value assignments for AddressFamilyBoolean
Yu Watanabe [Tue, 19 Feb 2019 21:11:11 +0000 (06:11 +0900)]
Merge pull request #11759 from yuwata/fix-test-dropin
test-network: check whether ethtool support driver field for dummy interfaces
Yu Watanabe [Tue, 19 Feb 2019 21:10:37 +0000 (06:10 +0900)]
Merge pull request #11757 from yuwata/test-udev-continuation
test-udev: add more tests for line continuations and comments
Yu Watanabe [Tue, 19 Feb 2019 10:56:48 +0000 (19:56 +0900)]
test-network: check whether ethtool support driver field for dummy interfaces
Fixes #11758.
Beniamino Galvani [Sun, 17 Feb 2019 18:06:34 +0000 (19:06 +0100)]
dhcp: don't stop receiving packets when the link goes down
When the link goes down, DHCP client_receive_message*() functions return an
error and the related I/O source is removed from the main loop. With the
current implementation of systemd-networkd this doesn't matter because the DHCP
client is always stopped on carrier down and restarted on carrier up. However
it seems wrong to have the DHCP client crippled (because no packet can be
received anymore) once the link goes temporarily down.
Change the receive functions to ignore a ENETDOWN event so that the client will
be able to receive packets again after the link comes back.
Yu Watanabe [Tue, 19 Feb 2019 06:09:28 +0000 (15:09 +0900)]
network: do not log wrong error cause
If sd_dhcp_lease_get_router() returns a positive value and the first
router is null, then invalid error cause was logged.
Follow-up for
f8862395e8f802e4106a07ceaaf02b6a1faa5a6d.
Yu Watanabe [Tue, 19 Feb 2019 05:35:10 +0000 (14:35 +0900)]
man: drop unnecessary parenthesis
Yu Watanabe [Tue, 19 Feb 2019 10:32:03 +0000 (19:32 +0900)]
Merge pull request #11754 from poettering/bus-path-limit
sd-bus path limit fixes
Yu Watanabe [Tue, 19 Feb 2019 10:27:01 +0000 (19:27 +0900)]
Merge pull request #11763 from yuwata/disable-test-dropin-driver
test-network: tentatively disable Driver field test
Yu Watanabe [Tue, 19 Feb 2019 08:39:02 +0000 (17:39 +0900)]
test-network: disable test for Driver field in networkctl
CentOS CI does not like the test. Let's at least tentatively disable the test.
Yu Watanabe [Tue, 19 Feb 2019 08:38:30 +0000 (17:38 +0900)]
test-network: update format used by networkctl status
Yu Watanabe [Tue, 19 Feb 2019 00:22:45 +0000 (09:22 +0900)]
test-udev: add more tests for line continuations and comments
Yu Watanabe [Tue, 19 Feb 2019 00:21:42 +0000 (09:21 +0900)]
test-udev: use proper semantics for too long line with continuation
Follow-up for
1e797cf596df50a6bdd8cbf8e9b2467a3a934171.
Riccardo Schirone [Mon, 4 Feb 2019 13:29:28 +0000 (14:29 +0100)]
Allocate temporary strings to hold dbus paths on the heap
Paths are limited to BUS_PATH_SIZE_MAX but the maximum size is anyway too big
to be allocated on the stack, so let's switch to the heap where there is a
clear way to understand if the allocation fails.
Riccardo Schirone [Mon, 4 Feb 2019 13:29:09 +0000 (14:29 +0100)]
Refuse dbus message paths longer than BUS_PATH_SIZE_MAX limit.
Even though the dbus specification does not enforce any length limit on the
path of a dbus message, having to analyze too long strings in PID1 may be
time-consuming and it may have security impacts.
In any case, the limit is set so high that real-life applications should not
have a problem with it.
Lennart Poettering [Mon, 18 Feb 2019 17:35:47 +0000 (18:35 +0100)]
Merge pull request #11478 from yuwata/enumerate-match-parent
sd-device-enumerator: support multiple parents
Alexander Tsoy [Wed, 23 Jan 2019 13:33:50 +0000 (16:33 +0300)]
resolved: correctly prove the non-existense of wildcard
* Current logic:
For each NSEC RR find the common suffix between the owner name and
the next name, append asterisk to that suffix and check that
generated wildcard is covered by the NSEC RR in question.
* New logic:
Find NSEC RR covering queried name, generate wildcard as
<asterisk>.<closest encloser> using this RR, then check if any
of the NSEC RRs covers generated wildcard.
Matthias Klumpp [Sun, 9 Sep 2018 01:18:45 +0000 (03:18 +0200)]
core: Allow to configure execute_directories execution behavior
This adds a new bitfield to `execute_directories()` which allows to
configure whether to ignore non-zero exit statuses of binaries run and
whether to allow parallel execution of commands.
In case errors are not ignored, the exit status of the failed script
will now be returned for error reposrting purposes or other further
future use.
Lennart Poettering [Mon, 18 Feb 2019 15:02:45 +0000 (16:02 +0100)]
Merge pull request #10408 from keszybz/analyze-cat-presets
systemd-analyze cat-presets
Lennart Poettering [Mon, 18 Feb 2019 15:02:26 +0000 (16:02 +0100)]
Merge pull request #11729 from yuwata/fix-11721
sd-device: also store properties read from udev database to sd_device::properties_db
Lennart Poettering [Mon, 18 Feb 2019 14:51:30 +0000 (15:51 +0100)]
Merge pull request #11208 from thom311/dhcp-router-option-list
dhcp: have DHCP library support multiple router entries in Router option (3)
Thomas Haller [Mon, 18 Feb 2019 12:01:56 +0000 (13:01 +0100)]
netlink: fix routing-policy-rule integer type for FRA_TUN_ID
FRA_TUN_ID is a 64 big endian integer. Fix the policy.
FRA_TUN_ID is unused by networkd, hence I think this bug
has no actual consequences.
Fixes:
bce67bbee359eec19e6778619b6651100a1c1477
Lennart Poettering [Mon, 18 Feb 2019 12:41:52 +0000 (13:41 +0100)]
Merge pull request #11457 from grooverdan/sendsigkill_no
service: killmode=cgroup|mixed, SendSIGKILL=no services are not multiprocess
Thomas Haller [Sun, 16 Dec 2018 21:02:21 +0000 (22:02 +0100)]
network: avoid inet_ntoa() in favor of inet_ntop()
inet_ntop() is not documented to be thread-safe, so it should not
be used in the DHCP library. Arguably, glibc uses a thread local
buffer, so indeed there is no problem with a suitable libc. Anyway,
just avoid it.
Thomas Haller [Fri, 14 Dec 2018 15:25:01 +0000 (16:25 +0100)]
dhcp: move filtering of bogus DNS/NTP addresses out of DHCP client
The DHCP client should not pre-filter addresses beyond what RFC
requires. If a client's user (like networkd) wishes to skip/filter
certain addresses, it's their responsibility.
The point of this is that the DHCP library does not hide/abstract
information that might be relevant for certain users. For example,
NetworkManager exposes DHCP options in its API. When doing that, the
options should be close to the actual lease.
This is related to commit
d9ec2e632df4905201facf76d6a205edc952116a
(dhcp4: filter bogus DNS/NTP server addresses silently).
Thomas Haller [Fri, 14 Dec 2018 10:10:57 +0000 (11:10 +0100)]
dhcp: handle multiple addresses for "Router" (option 3) in DHCP library
The Router DHCP option may contain a list of one or more
routers ([1]). Extend the API of sd_dhcp_lease to return a
list instead of only the first.
Note that networkd still only uses the first router (if present).
Aside from extending the internal API of the DHCP client, there
is almost no change in behavior. The only visible difference in
behavior is that the "ROUTER" variable in the lease file is now a
list of addresses.
Note how RFC 2132 does not define certain IP addresses as invalid for the
router option. Still, previously sd_dhcp_lease_get_router() would never
return a "0.0.0.0" address. In fact, the previous API could not
differenciate whether no router option was present, whether it
was invalid, or whether its first router was "0.0.0.0". No longer let
the DHCP client library impose additional restrictions that are not
part of RFC. Instead, the caller should handle this. The patch does
that, and networkd only consideres the first router entry if it is not
"0.0.0.0".
[1] https://tools.ietf.org/html/rfc2132#section-3.5
Thomas Haller [Fri, 14 Dec 2018 23:45:46 +0000 (00:45 +0100)]
network: don't return allocated buffer of zero length from deserialize_in_addrs()
deserialize_in_addrs() allocates the buffer before trying to parse
the IP address. Since a parsing error is silently ignored, the returned
size might be zero. In such a case we shouldn't return any buffer.
Anyway, there was no leak, because there are only two callers like
r = deserialize_in_addrs(&lease->dns, dns);
which both keep the unused buffer and later release it.
Note that deserialize_in_addrs() doesn't free the pointer before
reassigning the new output. The caller must take care to to pass
"ret" with an allocated buffer that would be leaked when returning
the result.
Lennart Poettering [Mon, 18 Feb 2019 12:05:34 +0000 (13:05 +0100)]
Merge pull request #11746 from yuwata/udev-rules-cleanup
udev-rules: several cleanups for udev-rules.c
Yu Watanabe [Sat, 16 Feb 2019 17:40:02 +0000 (02:40 +0900)]
meson: drop unused HAVE_STRUCT_FIB_RULE_{UID,PORT}_RANGE
Lennart Poettering [Mon, 18 Feb 2019 12:00:13 +0000 (13:00 +0100)]
Merge pull request #11681 from yuwata/network-link-enslaved-operstate
network: introduce new 'enslaved' operstate