Commit graph

38313 commits

Author SHA1 Message Date
Yu Watanabe ac1d4c7986 fstab-generator: also logs about x-systemd.growfs mount option 2019-02-18 11:31:10 +09:00
Yu Watanabe 7731c1c20a fstab-generator: fix debug log 2019-02-18 11:29:45 +09:00
Yu Watanabe b117044c09 test-network: decrease sleep time in test_bind_carrier()
This effectively reverts 63eb09569a,
as the commit does not fix #11724.
2019-02-18 06:11:50 +09:00
Yu Watanabe 25e992ba23 network: always drop configs when corresponding network file does not exist
Follow-up for 93b4dab57e.

Fixes #11724.
2019-02-18 06:11:50 +09:00
Yu Watanabe 4bb91a950a resolve: drop unnecessary %n fields from dns_resource_record_to_string()
And use returned value by asprintf() instead.

This hopefully fixes #11733.
2019-02-16 23:29:08 +01:00
Yu Watanabe 63eb09569a test-network: increase sleep time in test_bind_carrier()
Hopefully fixes #11667.
2019-02-16 07:22:54 +09:00
Yu Watanabe ee1a36aee1
Merge pull request #11727 from filbranden/minor1
A couple of very minor fixes
2019-02-16 07:22:00 +09:00
Yu Watanabe 57f08d5cdd udev-rules: update log messages about OWNER= or GROUP= settings on --resolve=names=never
This also set lower log level for the messages.

6e2efb6c73 introduces the log messages.
But udevd may be started with --resolve-names=never, and the behavior
is expected.

Fixes #11720.
2019-02-16 07:21:28 +09:00
Filipe Brandenburger ba9e3fc488 readme: Minor style and spacing fix
Fix section header for stable branches and backports. All the other
headings end in a colon and have no blank lines between them and the
body of the section, so fix this one accordingly.
2019-02-15 11:05:04 -08:00
Filipe Brandenburger c8f22490ee editors: Prevent ctags from following symlinks
Some tests will create a subtree of /sys under build/test/sys and
depending on the local system that tree might end up having an infinite
chain of symlinks. For example:

  $ ls build/test/sys/devices/pnp0/00:00/subsystem/devices/00:00/subsystem/devices/00:00/subsystem/devices/00:00/subsystem/devices/00:00/subsystem/devices/00:00/subsystem/
  devices  drivers  drivers_autoprobe

Exuberant ctags will by default follow symlinks, so configure it not to
do so through a local .ctags file setting --links=no.

Tested that `ctags -R` doesn't get stuck with the dotfile present.
2019-02-15 11:01:20 -08:00
Andrzej Pietrasiewicz 2c633a821e units: add usb-gadget target
Linux can be run on a device meant to act as a USB peripheral. In order
for a machine to act as such a USB device it has to be equipped with
a UDC - USB Device Controller.

This patch adds a target reached when UDC becomes available. It can be used
for activating e.g. a service unit which composes a USB gadget with
configfs and activates it.
2019-02-15 18:16:27 +01:00
Jonathon Kowalski 791cd15993 Fail RequisiteOf units with oneshots
Fixes: #11422

Oneshots going to inactive directly without ever entering UNIT_ACTIVE is
considered success. This however means that if something both Requires=
and Requisites= a unit of such nature, the verify-active job getting
merged into the start job makes it lose this property of failing the
depending jobs, as there, the start job has the result JOB_DONE on
success, so we never walk over RequisiteOf units.

This change makes sure that such units always go down. It is also only
meaningful with After=, but so is Requisite= itself. Also, we also catch
cases like a oneshot having RemainAfterExit= true making us start up
properly in such a setting, but then removing it, reloading the unit,
and restarting it. In such a case, we go down due to restart propagation
before them, and our start job waits on theirs, properly failing with
the JOB_DEPENDENCY result.

This covers cases where ConditionXYZ= creates a similar situation as
well.
2019-02-15 13:42:54 +01:00
Thomas Haller a15ff62d76 netlink: fix netlink type for routing-rule FRA_L3MDEV
Fixes: bce67bbee3
2019-02-15 20:18:27 +09:00
Lennart Poettering 84e4b0b893
Merge pull request #11716 from ssahani/drop-autoconf-address
networkd: ipv6ra allow to ignore addresses
2019-02-15 12:17:46 +01:00
Lennart Poettering bbd8598f8b
Merge pull request #11589 from yuwata/udevd-is-device-busy
udevd: refactoring is_device_busy()
2019-02-15 12:16:37 +01:00
Michael Olbrich 646876105f v4l_id: use device_caps if available
According to the specification[1] the 'capabilities' describe the physical
device as a whole and the 'device_caps' describe the current device node.
The existence of 'device_caps' is indicated by the V4L2_CAP_DEVICE_CAPS
capability flag.
Use the 'device_caps' if available to generate the correct
ID_V4L_CAPABILITIES for the current device node.

