1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-14 16:58:22 +03:00

46464 Commits

Author SHA1 Message Date
Lennart Poettering
fb68be7635 core: debug log about received fds
(cherry picked from commit 670eed4c8ca36505fc93ff140341ccb9c04510f4)
2020-12-08 18:08:30 +01:00
Lennart Poettering
7e25d4e8b8 execute: fix single character typo
Corrects: c413bb28df0996be99fd6b3f2335dfe8739d62fb

Fixes: #17313
(cherry picked from commit f5fa352f1ef5a9cc05df87bc282b13a24f9d5398)

https://github.com/systemd/systemd-stable/issues/79
2020-12-08 18:08:23 +01:00
Lennart Poettering
b531324cbc man: update sd_bus_message_read_array() docs to clarify return value 0 vs. 1
(cherry picked from commit 4840807c6ddd15f093eea32acc6bb93ffac67dfe)
2020-12-08 15:54:55 +01:00
Lennart Poettering
da2f8dda76 sd-bus: initialize return values on success in sd_bus_message_read_array()
Fixes: #17346
(cherry picked from commit 6293d958a4e12269261a7b68441b1c5be71d1f02)
2020-12-08 15:54:44 +01:00
Zbigniew Jędrzejewski-Szmek
ee224c4d6a pager: make pager secure when under euid is changed or explicitly requested
The variable is renamed to SYSTEMD_PAGERSECURE (because it's not just about
less now), and we automatically enable secure mode in certain cases, but not
otherwise.

This approach is more nuanced, but should provide a better experience for
users:

- Previusly we would set LESSSECURE=1 and trust the pager to make use of
  it. But this has an effect only on less. We need to not start pagers which
  are insecure when in secure mode. In particular more is like that and is a
  very popular pager.

- We don't enable secure mode always, which means that those other pagers can
  reasonably used.

- We do the right thing by default, but the user has ultimate control by
  setting SYSTEMD_PAGERSECURE.

Fixes #5666.

v2:
- also check $PKEXEC_UID

v3:
- use 'sd_pid_get_owner_uid() != geteuid()' as the condition

(cherry picked from commit 0a42426d797406b4b01a0d9c13bb759c2629d108)
2020-12-08 15:54:23 +01:00
Lennart Poettering
19bce9516a pager: set $LESSSECURE whenver we invoke a pager
Some extra safety when invoked via "sudo". With this we address a
genuine design flaw of sudo, and we shouldn't need to deal with this.
But it's still a good idea to disable this surface given how exotic it
is.

Prompted by #5666

(cherry picked from commit 612ebf6c913dd0e4197c44909cb3157f5c51a2f0)
2020-12-08 15:53:39 +01:00
Zbigniew Jędrzejewski-Szmek
e89a5a35b8 systemctl: ignore invalid variables in import-environment
When doing import-environment, we shouldn't fail if some assignment is invalid.
OTOH, if the invalid assignment is specified as a positional argument, we should
keep failing.

This would also fix https://bugzilla.redhat.com/show_bug.cgi?id=1754395, by
ignoring certain variables which are not important in that scenario. It seems
like the right thing to do in general.

(cherry picked from commit a4ccce22d9552dc74b6916cc5ec57f2a0b686b4f)
2020-12-08 15:53:10 +01:00
Lennart Poettering
543578d9e6 seccomp: allowlist close_range() by default in @basic-io
(cherry picked from commit 6ea0d25c573c6ef64f62333b7e850067a202c7ee)
2020-12-08 15:21:36 +01:00
Lennart Poettering
a56a4ab5d5 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.

(cherry picked from commit 562b01e99646a21ba8a0f4f52c578a38b3f7d03d)
2020-12-08 15:21:27 +01:00
Yu Watanabe
4efccdeaa6 sd-device: use trivial_hash_ops_free_free for managing match sysattrs or properties
This fixes an issue caused by eb1c1dc029c91750e6255c3fd844b4f4bf238fab.

Before the commit, multiple values can be specified for the same
sysattr or property.

Fixes #17259.

(cherry picked from commit a0887abbd8bd9f1a9a975af08e6b4a43960bb3e2)
2020-12-08 15:21:00 +01:00
Yu Watanabe
f8244f95d0 util: introduce two trivial hash_ops
Will be used in a later commit.

