Commit graph

39725 commits

Author SHA1 Message Date
Piotr Drąg 4b198b2a44 catalog: update Polish translation 2019-04-23 14:43:47 +02:00
Jiri Pirko eaa9d507d8 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>
2019-04-23 14:01:00 +02:00
Marc-André Lureau 0fde5a3591 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>
2019-04-23 13:00:21 +02:00
Zbigniew Jędrzejewski-Szmek dff9e25a76 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.
2019-04-23 12:23:15 +02:00
Zbigniew Jędrzejewski-Szmek 2abda6d1e4 sd-bus: use _cleanup_ for struct introspect 2019-04-23 12:23:15 +02:00
Zbigniew Jędrzejewski-Szmek 2caef9fba4 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.
2019-04-23 12:23:15 +02:00
Zbigniew Jędrzejewski-Szmek 8dd8a286d1 sd-bus: add symbol to tell linker that new vtable functions are used
In 856ad2a86b 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.

856ad2a86b 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.
2019-04-23 12:23:12 +02:00
Chris Down 6610200d29
Merge pull request #12336 from anitazha/disablecontroller
core: support DisableControllers= for transient units
2019-04-23 10:42:37 +02:00
Anita Zhang 25cc30c4c8 core: support DisableControllers= for transient units 2019-04-22 11:52:08 -07:00
Lennart Poettering 6cdc62aa97 udev: whitespace fix 2019-04-18 15:18:12 +02:00
Lennart Poettering 5b116c37e1 test: add test for flush_accept()
Fixes: #12335
2019-04-18 15:18:12 +02:00
Lennart Poettering f3d75364fb 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.
2019-04-18 15:18:12 +02:00
Yu Watanabe 0beb9542e9 network: logs link state change 2019-04-17 19:41:50 +09:00
Yu Watanabe 528fcf8d1d bootspec: fix build when EFI support is disabled
Follow-up for ce4c4f8108.
2019-04-17 11:20:04 +02:00
Chris Down 7ad5439e06 unit: Add DefaultMemoryMin 2019-04-16 18:45:04 +01:00
Chris Down 6264b85e92 cgroup: Create UNIT_DEFINE_ANCESTOR_MEMORY_LOOKUP
This is in preparation for creating unit_get_ancestor_memory_min.
2019-04-16 18:39:51 +01:00
Yu Watanabe ac9b17271f 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.
2019-04-16 10:27:01 +02:00
David Art ec8181d1c5 hwdb: Add Medion Akoya E3216 MD60900 (#12323)
Fixes: #12312
2019-04-16 10:23:28 +02:00
Frantisek Sumsal 772f15c1d8 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.
2019-04-15 13:59:27 +02:00
Lennart Poettering 4d48eabf37
Merge pull request #12305 from yuwata/import-more-headers-from-kernel-5-0
linux: import more headers from kernel-5.0
2019-04-15 11:33:06 +02:00
Lennart Poettering 929b02b5b8
Merge pull request #12301 from keszybz/silence-alignment-warning
Silence alignment warning
2019-04-15 11:21:15 +02:00
Lennart Poettering a4009bee4a
Merge pull request #12311 from yuwata/timeout_abort_set-change-bool
core: several follow-ups for timeout PR #11211
2019-04-15 11:14:18 +02:00
Florian Dollinger 5a1ee07302 Check for final assignments in RUN keys (#12309)
As described in #12291
2019-04-15 15:59:36 +09:00
Benjamin Robin c424bed180 basic/fileio: Fix memory leak if READ_FULL_FILE_SECURE flag is used
The memory leak introduced in #12223 (15f8f02)
2019-04-15 13:54:19 +09:00
Florian Dollinger 967de8face Document (final) assignment on the RUN (#12310)
As described in #12291, final assignments and assignments are clearing both command types.
2019-04-14 21:26:39 +09:00
Yu Watanabe dcab85be18 core: do not show TimeoutStopSec= in dump message if it is not set 2019-04-14 20:47:13 +09:00
Yu Watanabe 9c79f0e0a0 core: add assertion in two inline functions 2019-04-14 20:46:24 +09:00
Yu Watanabe 3bf0cb65f5 core: use BUS_DEFINE_PROPERTY_GET() macro at more places 2019-04-14 20:45:31 +09:00
Yu Watanabe 54c1a6ab8c core: change type of Service::timeout_abort_set to bool
Follow-up for dc653bf487 (#11211).
2019-04-14 20:13:47 +09:00
Yu Watanabe aa81290495 linux: also import l2tp.h from kernel-5.0
The L2TP_ATTR_UDP_ZERO_CSUM6_{TX,RX} attributes are introduced by
6b649feafe10b293f4bd5a74aca95faf625ae525, which is included in
kernel-3.16. To support older kernel, let's import the header.

Fixes #12300.
2019-04-13 22:51:05 +09:00
Yu Watanabe 7057b6144f linux: also import linux/in.h and in6.h from kernel-5.0
Now linux/in.h has better conflict detection with glibc's
netinet/in.h. So, let's import the headers.

Note that our code already have many workarounds for the conflict,
but in this commit does not drop them. Let's do that in the later
commits if this really helps.
2019-04-13 22:44:21 +09:00
Yu Watanabe 76566792e3 linux: move netdevice.h from shared/linux to basic/linux
As the header linux/if_arp.h includes linux/netdevice.h.
2019-04-13 22:43:59 +09:00
Yu Watanabe d90a044f49
Merge pull request #12288 from yuwata/resolve-bond-rafactoring
resolve,network: tiny cleanups
2019-04-13 22:43:21 +09:00
Franck Bui 63f28cad3e tmpfiles: split tmp.conf out
tmp.conf was dealing with 2 different kind of paths: one dealing with general
temporary paths such as /var/tmp and /tmp and the other one dealing with
temporary directories owned by systemd.

If for example a user wants to adjust the age argument of the general paths
only, he had to overload the whole file which is cumbersome and error prone
since any future changes in tmp.conf shipped by systemd will be lost.

So this patch splits out tmp.conf so the systemd directories are dealt
separately in a dedicated conf file. It's named "systemd-tmp.conf" based on the
naming recommendation made in tmpfiles.d man page.

In practice it shouldn't cause any regression since it's very unlikely that
users override paths owned by systemd.
2019-04-13 12:07:03 +02:00
Dominick Grift 8f1ed04ad6 nspawn: Fix volatile SELinux label
nspawn should associate the specified nspawn container apifs object label instead of the nspawn container process label with the volatile tmpfs
2019-04-13 12:03:02 +02:00
Zbigniew Jędrzejewski-Szmek b48ccda84f sd-netlink: align table 2019-04-13 11:57:42 +02:00
Zbigniew Jędrzejewski-Szmek e61614099f network: avoid warning about unaligned pointers
With gcc-9.0.1-0.10.fc30.x86_64:
../src/network/netdev/macsec.c: In function ‘config_parse_macsec_port’:
../src/network/netdev/macsec.c:584:24: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  584 |                 dest = &c->sci.port;
      |                        ^~~~~~~~~~~~
../src/network/netdev/macsec.c:592:24: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  592 |                 dest = &b->sci.port;
      |                        ^~~~~~~~~~~~

(The alignment was probably OK, but it's nicer to avoid the warning anyway.)
2019-04-13 11:55:04 +02:00
Yu Watanabe cc83684947
Merge pull request #12296 from poettering/coding-style-sections
split CODING_STYLE document into multiple thematic sections
2019-04-13 18:23:13 +09:00
Yu Watanabe eeda619a1e
Merge pull request #12290 from poettering/json-foreach-love
some small JSON foreach macro love
2019-04-13 18:19:38 +09:00
Yu Watanabe c12e138f21
Merge pull request #12293 from poettering/tiny-journal-modernizations
four simple journal modernizations
2019-04-13 18:19:15 +09:00
Yu Watanabe 3e8afae5b5 network: re-indent conf parser and wrap long lines in bond.c 2019-04-13 17:52:00 +09:00
Yu Watanabe 674c96fc44 network: use OrderedSet for bond ARP ip targets 2019-04-13 17:52:00 +09:00
Yu Watanabe 45f735815e ordered-set: add missing ordered_set_size() 2019-04-13 17:52:00 +09:00
Yu Watanabe 1e2a490e91 network: drop allocation for Bond::ad_actor_system 2019-04-13 17:51:59 +09:00
Yu Watanabe f200093337 network: drop bond_mode_to_kernel() and bond_xmit_hash_policy_to_kernel() 2019-04-13 17:51:59 +09:00
Yu Watanabe ae695a9eda arp-util: use net/ethernet.h instead of netinet/if_ether.h
The header net/ethernet.h is used at all other places where
'struct ether_addr' is required.
2019-04-13 17:51:59 +09:00
Yu Watanabe 603192b2e8 resolve: use log_link_*() macro 2019-04-13 17:51:59 +09:00
Yu Watanabe 6ff79f7640 resolve: rename Link.name -> Link.ifname
This also changes the type from char[IF_NAMESIZE] to char*.
By changing the type, now resolved-link.h can drop the dependency to
the header net/if.h.
2019-04-13 17:51:59 +09:00
Jan Klötzke dc653bf487 service: handle abort stops with dedicated timeout
When shooting down a service with SIGABRT the user might want to have a
much longer stop timeout than on regular stops/shutdowns. Especially in
the face of short stop timeouts the time might not be sufficient to
write huge core dumps before the service is killed.

This commit adds a dedicated (Default)TimeoutAbortSec= timer that is
used when stopping a service via SIGABRT. In all other cases the
existing TimeoutStopSec= is used. The timer value is unset by default
to skip the special handling and use TimeoutStopSec= for state
'stop-watchdog' to keep the old behaviour.

If the service is in state 'stop-watchdog' and the service should be
stopped explicitly we still go to 'stop-sigterm' and re-apply the usual
TimeoutStopSec= timeout.
2019-04-12 17:32:52 +02:00
Sebastian Jennen 1ace223ca7 code style format: clang-format applied to src/a*/*
[zj: this is a subset of changes generated by clang-format, just the ones
  I think improve readability or consistency.]

This is a part of https://github.com/systemd/systemd/pull/11811.
2019-04-12 17:26:33 +02:00