This is relevant for UVC devices with current kernels: Two /dev/videoX
devices exist for those. One for video and one for metadata. The
 V4L2_CAP_VIDEO_CAPTURE flag is present in the 'capabilities' for both
device nodes but only in the 'device_caps' of the video device node.

Without this, the ID_V4L_CAPABILITIES of the metadata device node
incorrectly contains 'capture'.

[1] https://www.linuxtv.org/downloads/v4l-dvb-apis-new/uapi/v4l/vidioc-querycap.html
2019-02-15 12:14:05 +01:00
Lennart Poettering eca3d5d567
Merge pull request #9594 from filbranden/cpu_quota_period1
core: add CPUQuotaPeriodSec=
2019-02-15 12:11:42 +01:00
Lennart Poettering 5c5c21835a
Merge pull request #11634 from yuwata/rfe-11622
busctl: add 'emit' command
2019-02-15 11:56:32 +01:00
Lennart Poettering a0279563d7
Merge pull request #11719 from yuwata/networkctl-wildcards
networkctl: accept wildcards to specify links
2019-02-15 11:44:24 +01:00
Thomas Haller 13f1fd0376 dhcp: ignore padding of 'chaddr' in DHCP server response
The "chaddr" field is 16 bytes long, with "hlen" being the
length of the address.

https://tools.ietf.org/html/rfc2131#section-4.3.1 says:

    The server MUST return to the client:

    ...

    o Any parameters specific to this client (as identified by
      the contents of 'chaddr' or 'client identifier' in the DHCPDISCOVER
      or DHCPREQUEST message), e.g., as configured by the network
      administrator,

It's not clear, whether only the first 'hlen' bytes of 'chaddr'
must correspond or all 16 bytes.

Note that https://tools.ietf.org/html/rfc4390#section-2.1 says for IPoIB

    "chaddr" (client hardware address) field MUST be zeroed.

with having "hlen" zero. This indicates that at least in this case, the
bytes after "hlen" would matter.

As the DHCP client always sets the trailing bytes to zero, we would expect
that the server also replies as such and we could just compare all 16 bytes.
However, let's be liberal and accept any padding here.

This in practice only changes behavior for infiniband, where we
previously would enforce that the first ETH_ALEN bytes are zero.
That seems arbitrary for IPoIB. We should either check all bytes or
none of them. Let's do the latter and don't enforce RFC 4390 in this
regard.
2019-02-15 11:41:06 +01:00
Lennart Poettering 8e6b3f49fe
Merge pull request #11636 from yuwata/network-in-addr-is-null
network, sd-netlink: unify several functions and fixes coding style
2019-02-15 11:40:34 +01:00
Lennart Poettering 683a1e7fd9
Merge pull request #11594 from yuwata/udev-rule-cleanups
udev-rule, ethtool: several coding style cleanups
2019-02-15 11:37:11 +01:00
Lennart Poettering 19df3047f3
Merge pull request #9262 from ssahani/ignore-carrier-9111
networkd: allow to retain configs even if carrier is lost
2019-02-15 11:35:43 +01:00
Ignat Korchagin def3c7c791 resolved: use Cloudflare public DNS server as a default fallback alongside Google one
Cloudflare public DNS service is currently the fastest one according to
https://www.dnsperf.com/#!dns-resolvers. Why not improve the experience for
systemd users using this as a default fallback nameserver?
2019-02-15 11:34:11 +01:00
Lennart Poettering bd0a4a3da8
Merge pull request #11617 from topimiettinen/backlight-handle-zero-file-load
backlight: handle loading truncated file
2019-02-15 11:32:58 +01:00
Lennart Poettering dcf3c3c3d9 core: export $PIDFILE env var for services, derived from PIDFile= 2019-02-15 11:32:19 +01:00
Lennart Poettering 7ca9289ca2
Merge pull request #11373 from tomty89/auto
mount/generators: do not make unit wanted by its device unit
2019-02-15 11:31:55 +01:00
Lennart Poettering e5d21c24a0
Merge pull request #11382 from keszybz/udev-predictable-macs
Allow MACAddressPolicy=persistent for all virtual devices
2019-02-15 11:31:25 +01:00
Lennart Poettering c49adafa82
Merge pull request #11506 from bl33pbl0p/reload-fix
Return -EAGAIN instead of -EALREADY from unit_reload
2019-02-15 11:31:00 +01:00
Tony Asleson f82abfcda5 rules: watch metadata changes on nbd devices
Include nbd* in match for watch option assignment.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2019-02-15 11:30:33 +01:00
Yu Watanabe cd65d06720 test-network: add test for BindCarrier= 2019-02-15 11:30:17 +01:00
Yu Watanabe fe3ab8458b login: add a missing error check for session_set_leader()
session_set_leader() may fail. If it fails, then manager_start_scope()
will trigger assertion.