(cherry picked from commit 5e71868ced159355a25dc935b24c8e9b1d946bd7)
2020-12-08 15:21:00 +01:00
Yu Watanabe
228f91bfe8 hashmap: introduce {hashmap,set}_put_strdup_full()
They can take hash_ops.

(cherry picked from commit 11e9fec2590d9726c57498d5c2ed9ea2860ad443)
2020-12-08 15:21:00 +01:00
Dmitry Borodaenko
1df745acad typo in systemd.network(5): IPv6PrefixDelegation=dhcpv6
(cherry picked from commit 5fad3913e2db5eda2339419e049af88953c17ff3)
2020-12-08 15:16:17 +01:00
Bjørn Mork
34e88b7d08 units: update serial-getty@.service to support 57600 baud rate
Fixes: #17306
(cherry picked from commit 7fe7547ba3b953c142f41a9931dba7b6ff78fe0b)
2020-12-08 15:16:12 +01:00
Lennart Poettering
12b7112cd8 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.)

(cherry picked from commit 2a9b9323cd844baae3229e9dba67e478bee70654)
2020-12-08 15:15:54 +01:00
Benjamin Berg
9de2829b30 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
(cherry picked from commit 47c1db6730b8a81b01e8505a648624fa6ad0bbd7)
2020-12-08 15:13:43 +01:00
Zbigniew Jędrzejewski-Szmek
625e873d38 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...)

(cherry picked from commit bf135d82585f9a6356fa818fe4c130d3e3524918)
2020-12-08 15:13:25 +01:00
Lennart Poettering
8bc375e401 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
(cherry picked from commit c36d5b5be900315b113a62199274c37fe47a37cd)
2020-12-08 15:12:45 +01:00
Benjamin Berg
6d6f14036b 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
(cherry picked from commit 51ac77d58c03f337e1347263eb4995e1f9947a9d)
2020-12-08 15:11:20 +01:00
Benjamin Berg
53c1646ee8 xdg-autostart: Add support for Path= in XDG Desktop File
This sets the working directory of the application.

(cherry picked from commit d5273f51a1f452575eccfb855a8dc383c8d23f3a)
2020-12-08 15:11:14 +01:00
Zbigniew Jędrzejewski-Szmek
471af40d52 missing_syscall: fixup syscall numbers for x32 vs. amd64
Ported from 356e9c668732895c2887e48fa618367683dd9fff.
2020-12-08 15:11:01 +01:00
Lennart Poettering
5b45c2722b sd-event: check return value of syscals directly, avoid redundant variable assignment
And while we are at it, fix one incorrect error propagation.

(cherry picked from commit 15c689d77f9d8d46a39be39ed5acfdaed794301c)
2020-12-08 15:03:58 +01:00
Lennart Poettering
75673d2a71 missing-syscall: fix copypasta
As noticed by @mbiebl:

5134e18eed (r43033443)
(cherry picked from commit ba28df775d451edfcca9f996d60ed34c1dde2ac5)
2020-12-08 15:03:24 +01:00
Zbigniew Jędrzejewski-Szmek
3ec03c1a4e basic/missing_syscall: fix syscall numbers for mips*
Based on cd2065989163a5b6f71c8f1e4a8d73f1be63a52b.
2020-12-08 15:03:03 +01:00
Lennart Poettering
323c500e7f pretty-print: don't abbreviate needlessly in user-facing string
(cherry picked from commit e2d839d316b006fe86b1f156d90da35fa0857bfb)
2020-12-08 14:54:44 +01:00
Lennart Poettering
5be26be4cc basic: include stddef.h since we use NULL in header
(cherry picked from commit 0f2219bb8f19f0e3afb479e9c8f2ca6cbd1d9608)
2020-12-08 14:54:34 +01:00
Renaud Métrich
d90f4d40b6 unit: don't emit PropertiesChanged signal if adding a dependency to a unit is a no-op
(cherry picked from commit 5177cb0a9add4ae568cff6e6f7c2b3c77760c343)
2020-12-08 14:54:11 +01:00
Lennart Poettering
a8e84d6380 systemctl: drop unsused variable original_stdout_is_tty
Unused since de9a8fe18e0168b65ae50b6dde2865f647fc92a2.

