Commit graph

31792 commits

Author SHA1 Message Date
Lennart Poettering dfd14786b5 util-lib: save/restore errno in cleanup calls
We should be careful with errno in cleanup functions, and not alter it
under any circumstances. In the safe_close cleanup handlers we are
already safe in that regard, but let's add similar protections on other
cleanup handlers that invoke system calls.

Why bother? Cleanup handlers insert code at function return in
non-obvious ways. Hence, code that sets errno and returns should not be
confused by us overrding the errno from a cleanup handler.

This is a paranoia fix only, I am not aware where this actually mattered
in real-life situations.
2018-01-10 17:21:15 +01:00
Lennart Poettering ad5d4b1703 cocci: use strempty() at more places
This shortens the code by a few lines.
2018-01-10 17:11:19 +01:00
Yu Watanabe 68c7139a4b bash-completion: timedatectl: suggests hostname and machine name 2018-01-10 23:21:26 +09:00
Yu Watanabe e352389a02 bash-completion: run: add missing options 2018-01-10 23:21:22 +09:00
Yu Watanabe a953b31a8b man: run: add missing option 2018-01-10 23:21:17 +09:00
Yu Watanabe 14aeb7ce7f bash-completion: resolve: add missing options 2018-01-10 23:20:52 +09:00
Yu Watanabe 86b4188d5e bash-completion: nspawn: add missing options 2018-01-10 23:20:45 +09:00
Yu Watanabe 4deb55036b man: nspawn: add missing option 2018-01-10 23:20:20 +09:00
Yu Watanabe 51bcbb6030 bash-completion: detect-virt: add missing option 2018-01-10 23:19:20 +09:00
Yu Watanabe 82ebb6ba1f bash-completion: cgls: suggests units 2018-01-10 23:19:00 +09:00
Yu Watanabe 7c3940f6ce bash-completion: analyze: add missing options and verbs 2018-01-10 23:18:49 +09:00
Yu Watanabe 035dd8c0a3 bash-completion: systemctl: add missing options and verbs 2018-01-10 23:18:16 +09:00
Yu Watanabe f568dcd101 bash-completion: networkctl: 'list' and 'lldp' can take links 2018-01-10 23:17:41 +09:00
Yu Watanabe 6d92077e39 bash-completion: machinectl: add missing options and verbs 2018-01-10 23:17:32 +09:00
Yu Watanabe ee156e8d88 man: machinectl: fix typo 2018-01-10 23:17:00 +09:00
Yu Watanabe fe56e4ba47 bash-completion: loginctl: add missing options and verbs 2018-01-10 23:16:41 +09:00
Yu Watanabe f822279e62 bash-completion: localectl: add a missing option and verbs 2018-01-10 23:16:36 +09:00
Yu Watanabe 29e08b9e9e bash-completion: kernel-install: update default path to kernel image 2018-01-10 23:16:29 +09:00
Yu Watanabe 41053e9bdf bash-completion: journalctl add missing options
Also, this deprecates '--this-boot' option.
2018-01-10 23:16:14 +09:00
Yu Watanabe afcb2246be bash-completion: hostnamectl: add a missing option 2018-01-10 23:15:45 +09:00
Yu Watanabe 245c1e6802 bash-completion: coredumpctl: support more options 2018-01-10 23:15:21 +09:00
Lennart Poettering 4631116dd9
Merge pull request #7836 from jkloetzke/shutdown-no-coredumps
shutdown: prevent core dumps in final shutdown stage
2018-01-10 15:15:07 +01:00
Lennart Poettering 2de9740c1c
Merge pull request #7837 from yuwata/coverity-20170110
fix defects reported by Coverity Scan
2018-01-10 15:13:07 +01:00
Yu Watanabe cdb8ec2d37 bash-completion: busctl: support more options and verbs 2018-01-10 23:11:00 +09:00
Yu Watanabe 92360836a0 bash-completion: bootctl: support more options and verbs 2018-01-10 23:10:19 +09:00
Yu Watanabe f011fcfdec timesync: fix typo 2018-01-10 20:52:59 +09:00
Yu Watanabe 0a664f1b15 exec-util: cast to void when return value is ignored
CID 1384262.
2018-01-10 20:52:55 +09:00
Yu Watanabe 78e2f089fd test: free after use
CID 1384238.
2018-01-10 20:52:51 +09:00
Yu Watanabe a41f6217ba process-util: initialize block_signals
CID 1384240.
2018-01-10 20:52:46 +09:00
Hans-Christian Noren Egtvedt 8a2b193a55 sd-radv: avoid redefinition of struct in6_addr
Both netinet/icmp6.h and linux/in6.h will define struct in6_addr, and in
user space we want to use the netinet/icmp6.h variant.