This may be related to RHBZ#1663704.
2019-02-15 11:29:34 +01:00
Lennart Poettering 068625569a
Merge pull request #11718 from yuwata/news-v241
Update NEWS
2019-02-15 11:27:17 +01:00
Yu Watanabe 308ae89c9b test-network: add tests for wildcards in networkctl 2019-02-15 13:54:28 +09:00
Yu Watanabe f3eeecf42e man: network: replace LINK -> PATTERN 2019-02-15 13:47:53 +09:00
Yu Watanabe a696290474 networkctl: accept wildcards to specify links
Closes #10840.
2019-02-15 13:47:48 +09:00
Yu Watanabe ecebd1ecf8 NEWS: add entry about 'udevadm trigger --wait-daemon' 2019-02-15 10:18:14 +09:00
Yu Watanabe 36d28ebc04 NEWS: fix release date 2019-02-15 10:15:55 +09:00
Filipe Brandenburger 527ede0c63 core: downgrade CPUQuotaPeriodSec= clamping logs to debug
After the first warning log, further messages are downgraded to LOG_DEBUG.
2019-02-14 11:04:42 -08:00
Filipe Brandenburger 10f2864111 core: add CPUQuotaPeriodSec=
This new setting allows configuration of CFS period on the CPU cgroup, instead
of using a hardcoded default of 100ms.

Tested:
- Legacy cgroup + Unified cgroup
- systemctl set-property
- systemctl show
- Confirmed that the cgroup settings (such as cpu.cfs_period_ns) were set
  appropriately, including updating the CPU quota (cpu.cfs_quota_ns) when
  CPUQuotaPeriodSec= is updated.
- Checked that clamping works properly when either period or (quota * period)
  are below the resolution of 1ms, or if period is above the max of 1s.
2019-02-14 11:04:42 -08:00
Filipe Brandenburger 7b61ce3c44 time-util: Introduce parse_sec_def_infinity
This works like parse_sec() but defaults to USEC_INFINITY when passed an
empty string or only whitespace.

Also introduce config_parse_sec_def_infinity, which can be used to parse
config options using this function.

This is useful for time options that use "infinity" for default and that
can be reset by unsetting them.

Introduce a test case to ensure it works as expected.
2019-02-14 11:04:42 -08:00
Tom Yan d0fe45cb15 mount: remove unused mount_is_auto and mount_is_automount 2019-02-15 00:16:54 +08:00
Tom Yan 142b8142d7 mount/generators: do not make unit wanted by its device unit
As device units will be reloaded by systemd whenever the corresponding device generates a "changed" event, if the mount unit / cryptsetup service is wanted by its device unit, the former can be restarted by systemd unexpectedly after the user stopped them explicitly. It is not sensible at all and can be considered dangerous. Neither is the behaviour conventional (as `auto` in fstab should only affect behaviour on boot and `mount -a`) or ever documented at all (not even in systemd, see systemd.mount(5) and crypttab(5)).
2019-02-15 00:16:54 +08:00
Susant Sahani 24433ffa6d Add to fuzzer 2019-02-14 21:10:59 +05:30
Susant Sahani 062c2eea3a networkd: ipv6ra allow to ignore addresses
Allows to ignore prefixes.

```
UseAutonomousPrefix=
UseOnLinkPrefix=
```

closes #9582
2019-02-14 21:05:17 +05:30
Evgeny Vereshchagin 93e4163e91 Revert "README: remove Coverity Scan badge"
This reverts commit 49a881e514.
2019-02-14 12:13:55 +01:00
Zbigniew Jędrzejewski-Szmek e62a7fea75
Merge pull request #11714 from poettering/final-news-241
final preps for v241
2019-02-14 11:11:58 +01:00
Lennart Poettering a641bcb131 update hwdb 2019-02-14 11:03:06 +01:00
Lennart Poettering d0f7174963 NEWS: update for final v241 2019-02-14 10:58:06 +01:00
Lennart Poettering 6d586a1371 sd-bus: if we receive an invalid dbus message, ignore and proceeed
dbus-daemon might have a slightly different idea of what a valid msg is
than us (for example regarding valid msg and field sizes). Let's hence
try to proceed if we can and thus drop messages rather than fail the
connection if we fail to validate a message.

Hopefully the differences in what is considered valid are not visible
for real-life usecases, but are specific to exploit attempts only.
2019-02-14 10:27:37 +01:00