1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-10 01:17:44 +03:00
Commit Graph

40537 Commits

Author SHA1 Message Date
Anita Zhang
f66ad46066 nspawn: don't hard fail when setting capabilities
The OCI changes in #9762 broke a use case in which we use nspawn from
inside a container that has dropped capabilities from the bounding set
that nspawn expected to retain. In an attempt to keep OCI compliance
and support our use case, I made hard failing on setting capabilities
not in the bounding set optional (hard fail if using OCI and log only
if using nspawn cmdline).

Fixes #12539
2019-06-20 21:46:36 +02:00
Yu Watanabe
a5a4dfa1bc
Merge pull request #12846 from poettering/cap-last-cap-fix
cap_last_cap() off by one fixes
2019-06-21 03:31:49 +09:00
Lennart Poettering
1e59b5455e bpf: use more TAKE_FD() 2019-06-21 03:28:24 +09:00
Lennart Poettering
3972004297 bus-creds: fix size calculation for storing caps data
This is a bit confusing, hence let's at an example comment.
2019-06-20 14:55:30 +02:00
Lennart Poettering
4a33a02e99 capability: fix loops for cap_last_cap()
cap_last_cap() returns the last valid cap (instead of the number of
valid caps). to iterate through all known caps we hence need to use a <=
check, and not a < check like for all other cases. We got this right
usually, but in three cases we did not.
2019-06-20 14:55:24 +02:00
Topi Miettinen
9af2820694 units: deny access to block devices
While the need for access to character devices can be tricky to determine for
the general case, it's obvious that most of our services have no need to access
block devices. For logind and timedated this can be tightened further.
2019-06-20 14:03:57 +02:00
Lennart Poettering
762267cdc1
Merge pull request #12762 from yuwata/network-introduce-carrier-and-network-state-12752
network: introduce carrier and address state to fix network_is_online()
2019-06-20 13:36:30 +02:00
Lennart Poettering
64ef83139c
Merge pull request #12837 from yuwata/tree-wide-lgtm-fixes
tree-wide: fix issues found by lgtm
2019-06-20 12:35:34 +02:00
Donald Buczek
0219b3524f cgroup: Continue unit reset if cgroup is busy
When part of the cgroup hierarchy cannot be deleted (e.g. because there
are still processes in it), do not exit unit_prune_cgroup early, but
continue so that u->cgroup_realized is reset.

Log the known case of non-empty cgroups at debug level and other errors
at warning level.

Fixes https://github.com/systemd/systemd/issues/12386
2019-06-20 10:16:53 +02:00
Yu Watanabe
b19eab1f74
Merge pull request #12806 from yuwata/networkctl-ethtool-12657
networkctl: show speed, duplex, auto negotiation, and port
2019-06-20 06:56:37 +09:00
Yu Watanabe
31a9be2372 util: use extract_first_word() instead of strsep() 2019-06-20 06:51:34 +09:00
Yu Watanabe
fe2e4b6961 tree-wide: use htobe{32,16}() instead of hton{l,s}() 2019-06-20 06:34:05 +09:00
Yu Watanabe
6d946490ba tree-wide: drop alloca() in loop 2019-06-20 06:29:19 +09:00
Yu Watanabe
c967d2c7ce networkctl: show link speed, duplex, auto negotiation, and port 2019-06-20 04:42:55 +09:00
Yu Watanabe
42a63431d3 network: change type of BitRates= bus property 2019-06-19 23:15:19 +09:00
Yu Watanabe
9ff27e6413 table: introduce FORMAT_BPS type 2019-06-19 23:15:19 +09:00
Yu Watanabe
049025a415 test: add tests for format_bytes() 2019-06-19 23:15:19 +09:00
Yu Watanabe
b7de125bba util: make format_bytes() support e.g. 3.0E 2019-06-19 23:15:19 +09:00
Yu Watanabe
aa89266900 util: introduce format_bytes_full()
And move it into format-util.c.
2019-06-19 23:15:19 +09:00
Yu Watanabe
33a8695fdc ethtool-util: introduce ethtool_get_link_info()
Will be used in later commits.
2019-06-19 23:15:19 +09:00
Yu Watanabe
7864b16b27 ethtool-util: make ethtool_connect() warn on failure 2019-06-19 23:15:19 +09:00
Yu Watanabe
b9bc7d42e3 ethtool-util: use structured initializers 2019-06-19 23:15:13 +09:00
Frantisek Sumsal
f9dc94408d sd-resolve: suppress false positive MSan warnings
MSan dislikes structured initializers for nested structures.
2019-06-19 15:48:36 +02:00
Zbigniew Jędrzejewski-Szmek
23ebb4dda9
Merge pull request #12828 from yuwata/network-routing-policy-rule-add-missing-entries
network: add missing entries in routing_policy_rule_{hash,compare}_func()
2019-06-19 15:25:31 +02:00
Lennart Poettering
43786739bf
Merge pull request #12815 from irtimmer/dot-strict
resolved: strict mode for DNS-over-TLS
2019-06-19 14:56:36 +02:00
Yu Watanabe
b80a511b1b network: add missing entries in routing_policy_rule_{hash,compare}_func()
This also makes routing_policy_rule_get() or friends take
a RoutingPolicyRule object as an input.
2019-06-19 21:10:07 +09:00
Yu Watanabe
f3f0d873e2 util: introduce siphash24_compress_boolean() 2019-06-19 21:03:16 +09:00
Iwan Timmer
9c0624dcdb resolved: support TLS 1.3 when using GnuTLS for DNS-over-TLS 2019-06-19 13:10:44 +02:00
Iwan Timmer
4310bfc20b resolved: add strict mode for DNS-over-TLS
Add strict mode for DNS-over-TLS, which will require TLS support from the server. Closes #10755
2019-06-19 13:10:44 +02:00
Iwan Timmer
aedf00a2bd resolved: don't require check when importing resolved-dnstls.h 2019-06-19 13:10:44 +02:00
Lennart Poettering
a4eb991831
Merge pull request #12829 from yuwata/dhcp-memdup_suffix0
sd-bus,dhcp: use memdup_suffix0() instead of strndup()
2019-06-19 09:00:52 +02:00
Yu Watanabe
bccd916292 sd-bus: use memdup_suffix0() instead of strndup() 2019-06-19 14:29:00 +09:00
Yu Watanabe
79cd22d6f3 dhcp: use memdup_suffix0() instead of strndup() 2019-06-19 14:15:42 +09:00
Yu Watanabe
a057135bce
Merge pull request #12822 from poettering/tmpfiles-is-mount-point
tmpfiles: use common fd_is_mount_point() implementation
2019-06-19 11:11:06 +09:00
Yu Watanabe
5c2316c605 ethtool-util: move from src/udev/net/ to src/shared/ 2019-06-19 09:03:50 +09:00
Lennart Poettering
d9adc8a863 journald: use memdup_suffix0() when copying string from potentially binary data
Fixes: #12484
2019-06-18 20:53:46 +03:00
Iwan Timmer
71a681ae50 resolved: add missing error code check when initializing DNS-over-TLS 2019-06-18 19:16:36 +02:00
Iwan Timmer
e22c5b2064 resolved: move TLS data shared by all servers to manager
Instead of having a context and/or trusted CA list per server this is now moved to the server. Ensures future TLS configuration options are global instead of per server.
2019-06-18 19:16:36 +02:00
Markus Felten
1faba68fd7 fix(journal-gatewayd): use relative urls (not starting with '/')
if journal-gatewayd http is not mounted at '/' (proxy request)
the request lose their initial path component
2019-06-18 17:06:12 +02:00
Frantisek Sumsal
31c9d74d50 hashmap: avoid using TLS in a destructor
Using C11 thread-local storage in destructors causes uninitialized
read. Let's avoid that using a direct comparison instead of using
the cached values. As this code path is taken only when compiled
with -DVALGRIND=1, the performance cost shouldn't matter too much.