(cherry picked from commit b8aaceb9b599ab61843165f0c162844f5499bcb4)
2020-12-08 14:53:56 +01:00
Lennart Poettering
955f914c25 socket-proxy: close correct fd, log at right log level
(cherry picked from commit 76c59537f3fef708109f90f6a728a8252d65e420)
2020-12-08 14:53:33 +01:00
Zbigniew Jędrzejewski-Szmek
08b3ca1c16 Document some reasonable DNS servers in the example config file
We have an option to set the fallback list, so we don't know what the contents
are. It may in fact be empty. Let's add some examples to make it easy for a user
stranded without any DNS to fill in something that would work. As a bonus, this
also gives names to the entries we provide by default.
(I added google and cloudflare because that's what we have currently, and quad9
because it seems to be a good privacy-concious and fast choice and was requested
in #12499. As a minimum, things we should include should be well-known global
services with a documented privacy policy and both IPv4 and IPv6 support and
decent response times.)

(cherry picked from commit 206178a9d22f5dc60f15decd8fe879326cbf4c25)
2020-12-08 14:53:19 +01:00
Marco Wang
1cd9ff98e1 boot/efi: Explicitly specify void in parameter list
Functions that accept no arguments should be
explicitly declared a void parameter in their parameter list.

Signed-off-by: Marco Wang <m.aesophor@gmail.com>
(cherry picked from commit ee85122987decae4f9f3b1dad6f7bc3b08b92526)
2020-12-08 14:52:01 +01:00
Yu Watanabe
bc36905b4d udevadm: ignore -ENODEV on trigger
The commit 88da55e28b467999da005591d3252a98f4436522 erroneously makes
`udevadm trigger` treat -ENODEV error critical.
This makes -ENODEV ignored again.

Fixes #17250.

(cherry picked from commit 1b97c5cba58fdd1138e7622d7edef9a48309b0e2)
2020-12-08 14:51:52 +01:00
Michal Suchanek
e037fe7241 basic/virt: Detect PowerVM hypervisor
Currently systemd-detect-virt fails to detect running under PowerVM.

Add code to detect PowerVM based on code in util-linux.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
(cherry picked from commit 3224e38bb6b3287ca253cbafb460a150544d5818)
2020-12-08 14:50:55 +01:00
Zbigniew Jędrzejewski-Szmek
ae98ab9e67 man: reword description of KillOnlyUsers=/KillExcludeUsers=
Fixes #17177.

(cherry picked from commit 41b6ae4da3d3e1360a9f78ca3e1176a3bfe2ec2d)
2020-12-08 14:50:46 +01:00
Zbigniew Jędrzejewski-Szmek
92905ae08d man: reword the descriptions of VXLAN DestinationPort= and PortRange=
The usual: "empty string" is meaningless in this context. We are not assigning
DestinationPort="". Just say "unset".

Fixes #17240.

(cherry picked from commit e6fd398d61a9810d53a2a5a30294500718e43286)
2020-12-08 14:50:45 +01:00
Zbigniew Jędrzejewski-Szmek
2e77eda39a man: reword of fido2 key derivation
"keyed by" is indeed a bit jargony. Say " a HMAC hash of the salt combined with
an internal secret key" instead.

For #17177.

(cherry picked from commit e0c60bf6a0065ba447b50fcb1bb171725e8bd00d)
2020-12-08 14:50:43 +01:00
Lennart Poettering
0e4e26bb85 man: fix table alignment
(cherry picked from commit ddd6dd9f2398c01f69acf163bfdedf161d7cea0d)
2020-12-08 14:50:39 +01:00
Lucas Werkmeister
00e21d010b shell-completion: add missing completions to meson.build
Completions for systemd-id128 and homectl have been available for a
while, but weren’t being installed.

(cherry picked from commit 7c57a030e0d654ce0e4d557da826170fb5ac5bc2)
2020-12-08 14:49:09 +01:00
Samanta Navarro
fffb58b443 seccomp-util: fix typo in help message
(cherry picked from commit 7b121df640475a3c8b9891a307f562abc754293d)
2020-12-08 14:48:53 +01:00
Zbigniew Jędrzejewski-Szmek
f13f628195 cryptsetup-generator: drop unused fstat()
The result stopped being used in 71e4e1258436e7e81d772aed52a02bb5d9c87cb8.

