Commit Graph

47321 Commits

Author SHA1 Message Date
Lennart Poettering d775d8e6f7 update TODO 2020-10-12 13:11:55 +02:00
Benjamin Berg 47c1db6730 xdg-autostart: Lower most info messages to debug level
It is expected for numerous autostart files to not be convertible to
corresponding units. The information is only useful for someone
debugging why a file might not be started, but it is not generally
useful for users in most situations.

As such, lower the warnings. Anyone wondering why an application is not
started will easily notice that the unit is not generated. From there it
will be somewhat harder to figure out why, but the overall trade-off is
still improved.

Fixes: #17305
2020-10-12 11:56:09 +02:00
Lennart Poettering 5de5dc30df
Merge pull request #17302 from keszybz/fix-inhibitors
Fix inhibitors
2020-10-12 11:41:18 +02:00
Lennart Poettering 656f7f8aa5
Merge pull request #17273 from mrc0mmand/coccinelle-check-for-bad-errno
coccinelle: resolve our own macros to avoid skipping functions
2020-10-12 11:39:25 +02:00
Hans de Goede b5d8a5b1e5 hwdb: Add accel orientation quirk for MPMAN Converter 9 2-in-1
Add a quirk to fix the accelerometer orientation on the MPMAN
Converter 9 2-in-1.
2020-10-12 11:36:47 +02:00
Hans de Goede f5ce710218 Add Lenovo USB touchscreens to 60-autosuspend.hwdb
Add Lenovo USB touchscreens which can safely autosuspend to hwdb,
this helps the processor reach deaper PC# states when idle.
2020-10-12 11:36:10 +02:00
Zbigniew Jędrzejewski-Szmek 092f5d2ed3
Merge pull request #17292 from poettering/idn-dlsym
turn libidn/libidn2 dep into dlopen() one
2020-10-10 16:25:49 +02:00
Lennart Poettering c36d5b5be9 resolved: don't append RFC6975 data to stub replies
We previously checked the QR bit to decide whether the RFC6975 algorithm
data in our packets. But that doesn't work in many cases, since we
initialize the QR flags along with the other flags usually only after
appending OPT (since success to do so propagates into flags). Hence,
let's add an explicit parameter that controls whether to include RFC6975
data in DNS packets, and set it to false for stub reply, and on true for
upstream queries.

Fixes: #17217
2020-10-10 16:22:22 +02:00
Lennart Poettering 5fa661a4fb docs: clarify that udev watches for IN_CLOSE_WRITE (and not IN_CLOSE)
Also, while we are at it, explain that udev won't reprobe if users just
release the lock, they have to close the block device too.
2020-10-10 10:01:59 +02:00
Zbigniew Jędrzejewski-Szmek 43e94f86c0 logind: fix taking of inhibitors
Ooops made in 0a9bf7fa59.
2020-10-10 09:58:47 +02:00
Zbigniew Jędrzejewski-Szmek bf135d8258 logind: print what action is ignored
My logs have lines like this:
Oct 10 09:38:38 krowka systemd-logind[1889]: External (2) displays connected.
Oct 10 09:38:38 krowka systemd-logind[1889]: Refusing operation, as it is turned off.
Without some hint *what* operation is ignored, this is not very informative.