Fixes #12814
2019-06-18 13:59:12 +02:00
Lennart Poettering
59da64738b
Merge pull request #12758 from fbuihuu/nspawn-console-tty
Create nspawn console tty in the child
2019-06-18 13:17:14 +02:00
Lennart Poettering
60bdc0ca22 tmpfiles: use common fd_is_mount_point() implementation in tmpfiles.c
No need to have a private reimplementation here. Let's just use the
common one, which supports "fdinfo" as fallback.
2019-06-18 12:42:30 +02:00
Lennart Poettering
20b6bb9560 tmpfiles: merge two nested if checks into one 2019-06-18 12:41:31 +02:00
Lennart Poettering
113ed3be37 tmpfiles: use path_join() where we can 2019-06-18 12:41:02 +02:00
Yu Watanabe
3d9f670783 dhcp: fix comparison with previous lease
Follow-up for f8862395e8.

Fixes #12816.
2019-06-18 10:27:59 +02:00
Franck Bui
dc98caea32 nspawn: make use of openpt_allocate() 2019-06-18 09:27:06 +02:00
Franck Bui
ae1d13db05 terminal-util: introduce openpt_allocate()
Allocating a pty is done in a couple of places so let's introduce a new helper
which does the job.

Also the new function, as well as openpt_in_namespace(), returns both pty
master and slave so the callers don't need to know about the pty slave
allocation details.

For the same reasons machine_openpt() prototype has also been changed to return
both pty master and slave so callers don't need to allocate a pty slave which
might be in a different namespace.

Finally openpt_in_namespace() has been renamed into
openpt_allocate_in_namespace().
2019-06-18 09:26:31 +02:00
Zbigniew Jędrzejewski-Szmek
0ef67b7376
Merge pull request #12805 from yuwata/test-network-cleanups
test: further test-network cleanups
2019-06-18 08:57:26 +02:00
Franck Bui
3acc84ebd9 nspawn: allocate the pty used for /dev/console within the container
The console tty is now allocated from within the container so it's not
necessary anymore to allocate it from the host and bind mount the pty slave
into the container. The pty master is sent to the host.

/dev/console is now a symlink pointing to the pty slave.

This might also be less confusing for applications running inside the container
and the overall result looks cleaner (we don't need to apply manually the
passed selinux context, if any, to the allocated pty for instance).
2019-06-18 08:17:34 +02:00
Franck Bui
ba72801d66 nspawn: use correct error variable when logging errors returned by send_one_fd() 2019-06-18 07:54:51 +02:00