Commit Graph

47334 Commits

Author SHA1 Message Date
Lennart Poettering eaa2751685 update TODO 2020-10-14 10:40:36 +02:00
Lennart Poettering 59c4bbfb93 test-fd-util: add test case for close_all_fd() 2020-10-14 10:40:32 +02:00
Lennart Poettering b8cfa2da7c fd-util: port close_all_fds() to close_range() 2020-10-14 10:40:29 +02:00
Lennart Poettering 441e0fdb90 missing: add close_range() wrapper
The syscall was added in 5.9 and is not yet exposed in glibc, hence
define our own wrapper.
2020-10-14 10:40:10 +02:00
Lennart Poettering 6ea0d25c57 seccomp: allowlist close_range() by default in @basic-io 2020-10-14 10:40:06 +02:00
Lennart Poettering 562b01e996 alloc-util: avoid allocating zero size memory blocks
It's not clear what libc's make of this. We clamp to 1 byte allocations
in most cases already, let's add this for a few where this was missing.
2020-10-14 10:39:48 +02:00
Lennart Poettering a748b122be
analyze: show ungrouped syscalls separately (#17343)
This updates the "systemd-analyze syscall-filter" command to show a
special section of syscalls that are included in @known but in no other
group. Typically this should show syscalls we either should add to any
of the existing groups or where we unsure were they best fit in.

Right now, it mostly shows arch-specific compat syscalls, we probably
should move "@obsolete". This patch doesn't add thta however.
2020-10-14 10:31:59 +02:00
Dmitry Borodaenko 5fad3913e2 typo in systemd.network(5): IPv6PrefixDelegation=dhcpv6 2020-10-14 07:28:47 +09:00
Bjørn Mork 7fe7547ba3 units: update serial-getty@.service to support 57600 baud rate
Fixes: #17306
2020-10-13 21:00:11 +02:00
Zbigniew Jędrzejewski-Szmek ffae0b0d22 hwdb: update for v247
As usual, it seems that there are mostly additions with a smaller amount
of corrections, no big removals.
2020-10-13 13:45:11 +02:00
Daniele Medri a8cfc17962
po: revert some recent translation changes (#17237)
This partially reverts 7b8c70ed209:
- È richiesto autenticarsi → Autenticazione richiesta
- «${unit}» → '${unit}'
2020-10-13 12:30:20 +02:00
Lennart Poettering 2a9b9323cd sysctl: set kernel.core_pipe_limit=16
We need to make sure that our coredump pattern handler manages to read
process metadata from /proc/$PID/ before the kernel reaps the crashed
process. By default the kernel will reap the process as soon as it can.
By setting kernel.core_pipe_limit to a non-zero the kernel will wait for
userspace to finish before reaping.

We'll set the value to 16, which allows 16 crashes to be
processed in parallel. This matches the MaxConnections= setting in
systemd-coredump.socket.

See: #17301

(This doesn't close 17301, since we probably should also gracefully
handle if /proc/$PID/ vanished already while our coredump handler runs,
just in case people loclly set the sysctl back to zero. i.e. we should
collect what we can and rather issue an incomplete log record than
none.)
2020-10-13 09:31:13 +02:00
Zbigniew Jędrzejewski-Szmek 4b6f74f5a0 basic/selinux: work around mallinfo deprecation
Latest glibc has deprecated mallinfo(), so it might become unavailable at some point
in the future. There is malloc_info(), but it returns XML, ffs. I think the information
that we get from mallinfo() is quite useful, so let's use mallinfo() if available, and
not otherwise.
2020-10-12 15:51:39 +02:00
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