Fixes build problem:
In file included from src/libsystemd-network/sd-radv.c:23:0:
/home/hegtvedt/work/os/product/sunrise/root/_build/v2/include/linux/in6.h:30:8:
error: redefinition of 'struct in6_addr'
2018-01-10 12:32:03 +01:00
Hans-Christian Noren Egtvedt d07ba5d790 missing: add bpf() define for ARM definition 2018-01-10 12:31:39 +01:00
Zbigniew Jędrzejewski-Szmek edd50d5e24 timesyncd: avoid signed/unsigned comparison (#7842)
be32toh() returns uint32_t, and m->trans_time.tv_nsec is defined as long in struct timespec.
Let's add a cast to avoid the warning.

Fixes #7789.
2018-01-10 11:35:00 +01:00
Hans-Christian Noren Egtvedt 66ffb275fa missing: fix bpf() define for Tilera
__NR_bpf syscall uses the default generic value for Tilera, e.g. 280.
2018-01-10 10:59:01 +01:00
Jan Klötzke 27b372c1c2 shutdown: prevent core dumps in final shutdown stage
If the system is finally shutting down it makes no sense to write core
dumps as the last remaining processes are terminated / killed. This is
especially significant in case of a "force reboot" where all processes
are hit concurrently with a SIGTERM and no orderly shutdown of
processes takes place.
2018-01-10 10:54:40 +01:00
Jan Klötzke 9ce1759311 tree-wide: introduce disable_core_dumps helper and port existing users
Changes the core_pattern to prevent any core dumps by the kernel. Does
nothing if we're in a container environment as this is system wide
setting.
2018-01-10 10:54:40 +01:00
Ewout van Mansom 05da675a5a hwdb: Add workaround for backslash hardware issue in Purism Librem 13 V2 (#7826) 2018-01-09 16:42:54 +01:00
Zbigniew Jędrzejewski-Szmek 2269954112 Merge pull request #7191 from Mic92/systemd
The change in netdev.c done in the merge is necessary to avoid crashing in
cleanup. This is a follow-up for f3c33b234d.
2018-01-09 14:35:54 +01:00
Jörg Thalheim e5719363f5 networkd: add support for wireguard interface type
More information may be found at wireguard.com.
2018-01-09 14:00:49 +01:00
Jörg Thalheim 05d0c2e3cf sd-netlink: add generic netlink support
This also adds the ability to incorporate arrays into netlink messages
and to determine when a netlink message is too big, used by some generic
netlink protocols.
2018-01-09 14:00:49 +01:00
Susant Sahani 27c34f732e networkd: call link_set_routing_policy_rule before setting routes (#7815)
commit 7715629 (networkd: Fix race condition in [RoutingPolicyRule] handling (#7615)).
Does not fix race. Still there is a race in case of bride because the
bride goes down and up .

calling route_configure then link_set_routing_policy_rule and the
link_check_ready makes a race between routing_policy_rule_messages and route_messages.
While bride comes up and we call the call again route_configure if finds
it self in the callback function LINK_STATE_CONFIGURED networkd dies.
Let's handle first routing policy rules then route_configure. This fixes
the crash.
Closes #7797
2018-01-09 09:13:06 +01:00
Lennart Poettering 009e9fbcfd
Merge pull request #7740 from yuwata/fix-7676
sd-device: support the case that /sys is a symlink
2018-01-08 15:15:57 +01:00
Peter Hutterer fd007b3b52 hwdb: add touchpad override for Asus F3Sg
https://bugs.freedesktop.org/show_bug.cgi?id=104469
2018-01-08 12:03:10 +01:00
Thomas Huth d35d6249d5 rules: Mark the kvm device as static_node (for s390x and ppc64) (#7795)
On s390x and ppc64, the permissions of the /dev/kvm device are currently
not right as long as the kvm kernel module has not been loaded yet. The
kernel module is using MODULE_ALIAS("devname:kvm") there, so the module
will be loaded on the first access to /dev/kvm. In that case, udev needs
to apply the permission to the static node already (which was created via
devtmpfs), i.e. we have to specify the option "static_node=kvm" in the
udev rule.

Note that on x86, the kvm kernel modules are loaded early instead (via the
MODULE_DEVICE_TABLE(x86cpu, ...) feature checking), so that the right module
is loaded for the Intel or AMD hypervisor extensions right from the start.
Thus the "static_node=kvm" is not required on x86 - but it also should not
hurt here (and using it here even might be more future proof in case the
module loading is also done delayed there one day), so we just add the new
option to the rule here unconditionally.
2018-01-08 10:49:15 +01:00
Yu Watanabe 2e1ec12ec3 sd-device: support the case that /sys is a symlink
When /sys is a symlink to the sysfs mountpoint, e.g. /path/to/sysfs.
Then, device->syspath was set to like /path/to/sysfs/devices/foo/baz.
This converts the path to /sys/devices/foo/baz.

Fixes #7676.
2018-01-08 01:36:08 +09:00
Yu Watanabe 5bbe8eab34 sd-device: use chase_symlinks() 2018-01-08 01:35:44 +09:00
Zbigniew Jędrzejewski-Szmek 2df4611205
Merge pull request #7714 from poettering/sd-bus-watch-connect
many sd-bus improvements
2018-01-05 19:46:38 +01:00
rkolchmeyer 65d36b4950 core: Fix edge case when processing /proc/self/mountinfo (#7811)
Currently, if there are two /proc/self/mountinfo entries with the same
mount point path, the mount setup flags computed for the second of
these two entries will overwrite the mount setup flags computed for
the first of these two entries. This is the root cause of issue #7798.
This patch changes mount_setup_existing_unit to prevent the
just_mounted mount setup flag from being overwritten if it is set to
true. This will allow all mount units created from /proc/self/mountinfo
entries to be initialized properly.

Fixes: #7798
2018-01-05 19:28:23 +01:00
Lennart Poettering f3c33b234d networkd: fix memory corruption
When loading .netdev files we parse them twice: first we do one parsing
iteration to figure out their "kind", and then we do it again to parse
out the kind's parameters. The first iteration is run with a "short"
NetDev structure, that only covers the generic NetDev properties. Which
should be enough, as we don't parse the per-kind properties. However,
before this patch we'd still try to destruct the per-kind properties
which resulted in memory corruption. With this change we distuingish the
two iterations by the state field, so that the destruction only happens
when the state signals we are running with a full NetDev structure.

Since this is not obvious, let's add a lot of comments.
2018-01-05 13:59:12 +01:00
Lennart Poettering 2ac0ab5921 logind: fix user_object_find()
The logic was completely borked since
e4d2984bf8, correct that.

CID #1384234
2018-01-05 13:59:12 +01:00
Lennart Poettering c3cd7cc929 update TODO 2018-01-05 13:59:12 +01:00