(cherry picked from commit 115a7fb624091a431e834f82c0633b00598eb510)
2020-12-08 14:44:48 +01:00
Zbigniew Jędrzejewski-Szmek
32220d878d nspawn: give better message when invoked as non-root without arguments
When invoked as non-root, we would suggest re-running as root without any
further hint. But this immediately spawns a machine from the local directory,
which can be rather surprising. So let's give a better hint.

(In general, I don't think commandline programs should do "significant" things
when invoked without any arguments. In this regard it would be better if
systemd-nspawn would not spawn a machine from the current directory if called
with no arguments and at least "-D ." would be required.)

(cherry picked from commit 38ee19c04b1a7a9f8858d791c68c8a9b711a4e3d)
2020-12-08 14:44:29 +01:00
Lennart Poettering
97f830ebe7 bootspec: don't fail with EIO if searching for ESP and finding one without an enveloping partition table
If this happens this should just mean: we couldn't find the ESP.

Fixes: #17122
(cherry picked from commit 7ea3024b508ac7166851bd8728ac31802586d614)
2020-12-08 14:43:25 +01:00
Lennart Poettering
8763164660 man: mention that sd_bus_send() buffers locally, and sd_bus_process() is needed to flush it out
Prompted-by: #17128
(cherry picked from commit 533ee38b56e881a49481bdc095793c294acce121)
2020-12-08 14:43:10 +01:00
Lennart Poettering
a2bbccfe52 resolvectl: show resolv.conf mode in resolvectl output
(cherry picked from commit 147a5046aadc2909647be32194c65d67eb42d9ce)
2020-12-08 14:42:30 +01:00
Lennart Poettering
d07f5bbcd9 resolved: expose a new bus property that informs about the /etc/resolv.conf mode
It can be one of "foreign", "missing", "stub", "static", "uplink",
depending on how /etc/resolv.conf is set up:

foreign → someone/something else manages /etc/resolv.conf,
    systemd-resolved is just the consumer

missing → /etc/resolv.conf is missing altogether

stub/static/uplink → the file is managed by resolved, with the
    well-known modes

Fixes: #17159
(cherry picked from commit 4261ab654c0df009b5a37a30593d58d47fec617f)
2020-12-08 14:42:14 +01:00
Ronan Pigott
1042564789 loginctl: add -P as short for --value --property=
(cherry picked from commit 60b254ca1a4ac81b71dd5de8c396c663bafa64a7)
2020-12-08 14:39:47 +01:00
nl6720
6f5dd94ec0 sysusers: use "!*" instead of "!!" as an invalid group password
This basically implements fc58c0c7bf7e4f525b916e3e5be0de2307fef04e for gshadow.
gpasswd may not have a lock/unlock that behaves the same as passwd, but
according to gshadow(5) the logic of the password field is the same.

(cherry picked from commit bbbfe49b5eb0c571c10fa7991c10bac620f3c453)
2020-12-08 14:39:42 +01:00
Lennart Poettering
e40e8e6093 seccomp-util: add cacheflush() syscall to @default syscall set
This is like membarrier() I guess and basically just exposes CPU
functionality via kernel syscall on some archs. Let's whitelist it for
everyone.

Fixes: #17197
(cherry picked from commit 8e24b1d23f5fa711bfdfd38bcfef525de04cd3c1)
2020-12-08 14:39:37 +01:00
Ronan Pigott
f4796aaea3 zsh: loginctl: complete alias 'self'
(cherry picked from commit 0fb8f025065ddaf3d197cce6776962ff64de5300)
2020-12-08 14:39:30 +01:00
Pass Automated Testing Suite
3102633746 path-lookup: Correct order of XDG_CONFIG_HOME and XDG_CONFIG_DIRS
According to the XDG Base Directory Specification [1] XDG_CONFIG_HOME
should take precedence over XDG_CONFIG_DIRS.

Fixes: https://github.com/systemd/systemd/issues/16095

[1]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

(cherry picked from commit e3820eeaf11f3b4614cbdfbc85675bc16a486e21)
2020-12-08 14:39:25 +01:00