Yu Watanabe [Fri, 3 May 2019 04:08:55 +0000 (06:08 +0200)]
test-network: add tests for BridgeFDB.Destination=
Susant Sahani [Tue, 30 Apr 2019 09:23:39 +0000 (14:53 +0530)]
networkd: Add support to configure destination address for bridge FDB
Closes #5145.
Example conf:
```
[Match]
Name=vxlan1309
[BridgeFDB]
MACAddress=00:00:00:00:00:00
Destination=10.0.0.2
[BridgeFDB]
MACAddress=00:00:00:00:00:00
Destination=10.0.0.4
[BridgeFDB]
MACAddress=00:00:00:00:00:00
Destination=10.0.0.5
```
Susant Sahani [Tue, 30 Apr 2019 07:36:10 +0000 (13:06 +0530)]
netword: fdb fix coding style
Lennart Poettering [Mon, 29 Apr 2019 19:34:42 +0000 (21:34 +0200)]
Merge pull request #12428 from jwrdegoede/hwdb-logitech-kbds
Hwdb: Add key-mappings for various wireless Logitech keyboards
Yuri Chornoivan [Mon, 29 Apr 2019 16:06:16 +0000 (19:06 +0300)]
Update Ukrainian translation
Lennart Poettering [Mon, 29 Apr 2019 17:07:24 +0000 (19:07 +0200)]
Merge pull request #12414 from keszybz/detect-podman
Detect podman as separate container type
Susant Sahani [Mon, 29 Apr 2019 05:02:34 +0000 (10:32 +0530)]
networkd: Add back static routes after DHCPv4 lease expires.
1. When the DHCPv4 lease expires kernel removes the route. So add it back
when we gain lease again.
Closes https://github.com/systemd/systemd/issues/12426
2. When UseRoutes=false do not remove router
Hans de Goede [Mon, 22 Apr 2019 07:15:40 +0000 (09:15 +0200)]
hwdb: Fix F12 mapping on the Logitech Internet Navigator
Many Logitech keyboards have the following special functions on F9-F12:
F9: file-browser F10: document-browser F11: image-browser F12:
music-browser. These should be bound to:
#define KEY_FILE 144 /* AL Local Machine Browser */
#define KEY_DOCUMENTS 235
#define KEY_IMAGES 0x1ba /* AL Image Browser */
#define KEY_AUDIO 0x188 /* AL Audio Browser */
This commit fixes the wrong binding of F12 to KEY_SOUND (which
translates to XF86AudioPreset) and removes the ?? comments from
both F11 and F12.
Hans de Goede [Sun, 28 Apr 2019 19:21:00 +0000 (21:21 +0200)]
hwdb: Add key mappings for Logitech MX5500 keyboard
Add support for various custom key-codes emitted by the Logitech MX5500
keyboard, both when attached through its Bluetooth-receiver in USB-HID
proxy mode; and when connected as a Bluetooth device.
Hans de Goede [Tue, 2 Apr 2019 15:23:12 +0000 (17:23 +0200)]
hwdb: Add key mappings for Logitech MX5000 keyboard
Add support for various custom key-codes emitted by the Logitech MX5000
keyboard, both when attached through its Bluetooth-receiver in USB-HID
proxy mode; and when connected as a Bluetooth device.
Hans de Goede [Fri, 5 Apr 2019 12:47:04 +0000 (14:47 +0200)]
hwdb: Add key mappings for Logitech 27 MHz S520 keyboard
The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.
This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the S520 keyboard
(modelnumber Y-RBA97).
Hans de Goede [Fri, 5 Apr 2019 14:18:03 +0000 (16:18 +0200)]
hwdb: Add key mappings for Logitech 27 MHz EX100 keyboard
The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.
This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the EX100 keyboard
(modelnumber Y-RBH94).
Hans de Goede [Thu, 4 Apr 2019 22:40:40 +0000 (00:40 +0200)]
hwdb: Add key mappings for Logitech 27 MHz MX3200 keyboard
The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.
This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the MX3200 keyboard
(modelnumber Y-RAV80).
Hans de Goede [Wed, 3 Apr 2019 20:52:06 +0000 (22:52 +0200)]
hwdb: Add key mappings for Logitech 27 MHz MX3000 keyboard
The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.
This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the MX3000 keyboard
(modelnumber Y-RAM74).
Hans de Goede [Fri, 29 Mar 2019 22:42:56 +0000 (23:42 +0100)]
hwdb: Add key mappings for Logitech 27 MHz "Cordless Rechargeable Desktop" keyboard
The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.
This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the "Logitech Rechargeable
Desktop" keyboard (modelnumber Y-RK49).
Hans de Goede [Fri, 22 Mar 2019 21:10:32 +0000 (22:10 +0100)]
hwdb: Add key mappings for Logitech 27 MHz "Cordless Access Keyboard"
The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.
This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the "Logitech Cordless
Access Keyboard" (modelnumber Y-RH35).
Hans de Goede [Thu, 4 Apr 2019 20:39:24 +0000 (22:39 +0200)]
hwdb: Add generic key mapping for Logitech 27 MHz keyboards
The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.
This will allow us to add per model keymappings for the special keys on
these keyboards, which may differ per model.
This commit adds a default / fallback mapping, assigning the most common
meaning of the custom Logitech c10XX keycodes.
Lennart Poettering [Mon, 29 Apr 2019 14:10:51 +0000 (16:10 +0200)]
units: drop reference to sushell man page
sushell was a Fedoraism, and has been removed since. Hence our upstream
unit files shouldn't reference it either.
Ben Boeckel [Sat, 27 Apr 2019 00:22:40 +0000 (20:22 -0400)]
codespell: fix spelling errors
Zbigniew Jędrzejewski-Szmek [Fri, 26 Apr 2019 12:13:53 +0000 (14:13 +0200)]
basic/virt: treat "podman" as separate container type
We would detect podman as container-other. Let's assign a name to it.
Inspired by https://github.com/containers/libpod/issues/2996.
Zbigniew Jędrzejewski-Szmek [Fri, 26 Apr 2019 11:37:31 +0000 (13:37 +0200)]
basic/virt: try the /proc/1/sched hack also for PID1
If a container manager does not set $container, we could end up
in a strange situation when detect-virt returns container-other when
run as non-pid-1 and none when run as pid-1.
Yu Watanabe [Sun, 28 Apr 2019 07:06:13 +0000 (09:06 +0200)]
network: drop invalid assertion
The link may not have corresponding .network file.
Note that in that case, link_ipv4ll_enabled() and link_dhcp4_enabled()
returns false. So, it is safe to drop the assertion.
Fixes #12422.
Lennart Poettering [Sun, 28 Apr 2019 15:43:54 +0000 (17:43 +0200)]
Merge pull request #12322 from ljmf00/hwdb-accel-location-patch
Add support for ACCEL_LOCATION udev property to deal with 2 sensors
Luís Ferreira [Sat, 13 Apr 2019 18:12:51 +0000 (19:12 +0100)]
hwdb: add ACCEL_LOCATION property to parse_hwdb.py
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
Luís Ferreira [Sat, 13 Apr 2019 18:12:45 +0000 (19:12 +0100)]
hwdb: add ACCEL_LOCATION to the allowed properties
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
Lennart Poettering [Fri, 26 Apr 2019 21:43:27 +0000 (23:43 +0200)]
Merge pull request #12407 from keszybz/two-unrelated-cleanups
Two unrelated cleanups
Ben Boeckel [Fri, 26 Apr 2019 19:15:09 +0000 (15:15 -0400)]
nspawn-expose-ports: fix a typo in error message
Yu Watanabe [Wed, 24 Apr 2019 19:52:13 +0000 (21:52 +0200)]
resolve: use bridge or bonding interfaces in degraded-carrier state
Fixes #12285.
Franck Bui [Thu, 25 Apr 2019 05:52:16 +0000 (07:52 +0200)]
sd-bus: bump message queue size again
Simliarly to issue #4068, the current limit turns out to be too small for a
big storage setup that uses many small disks. Let's bump it further.
Franck Bui [Wed, 24 Apr 2019 09:26:42 +0000 (11:26 +0200)]
udevd: notify when max number value of children is reached only once per batch of events
When booting with "udev.log-priority=debug" for example, the output might be
spammed with messages like this:
systemd-udevd[23545]: maximum number (248) of children reached
systemd-udevd[23545]: maximum number (248) of children reached
systemd-udevd[23545]: maximum number (248) of children reached
systemd-udevd[23545]: maximum number (248) of children reached
systemd-udevd[23545]: maximum number (248) of children reached
systemd-udevd[23545]: maximum number (248) of children reached
systemd-udevd[23545]: maximum number (248) of children reached
While the message itself is useful, printing it per batch of events should be
enough.
Zbigniew Jędrzejewski-Szmek [Fri, 26 Apr 2019 06:48:28 +0000 (08:48 +0200)]
Merge pull request #12394 from poettering/oncalendar-tweak
systemd-run --on-calendar= follow-up
Lennart Poettering [Tue, 16 Apr 2019 16:44:12 +0000 (18:44 +0200)]
chown-recursive: also check mode before we bypass
Lennart Poettering [Tue, 8 Jan 2019 17:34:38 +0000 (18:34 +0100)]
json: let's not accept embedded NUL bytes when allocating JSON strings
Let's add an additional paranoia check, and not accept embedded NUL
bytes in strings, just in case.
Lennart Poettering [Tue, 23 Apr 2019 13:26:09 +0000 (15:26 +0200)]
json: make log message more focussed
Frantisek Sumsal [Thu, 25 Apr 2019 18:07:03 +0000 (20:07 +0200)]
bash-completion: accept files for --bind/--bind-ro options
Frantisek Sumsal [Thu, 25 Apr 2019 17:16:06 +0000 (19:16 +0200)]
bash-completion: process only non-template units for systemctl isolate
Frantisek Sumsal [Thu, 25 Apr 2019 17:37:54 +0000 (19:37 +0200)]
bash-completion: don't sort syslog priorities
By default, the available completions are sorted alphabetically, which
is counterproductive in case of syslog priorities. Override the default
behavior using the `nosort` option
Jérémy Rosen [Thu, 25 Apr 2019 22:49:57 +0000 (00:49 +0200)]
Document /etc/initrd-release
When systemd is started, it detects initrd by checking for that file
The usage of that file is not documented anywhere, so mention it early
in the most relevant man-page I could find.
Evgeny Vereshchagin [Thu, 25 Apr 2019 19:17:59 +0000 (22:17 +0300)]
Revert "Revert "README: remove Coverity Scan badge""
This reverts commit
93e4163e912b6895e61c43452a629f30a28eb70c.
Lennart Poettering [Thu, 25 Apr 2019 11:22:55 +0000 (13:22 +0200)]
run: when we determine a timer cannot elapse anymore, really just warn, nothing else
When we determine that a calendar expression cannot elapse anymore,
print a warning but proceed regardless like we normally would.
Quite possibly a remote system has a different understanding of time
(timezone, system clock) than we have, hence we really shouldn't change
behaviour here client side, but log at best, and then leave the decision
what to do to the server side.
Follow-up for #12299
Lennart Poettering [Thu, 25 Apr 2019 11:21:54 +0000 (13:21 +0200)]
calendarspec: make return time value of calendar_spec_next_usec() optional
If noone is interested, there's no reason to return it.
(Also document the ENOENT error code in a comment)
Zbigniew Jędrzejewski-Szmek [Thu, 25 Apr 2019 09:59:37 +0000 (11:59 +0200)]
Merge pull request #12074 from poettering/io-acct
expose IO stats on the bus and in "systemctl status" and "systemd-run --wait"
Frantisek Sumsal [Fri, 12 Apr 2019 18:57:51 +0000 (20:57 +0200)]
run: check if the specified calendar event is not in the past
Check if calendar event specification passed by --on-calendar runs in
some time in the future. If not, execute the given command immediately
Zbigniew Jędrzejewski-Szmek [Thu, 25 Apr 2019 08:41:59 +0000 (10:41 +0200)]
network: drop "return 1" when the return value is ignored by all callers
The reader is tricked into thinking that this has some meaning...
Zbigniew Jędrzejewski-Szmek [Wed, 24 Apr 2019 08:54:44 +0000 (10:54 +0200)]
core: adjust unit_get_ancestor_memory_{low,min}() to work with units which don't have a CGroupContext
Coverity doesn't like the fact that unit_get_cgroup_context() returns NULL for
unit types that don't have a CGroupContext. We don't expect to call those
functions with such unit types, so this isn't an immediate problem, but we can
make things more robust by handling this case.
CID #1400683, #1400684.
Zbigniew Jędrzejewski-Szmek [Thu, 25 Apr 2019 09:06:45 +0000 (11:06 +0200)]
Merge pull request #12332 from cdown/default_min
cgroup: Add support for propagation of memory.min
Dave Ross [Sat, 20 Apr 2019 20:27:22 +0000 (16:27 -0400)]
hwdb: add axis range corrections for the Dell Latitude e7250
Based on touchpad-edge-detector and dimensions confirmed with the owner's manual (https://content.etilize.com/User-Manual/
1037738079.pdf)
Zbigniew Jędrzejewski-Szmek [Thu, 25 Apr 2019 08:55:53 +0000 (10:55 +0200)]
Merge pull request #12382 from yuwata/wireguard-12377
network: fix ListenPort= in [WireGuard] section
Zbigniew Jędrzejewski-Szmek [Thu, 25 Apr 2019 08:54:28 +0000 (10:54 +0200)]
Merge pull request #12316 from yuwata/network-prevent-multiple-initialization-12315
network: prevent interfaces to be initialized multiple times
Yu Watanabe [Mon, 15 Apr 2019 07:38:45 +0000 (16:38 +0900)]
network: fix ref/unref logic for Link object
- bridge or bonding master takes a reference of slave links.
- drop link from bridge or bonding master's slave list when slave link
is removed.
- change type of Link::slaves to Set*,
Fixes #12315.
Yu Watanabe [Mon, 15 Apr 2019 08:34:00 +0000 (17:34 +0900)]
network: prevent interfaces to be initialized multiple times
When a uevent is received during the relevant interface is in
LINK_STATE_PENDING, then the interface may be initialized twice.
To prevent that, this introduces LINK_STATE_INITIALIZED.
Yu Watanabe [Sat, 20 Apr 2019 12:40:24 +0000 (14:40 +0200)]
udev,network: warn when .link or .network file has no [Match] section
Closes #12098.
Yu Watanabe [Wed, 24 Apr 2019 22:39:04 +0000 (00:39 +0200)]
network: fix ListenPort= in [WireGuard] section
This fixes a bug introduced by
f1368a333e5e08575f0b45dfe41e936b106a8627.
Fixes #12377.
Yu Watanabe [Wed, 24 Apr 2019 22:29:20 +0000 (00:29 +0200)]
test-network: fix invalid assertions
Zbigniew Jędrzejewski-Szmek [Wed, 24 Apr 2019 17:45:47 +0000 (19:45 +0200)]
Merge pull request #12376 from mrc0mmand/deal-with-backslashes-in-completion
bash-completion: properly autocomplete escaped unit names
Frantisek Sumsal [Wed, 24 Apr 2019 16:03:30 +0000 (18:03 +0200)]
bash-completion: unify indentation
Frantisek Sumsal [Wed, 24 Apr 2019 12:22:44 +0000 (14:22 +0200)]
bash-completion: properly autocomplete escaped unit names
Paul Menzel [Tue, 23 Apr 2019 15:11:51 +0000 (17:11 +0200)]
NEWS: List getty@tty1.service as not being enabled anymore
Fixes: https://github.com/systemd/systemd/issues/12345
Lennart Poettering [Wed, 24 Apr 2019 08:23:10 +0000 (10:23 +0200)]
Merge pull request #12351 from keszybz/sd-bus-add-symbol
Add symbol to tell the linker that new libsystemd version is needed
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 08:28:38 +0000 (10:28 +0200)]
man: describe interaction with ProtectHome=/InaccessiblePaths= in BindMount=
https://github.com/systemd/systemd/issues/7153#issuecomment-
485252308
Apparently this is still confusing for people.
Longer-term, I think we should just make BindMount= automatically "upgrade"
(or "downgrade", depending on how you look at this), any InaccessiblePath=
mountpoints to "tmpfs". I don't see much point in forcing users to remember
this interaction. But let's at least document the status quo, we can always
update the docs if the code changes.
Jan Klötzke [Wed, 7 Mar 2018 13:16:49 +0000 (14:16 +0100)]
core: immediately trigger watchdog action on WATCHDOG=trigger
A service might be able to detect errors by itself that may require the
system to take the same action as if the service locked up. Add a
WATCHDOG=trigger state change notification to sd_notify() to let the
service manager know about the self-detected misery and instantly
trigger the configured watchdog behaviour.
Lennart Poettering [Wed, 24 Apr 2019 08:15:54 +0000 (10:15 +0200)]
Merge pull request #12366 from lkundrak/lr/olpc-xo-175-keyboard
Add support for OLPC XO-1.75 keyboard
Lennart Poettering [Wed, 24 Apr 2019 08:14:51 +0000 (10:14 +0200)]
Merge pull request #12367 from keszybz/accept-check
Put a limit on the loop to flush connections
Frantisek Sumsal [Wed, 24 Apr 2019 05:52:49 +0000 (07:52 +0200)]
semaphore: merge semaphore scripts to avoid code duplication (#12365)
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 12:09:18 +0000 (14:09 +0200)]
meson: do not use f-strings
Our travis CI still uses python3.5. I'm making this into a separate
commit to make it easy to revert later.
Zbigniew Jędrzejewski-Szmek [Sun, 21 Apr 2019 20:39:30 +0000 (22:39 +0200)]
man: document sd_bus_add_{object,fallback}_vtable
The interface provided by those two functions is huge, so this text could
probably be made two or three times as long if all details were described.
But I think it's a good start.
Zbigniew Jędrzejewski-Szmek [Sun, 21 Apr 2019 20:25:03 +0000 (22:25 +0200)]
sd-bus: when running user find function don't trust the value to be initialized
The find function is externally provided, and we shouldn't trust that the
authors remember to set the output parameter in all cases.
Zbigniew Jędrzejewski-Szmek [Sun, 21 Apr 2019 20:23:45 +0000 (22:23 +0200)]
busctl: add introspect --xml-interface
This wraps the call to org.freedesktop.DBus.Introspectable.Introspect.
Using "busctl call" directly is inconvenient because busctl escapes the
string before printing.
Example:
$ busctl introspect --xml org.freedesktop.systemd1 /org/freedesktop/systemd1 | pygmentize -lxml | less -RF
Zbigniew Jędrzejewski-Szmek [Fri, 19 Apr 2019 11:30:09 +0000 (13:30 +0200)]
test-bus-{vtable,introspect}: share data and test introspect_path()
test-bus-introspect is also applied to the tables from test-bus-vtable.c.
test-bus-vtable.c is also used as C++ sources to produce test-bus-vtable-cc,
and our hashmap headers are not C++ compatible. So let's do the introspection
part only in the C version.
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 13:48:47 +0000 (15:48 +0200)]
Merge pull request #12320 from mrc0mmand/tweak-start-timeout-in-TEST-16-EXTEND-TIMEOUT
test: don't timeout while waiting for other test units
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 13:24:56 +0000 (15:24 +0200)]
basic/socket-util: put a limit on the loop to flush connections
Follow-up for #12346.
Lubomir Rintel [Tue, 23 Apr 2019 13:09:17 +0000 (15:09 +0200)]
hwdb: Fix the key codes of the OLPC XO button pad
These are not on a key pad. These codes are sent by the "rocker" buttons
that resemble a game pad.
Lubomir Rintel [Tue, 23 Apr 2019 13:09:04 +0000 (15:09 +0200)]
hwdb: Fix the OLPC XO rotate key
The comment is incorrect -- this key code is sent by the rotate button,
the brightness keys are separate.
Lubomir Rintel [Tue, 23 Apr 2019 13:08:53 +0000 (15:08 +0200)]
hwdb: No LEDs on the OLPC XO keyboard
Lubomir Rintel [Tue, 23 Apr 2019 13:05:28 +0000 (15:05 +0200)]
hwdb: Make the OLPC XO rules also match XO-1.75
Uses the same keyboard, attached to the "Security Processor" P1J core
that bit-bangs the PS/2 keyboard protocol.
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 13:11:08 +0000 (15:11 +0200)]
basic/socket-util: fix typo and reword comment
Comment bike-shedding might be the ultimate form of procrastination, but
I can't stop myself. :)
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 13:03:29 +0000 (15:03 +0200)]
Merge pull request #12346 from poettering/accept-flush
socket-util: make sure accept_flush() doesn't hang on EOPNOTSUPP
Piotr Drąg [Sat, 20 Apr 2019 16:30:20 +0000 (18:30 +0200)]
catalog: update Polish translation
Jiri Pirko [Mon, 15 Apr 2019 18:34:44 +0000 (20:34 +0200)]
udev: net_id: introduce predictable names for netdevsim
In order to properly and predictably name netdevsim netdevices,
introduce a separate implementation, as the netdevices reside on a
specific netdevsim bus. Note that this applies only to netdevsim devices
created using sysfs, because those expose phys_port_name attribute.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Marc-André Lureau [Thu, 18 Apr 2019 14:30:41 +0000 (16:30 +0200)]
udev-rules: add udmabuf to kvm group
It will have the default 0660 mode.
Fixes: #12283
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Zbigniew Jędrzejewski-Szmek [Fri, 19 Apr 2019 10:14:35 +0000 (12:14 +0200)]
sd-bus: split introspection into the content creation and reply creation parts
Just moving code around, in preparation to allow the content creation
part to be used in other places.
On the surface of things, introspect_path() should be in bus-introspect.c, but
introspect_path() uses many static helper functions in bus-objects.c, so moving
it would require all of them to be exposed, which is too much trouble.
test-bus-introspect is updated to actually write the closing bracket.
Zbigniew Jędrzejewski-Szmek [Fri, 19 Apr 2019 09:28:36 +0000 (11:28 +0200)]
sd-bus: use _cleanup_ for struct introspect
Zbigniew Jędrzejewski-Szmek [Thu, 18 Apr 2019 11:42:25 +0000 (13:42 +0200)]
sd-bus: allow vtable format structure to grow in the future
We would check the size of sd_bus_vtable entries, requring one of the two known
sizes. But we should be able to extend the structure in the future, by adding
new fields, without breaking backwards compatiblity.
Incidentally, this check was what caused -EINVAL failures before, when programs
were compiled with systemd-242 and run with older libsystemd.
Zbigniew Jędrzejewski-Szmek [Thu, 18 Apr 2019 11:06:41 +0000 (13:06 +0200)]
sd-bus: add symbol to tell linker that new vtable functions are used
In
856ad2a86bd9b3e264a090fcf4b0d05bfaa91030 sd_bus_add_object_vtable() and
sd_bus_add_fallback_vtable() were changed to take an updated sd_bus_vtable[]
array with additional 'features' and 'names' fields in the union.
The commit tried to check whether the old or the new table format is used, by
looking at the vtable[0].x.start.element_size field, on the assumption that the
added fields caused the structure size to grow. Unfortunately, this assumption
was false, and on arm32 (at least), the structure size is unchanged.
In libsystemd we use symbol versioning and a major.minor.patch semantic
versioning of the library name (major equals the number in the so-name). When
systemd-242 was released, the minor number was (correctly) bumped, but this is
not enough, because no new symbols were added or symbol versions changed. This
means that programs compiled with the new systemd headers and library could be
successfully linked to older versions of the library. For example rpm only
looks at the so-name and the list of versioned symbols, completely ignoring the
major.minor numbers in the library name. But the older library does not
understand the new vtable format, and would return -EINVAL after failing the
size check (on those architectures where the structure size did change, i.e.
all 64 bit architectures).
To force new libsystemd (with the functions that take the updated
sd_bus_vtable[] format) to be used, let's pull in a dummy symbol from the table
definition. This is a bit wasteful, because a dummy pointer has to be stored,
but the effect is negligible. In particular, the pointer doesn't even change
the size of the structure because if fits in an unused area in the union.
The number stored in the new unsigned integer is not checked anywhere. If the
symbol exists, we already know we have the new version of the library, so an
additional check would not tell us anything.
An alternative would be to make sd_bus_add_{object,fallback}_vtable() versioned
symbols, using .symver linker annotations. We would provide
sd_bus_add_{object,fallback}_vtable@LIBSYSTEMD_221 (for backwards
compatibility) and e.g. sd_bus_add_{object,fallback}_vtable@@LIBSYSTEMD_242
(the default) with the new implementation. This would work too, but is more
work. We would have to version at least those two functions. And it turns out
that the .symver linker instructions have to located in the same compilation
unit as the function being annotated. We first compile libsystemd.a, and then
link it into libsystemd.so and various other targets, including
libsystemd-shared.so, and the nss modules. If the .symver annotations were
placed next to the function definitions (in bus-object.c), they would influence
all targets that link libsystemd.a, and cause problems, because those functions
should not be exported there. To export them only in libsystemd.so, compilation
would have to be rearranged, so that the functions exported in libsystemd.so
would not be present in libsystemd.a, but a separate compilation unit containg
them and the .symver annotations would be linked solely into libsystemd.so.
This is certainly possible, but more work than the approach in this patch.
856ad2a86bd9b3e264a090fcf4b0d05bfaa91030 has one more issue: it relies on the
undefined fields in sd_bus_vtable[] array to be zeros. But the structure
contains a union, and fields of the union do not have to be zero-initalized by
the compiler. This means that potentially, we could have garbarge values there,
for example when reading the old vtable format definition from the new function
implementation. In practice this should not be an issue at all, because vtable
definitions are static data and are placed in the ro-data section, which is
fully initalized, so we know that those undefined areas will be zero. Things
would be different if somebody defined the vtable array on the heap or on the
stack. Let's just document that they should zero-intialize the unused areas
in this case.
The symbol checking code had to be updated because otherwise gcc warns about a
cast from unsigned to a pointer.
Chris Down [Tue, 23 Apr 2019 08:42:37 +0000 (10:42 +0200)]
Merge pull request #12336 from anitazha/disablecontroller
core: support DisableControllers= for transient units
Anita Zhang [Wed, 17 Apr 2019 07:42:55 +0000 (00:42 -0700)]
core: support DisableControllers= for transient units
Lennart Poettering [Thu, 18 Apr 2019 13:17:29 +0000 (15:17 +0200)]
udev: whitespace fix
Lennart Poettering [Thu, 18 Apr 2019 13:16:18 +0000 (15:16 +0200)]
test: add test for flush_accept()
Fixes: #12335
Lennart Poettering [Thu, 18 Apr 2019 13:13:54 +0000 (15:13 +0200)]
socket-util: make sure flush_accept() doesn't hang on unexpected EOPNOTSUPP
So apparently there are two reasons why accept() can return EOPNOTSUPP:
because the socket is not a listening stream socket (or similar), or
because the incoming TCP connection for some reason wasn't acceptable to
the host. THe latter should be a transient error, as suggested on
accept(2). The former however should be considered fatal for
flush_accept(). Let's fix this by explicitly checking whether the socket
is a listening socket beforehand.
Yu Watanabe [Mon, 15 Apr 2019 11:56:01 +0000 (20:56 +0900)]
network: logs link state change
Yu Watanabe [Sat, 13 Apr 2019 17:58:10 +0000 (02:58 +0900)]
bootspec: fix build when EFI support is disabled
Follow-up for
ce4c4f810876b2d6e50041c8bbe089e8a9e2576e.
Chris Down [Tue, 16 Apr 2019 17:44:05 +0000 (18:44 +0100)]
unit: Add DefaultMemoryMin
Chris Down [Tue, 16 Apr 2019 17:14:09 +0000 (18:14 +0100)]
cgroup: Create UNIT_DEFINE_ANCESTOR_MEMORY_LOOKUP
This is in preparation for creating unit_get_ancestor_memory_min.
Yu Watanabe [Mon, 15 Apr 2019 16:57:23 +0000 (01:57 +0900)]
linux: import if_ether.h from kernel-5.0
kernel-4.15's if_ether.h has a bug that the header does not provide
'struct ethhdr'. The bug is introduced by
6926e041a8920c8ec27e4e155efa760aa01551fd (4.15-rc8)
and fixed by
da360299b6734135a5f66d7db458dcc7801c826a (4.16-rc3).
This makes systemd built with kernel-4.15 headers.
Fixes #12319.
David Art [Tue, 16 Apr 2019 08:23:28 +0000 (10:23 +0200)]
hwdb: Add Medion Akoya E3216 MD60900 (#12323)
Fixes: #12312
Frantisek Sumsal [Mon, 15 Apr 2019 11:59:27 +0000 (13:59 +0200)]
test: don't timeout while waiting for other test units
The main testsuite service timeouts sporadically when waiting for
other testsuite-* units. As the test timeout is handled by
the "test executor" (test.sh), let's disable it for the service.
This should (hopefully) fix the test flakiness.
Lennart Poettering [Mon, 15 Apr 2019 09:33:06 +0000 (11:33 +0200)]
Merge pull request #12305 from yuwata/import-more-headers-from-kernel-5-0
linux: import more headers from kernel-5.0
Lennart Poettering [Mon, 15 Apr 2019 09:21:15 +0000 (11:21 +0200)]
Merge pull request #12301 from keszybz/silence-alignment-warning
Silence alignment warning
Lennart Poettering [Mon, 15 Apr 2019 09:14:18 +0000 (11:14 +0200)]
Merge pull request #12311 from yuwata/timeout_abort_set-change-bool
core: several follow-ups for timeout PR #11211
Florian Dollinger [Mon, 15 Apr 2019 06:59:36 +0000 (08:59 +0200)]
Check for final assignments in RUN keys (#12309)
As described in #12291