(I remember this came up before, but I don't remember why we didn't change this
log line back then...)
2020-10-10 09:58:47 +02:00
Lennart Poettering 6c08f84ac6
Merge pull request #17211 from poettering/udev-loop-fixes
two udev fixes, split out of #16859
2020-10-09 17:16:07 +02:00
Lennart Poettering d2ec13fa8a
Merge pull request #17286 from benzea/benzea/xdg-autostart-improvements
XDG autostart improvements
2020-10-09 15:56:43 +02:00
mirabilos 356e9c6687 missing_syscall: fixup syscall numbers for x32 vs. amd64 2020-10-09 15:56:19 +02:00
Lennart Poettering a60a05c715 update TODO 2020-10-09 15:47:09 +02:00
Lennart Poettering 4917e7c727 shared: make libidn/libdidn2 dependency a dlopen() one 2020-10-09 15:47:09 +02:00
Frantisek Sumsal d46b79bbe0 tree-wide: drop if braces around single line expressions as well 2020-10-09 15:11:55 +02:00
Frantisek Sumsal d7a0f1f4f9 tree-wide: assorted coccinelle fixes 2020-10-09 15:02:23 +02:00
Frantisek Sumsal 44e66de0f2 coccinelle: introduce drop-braces transformation
to drop braces around single-line if statements. Also, prefix it with
zz- so it runs as the last one, so it's able to fix stuff tweaked by
previous transformations.
2020-10-09 15:02:20 +02:00
Frantisek Sumsal 7e97526421 coccinelle: check for invalid errno comparisons
Prompted by #15868
2020-10-09 14:48:44 +02:00
Frantisek Sumsal 447643130c coccinelle: correctly resolve our own macros
Coccinelle can't do this automagically and requires we supply it
respective header files. Unfortunately, the option for this
(--macro-file=) can be used only once, so let's create our own
macro file by collecting macros needed for the semantic parser
to be happy.
2020-10-09 14:48:40 +02:00
Lennart Poettering b8380cc67a udev: make sure to install an inotify watch whenever we find a block device locked
This fixes a race where a block device that pops up and immediately is
locked (such as a loopback device in preparation) might result in
udev never run any rules for it, and thus never turn on inotify watching
for it (as inotify watching is controlled via an option set via udev
rules), thus not noticing when the device is unlocked/closed again
(which is noticed via IN_CLOSE_WRITE inotify events).

This changes two things:

1. Whenever we encounter a locked block device we'll now inotify watch
   it, so that it is guaranteed we'll notice when the BSD lock fd is
   closed again, and will reprobe.

2. We'll now turn off inotify watching again once we realise the
   udev rules don't actually want that. Previously, once watching a
   device was enabled via a udev rule, it would be watched forever until
   the device disappeared, even if the option was dropped by the rules
   for later events.

Together this will make sure that we'll watch the device via inotify
in both of the following cases:

a) The block device has been BSD locked when udev wanted to look at it

b) The udev rules run for the last seen event for the device say so

In all other cases inotify is off for block devices.

This new behaviour both fixes the race, but also makes the most sense,
as the rules (when they are run) actually really control the watch state
now. And if someone BSD locks a block device then it should be OK to
inotify watch it briefly until the lock is released again as the user
this way more or less opts into the locking protocol.
2020-10-09 13:22:29 +02:00
Lennart Poettering e13d96ca2c udev-util: ignore remove events, we care about initialization after all 2020-10-09 13:22:25 +02:00
Lennart Poettering d156a4fa0f
Merge pull request #17289 from keszybz/two-coverity-fixes
Two coverity-inspired fixes
2020-10-09 11:56:15 +02:00
Benjamin Berg 51ac77d58c xdg-autostart: Ignore more common XDG Desktop Entry fields
It makes sense to ignore all the common fields that are expected and
that we can safely ignore. Note that it is fine to ignore URL as we will
already warn about the type= being wrong in that case.

Closes: #17276
2020-10-09 11:04:19 +02:00
Benjamin Berg d5273f51a1 xdg-autostart: Add support for Path= in XDG Desktop File
This sets the working directory of the application.
2020-10-09 11:04:19 +02:00
Lennart Poettering 2a155c53ab ratelimit: add ratelimit_configured() helper
This helper alone doesn't make too much sense, but it's preparatory work
for #17274, and I guess it can't hurt to land it early, it does make the
ratelimit code a tiny bit prettier after all.
2020-10-09 08:58:59 +02:00
Lennart Poettering 15c689d77f sd-event: check return value of syscals directly, avoid redundant variable assignment
And while we are at it, fix one incorrect error propagation.
2020-10-09 08:58:23 +02:00
Zbigniew Jędrzejewski-Szmek 081b300976 networkd: add assert to appease coverity
The code was OK, but not obviously so. Let's add an assert to help a
human or nonhuman reader figure it out.

Coverity CID#1433224.
2020-10-09 08:14:54 +02:00
Zbigniew Jędrzejewski-Szmek b4c527f4ec systemctl: fix reversed arguments in function call
This is confusing, but had no effect because the arguments were consistently
switched.

Coverity CID#1433223.
2020-10-09 08:04:25 +02:00
Lennart Poettering ba28df775d missing-syscall: fix copypasta
As noticed by @mbiebl:

5134e18eed (r43033443)
2020-10-08 13:52:44 +02:00
Michael Biebl cd20659891 basic/missing_syscall: fix syscall numbers for mips*
Thanks Christian Brauner @brauner
Fixes: #17261
2020-10-08 10:25:15 +02:00
Lennart Poettering e7bcecf0e4
Merge pull request #17279 from poettering/systemctl-split-up
systemctl: split huge .c file into smaller bits
2020-10-08 10:17:29 +02:00
Yu Watanabe 45a536980c
Merge pull request #17271 from yuwata/network-route-improve-multipath-route-support
network: improve multipath route support
2020-10-08 15:55:35 +09:00
Lennart Poettering daf71ef61c systemctl: split up humungous systemctl.c file
This is just some refactoring: shifting around of code, not change in
codeflow.

This splits up the way too huge systemctl.c in multiple more easily
digestable files. It roughly follows the rule that each family of verbs
gets its own .c/.h file pair, and so do all the compat executable names
we support. Plus three extra files for sysv compat (which existed before
already, but I renamed slightly, to get the systemctl- prefix lik
everything else), a -util file with generic stuff everything uses, and a
-logind file with everything that talks directly to logind instead of
PID1.

systemctl is still a bit too complex for my taste, but I think this way
itc omes in a more digestable bits at least.

No change of behaviour, just reshuffling of some code.
2020-10-07 23:12:15 +02:00
Lennart Poettering 4dcc0653b5 systemctl: move compare_unit_info() to bus-unit-util.[ch]
It's an auxiliary function to the UnitInfo structures, and very generic.
Let's hence move it over to the other code operating with UnitInfo, even
if it's not used by code outside of systemctl (yet).
2020-10-07 22:19:37 +02:00
Lennart Poettering e2d839d316 pretty-print: don't abbreviate needlessly in user-facing string 2020-10-07 22:19:33 +02:00
Lennart Poettering 0f2219bb8f basic: include stddef.h since we use NULL in header 2020-10-07 22:19:10 +02:00
Yu Watanabe ceea6c1aff network: introduce IPV4_ADDRESS_FMT_STR macro
This also moves ADDRESS_FMT_VAL() macro to networkd-address.h, and
renames it to IPV4_ADDRESS_FMT_VAL().
2020-10-08 02:51:23 +09:00
Yu Watanabe d442bb3728 network: make Gateway= in [Route] section accept an empty string 2020-10-08 02:51:23 +09:00
Yu Watanabe d306d1d0ca network: introduce Gateway=_dhcp4 and _dhcp6, and deprecate "_dhcp"
Fixes #17249.
2020-10-08 02:51:23 +09:00
Yu Watanabe d9005dec6e test-network: do not fail when multiple ipv6 default gateways are configured
When multiple ipv6 default gateways are set, kernel seems to merge them
into a multipath route.
2020-10-08 02:51:23 +09:00
Yu Watanabe bff94a84c2 util: make local_gateways() support RT_VIA and RT_MULTIPATH
Then, `networkctl status` correctly shows gateways.
2020-10-08 02:51:23 +09:00
Yu Watanabe f9bb333832 network: manage multipath routes separately 2020-10-08 02:51:23 +09:00
Yu Watanabe de52a83cb7 sd-netlink: introduce sd_netlink_message_read_data() 2020-10-08 02:51:23 +09:00
Yu Watanabe 2fe1d557e5 sd-netlink: introduce rtattr_read_nexthop() 2020-10-08 02:51:23 +09:00
Yu Watanabe d6ad41e27d network: free Route object when route_remove() fails
When route_remove() succeeds, the Route object will be freed later by
manager_rtnl_process_route().
2020-10-08 02:51:23 +09:00
Yu Watanabe 423c249c2e network: constify arguments 2020-10-08 02:51:23 +09:00
Yu Watanabe 297f9d86fe test-network: add a test case for IPv4 route with IPv6 gateway 2020-10-08 02:51:13 +09:00
Renaud Métrich 5177cb0a9a unit: don't emit PropertiesChanged signal if adding a dependency to a unit is a no-op 2020-10-07 18:16:08 +02:00