systemd/.git
4 years agosd-bus: fix possible division by 0
Yu Watanabe [Mon, 9 Nov 2020 05:33:16 +0000 (14:33 +0900)]
sd-bus: fix possible division by 0

Fixes #17541.

(cherry picked from commit 291bb0b01cae22c3c14882fd5a0ad557c92d9298)

4 years agohome: fix copy-and-paste mistake
Yu Watanabe [Mon, 9 Nov 2020 05:00:14 +0000 (14:00 +0900)]
home: fix copy-and-paste mistake

Fixes #17542.

(cherry picked from commit 755b35b1aa6eda16a2cf02be3e4aa44d08fc17a3)

4 years agoresolved: slightly extend debug log output about outgoing messages
Lennart Poettering [Fri, 6 Nov 2020 10:46:39 +0000 (11:46 +0100)]
resolved: slightly extend debug log output about outgoing messages

(cherry picked from commit 76f772298e3473f00eff7cb6dc294926a7d8cc4f)

4 years agoresolved: don't resolve "local." via LLMNR
Lennart Poettering [Thu, 5 Nov 2020 13:16:03 +0000 (14:16 +0100)]
resolved: don't resolve "local." via LLMNR

It's the mDNS top-level domain, hence don't consider it for LLMNR, ever.

Fixes: #16233
(cherry picked from commit 088648d081e9bc27f53c6471b91109569b29322f)

4 years agoresolved: show all answer flags when dumping answer
Lennart Poettering [Wed, 4 Nov 2020 20:01:49 +0000 (21:01 +0100)]
resolved: show all answer flags when dumping answer

(cherry picked from commit 5cdcac6cf6879826407433f2cfcf2b763f89d74a)

4 years agoresolved: suppress misleading debug message about ignored resolv.conf line
Lennart Poettering [Thu, 5 Nov 2020 14:49:15 +0000 (15:49 +0100)]
resolved: suppress misleading debug message about ignored resolv.conf line

(cherry picked from commit 02c205359b7dfcb4501cab564218f21d0a0523f8)

4 years agoresolved: handle RRs where we don't have a signer
Lennart Poettering [Tue, 3 Nov 2020 19:34:21 +0000 (20:34 +0100)]
resolved: handle RRs where we don't have a signer

If we encounter an RR that has no matching signature, then we don't know
whether it was expanded from a wildcard or not. We need to accept that
and not make the NSEC test fail, just skip over the RR.

(cherry picked from commit 2f4c2db20ae02d750a6995e0afbff7231cd3a6b7)

4 years agoresolved: put size limit in DnsAnswer size to UINT16_MAX
Lennart Poettering [Tue, 3 Nov 2020 17:31:03 +0000 (18:31 +0100)]
resolved: put size limit in DnsAnswer size to UINT16_MAX

The three answer sections can only carry up to UINT16_MAX entries, hence
put a hard upper limit on how far DnsAnswer can grow. The three count
fields in the DNS packet header are 16 bit only, hence the limit.

If code actually tries to add more than 64K RRs it will get ENOSPC with
this new checking.

And similar to DnsQuestion.

(cherry picked from commit 398c611833584632c6977e2f89746403108637c7)

4 years agoresolved: fix dumping of DnsAnswer objects
Lennart Poettering [Wed, 28 Oct 2020 13:54:12 +0000 (14:54 +0100)]
resolved: fix dumping of DnsAnswer objects

(cherry picked from commit 014e8cc131109e2a1995fcfe0550a77e6a9b42b2)

4 years agoresolved: check return value of memdup() correctly for OOM
Lennart Poettering [Tue, 3 Nov 2020 17:06:47 +0000 (18:06 +0100)]
resolved: check return value of memdup() correctly for OOM

(cherry picked from commit a63a1252b501f6c8b5a011825372977710e88e72)

4 years agoman: remove misplaced comma
Lennart Poettering [Thu, 29 Oct 2020 17:58:04 +0000 (18:58 +0100)]
man: remove misplaced comma

(cherry picked from commit 8b2e362651ca7f921ae9cd46a851f31eb2a7c903)

4 years agounits: unconditionally pull in remote-cryptsetup.target in the initramfs
Jonathan Lebon [Tue, 27 Oct 2020 12:29:38 +0000 (13:29 +0100)]
units: unconditionally pull in remote-cryptsetup.target in the initramfs

[zjs: Replaces #17149.

I took half of the patch in
https://github.com/systemd/systemd/pull/17149#issuecomment-698399194,
hence I'm keeping Jonathan's authorship.

The original reasoning for 6c5496c492a8d74e54d22bf8824160cab1e63c10 was that we
enable remote-cryptsetup.target via presets, and since presets are not used for
the initrd, we need a different target. But since parts of the unit and target
tree are shared between the initramfs and the main system, we can't just create
a separate target for the initramfs. All the targets that depend on this one
would need to be split also. That condition is true for initrd-fs.target, but
not for sysinit.target.

So let's instead just uncoditionally pull in remote-cryptsetup.target in the
initramfs. It should normally be empty, so there should be no impact on boots
that don't have units in the target.

Jonathan's patch used initrd-root-fs.target, this version instead uses
initrd-root-device.target. initrd-root-device.target is ordered before
sysroot.mount, which means that the decrypted devices will be available earlier
too.]

(cherry picked from commit e921ebb57e0bc823ac167801cb5dd5f119f5d585)

4 years agomeson: simplify with_runlevels ternany op usage
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 09:49:11 +0000 (10:49 +0100)]
meson: simplify with_runlevels ternany op usage

(cherry picked from commit d5816b6138be788f3d3ea72359bb28dc239c3235)

4 years agoman: update fedora version
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 15:01:56 +0000 (16:01 +0100)]
man: update fedora version

F33 was released today!

(cherry picked from commit d468c81e268adb2975faff2d8c8587b5640c15ae)

4 years agoman/machinectl: fix pull-raw example
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 15:01:16 +0000 (16:01 +0100)]
man/machinectl: fix pull-raw example

We do not allow machine names with "_", so the command would fail as written.
Share the example with the systemd-nspawn page instead.

(cherry picked from commit 5fadff3352cfeb82844b6d475056bb18f2eba0dc)

4 years agoman: correct xdg-autostart-generator path
Josh Brobst [Mon, 26 Oct 2020 22:45:51 +0000 (18:45 -0400)]
man: correct xdg-autostart-generator path

(cherry picked from commit c690bd0bc6b2e07873cb289948ebd4dfa3a7e868)

4 years agotmpfiles: Handle filesystems without ACL support in more cases.
Pat Coulthard [Sun, 25 Oct 2020 21:45:13 +0000 (16:45 -0500)]
tmpfiles: Handle filesystems without ACL support in more cases.

(cherry picked from commit 3045c416e1cbbd8ab40577790522217fd1b9cb3b)

4 years agoNEWS: fix typo (`systemd-userdb` > `systemd-userdbd`)
Elias Probst [Sat, 24 Oct 2020 13:42:27 +0000 (15:42 +0200)]
NEWS: fix typo (`systemd-userdb` > `systemd-userdbd`)

(cherry picked from commit a0223c308e869b51e4142c82f365ceb17b086adb)

4 years agoRevert "sd-dhcp-client: use asynchronous_close()"
Yu Watanabe [Tue, 13 Oct 2020 12:11:36 +0000 (21:11 +0900)]
Revert "sd-dhcp-client: use asynchronous_close()"

This effectively reverts the commit 22fc2420b2a7220addcee33c2fa17ada44d87f9c.

The function `asynchronous_close()` confuses valgrind. Before this commit,
valgrind may report the following:

```
HEAP SUMMARY:
    in use at exit: 384 bytes in 1 blocks
  total heap usage: 4,787 allocs, 4,786 frees, 1,379,191 bytes allocated

384 bytes in 1 blocks are possibly lost in loss record 1 of 1
   at 0x483CAE9: calloc (vg_replace_malloc.c:760)
   by 0x401456A: _dl_allocate_tls (in /usr/lib64/ld-2.31.so)
   by 0x4BD212E: pthread_create@@GLIBC_2.2.5 (in /usr/lib64/libpthread-2.31.so)
   by 0x499B662: asynchronous_job (async.c:47)
   by 0x499B7DC: asynchronous_close (async.c:102)
   by 0x4CFA8B: client_initialize (sd-dhcp-client.c:696)
   by 0x4CFC5E: client_stop (sd-dhcp-client.c:725)
   by 0x4D4589: sd_dhcp_client_stop (sd-dhcp-client.c:2134)
   by 0x493C2F: link_stop_clients (networkd-link.c:620)
   by 0x4126DB: manager_free (networkd-manager.c:867)
   by 0x40D193: manager_freep (networkd-manager.h:97)
   by 0x40DAFC: run (networkd.c:20)

LEAK SUMMARY:
   definitely lost: 0 bytes in 0 blocks
   indirectly lost: 0 bytes in 0 blocks
     possibly lost: 384 bytes in 1 blocks
   still reachable: 0 bytes in 0 blocks
        suppressed: 0 bytes in 0 blocks

For lists of detected and suppressed errors, rerun with: -s
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
```

(cherry picked from commit 5a8775bb39526696d01d0e2ffd64e9509644fff1)

4 years agoman: document what variables are allowed
Zbigniew Jędrzejewski-Szmek [Fri, 23 Oct 2020 13:47:33 +0000 (15:47 +0200)]
man: document what variables are allowed

(cherry picked from commit 0dc9fd56a53ef833fdc5b9b81bc958e7c3dd41a4)

4 years agoresolvectl: wrap the extended status string too
Zbigniew Jędrzejewski-Szmek [Tue, 20 Oct 2020 08:50:01 +0000 (10:50 +0200)]
resolvectl: wrap the extended status string too

(cherry picked from commit 7d1e1afe28d554b2bbf95966990f8e07c361647d)

4 years agoresolvect: use wrapping for various lists
Zbigniew Jędrzejewski-Szmek [Mon, 12 Oct 2020 13:54:57 +0000 (15:54 +0200)]
resolvect: use wrapping for various lists

dump_list() is used for DNS servers, DNS domains, fallback DNS servers.

(cherry picked from commit f08a64c5e10aed0a023e85ea664cc2f916fd6a23)

4 years agoformat-table: add TABLE_STRV_WRAPPED
Zbigniew Jędrzejewski-Szmek [Mon, 12 Oct 2020 11:29:46 +0000 (13:29 +0200)]
format-table: add TABLE_STRV_WRAPPED

The idea is that we have strvs like list of server names or addresses, where
the majority of strings is rather short, but some are long and there can
potentially be many strings. So formattting them either all on one line or all
in separate lines leads to output that is either hard to read or uses way too
many rows. We want to wrap them, but relying on the pager to do the wrapping is
not nice. Normal text has a lot of redundancy, so when the pager wraps a line
in the middle of a word the read can understand what is going on without any
trouble. But for a high-density zero-redundancy text like an IP address it is
much nicer to wrap between words. This also makes c&p easier.

This adds a variant of TABLE_STRV which is wrapped on output (with line breaks
inserted between different strv entries).

The change table_print() is quite ugly. A second pass is added to re-calculate
column widths. Since column size is now "soft", i.e. it can adjust based on
available columns, we need to two passes:
- first we figure out how much space we want
- in the second pass we figure out what the actual wrapped columns
  widths will be.

To avoid unnessary work, the second pass is only done when we actually have
wrappable fields.

A test is added in test-format-table.

(cherry picked from commit b0e3d799891c4633bd2b0d88e4ed2c741bbcd532)

4 years agoformat-table: reduce scope of iterator variables
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 14:39:12 +0000 (16:39 +0200)]
format-table: reduce scope of iterator variables

(cherry picked from commit 6f8ca84c9b64c81add286790a7ffcc2eed569b27)

4 years agoresolvectl: use compat status string instead of a field-by-field table
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 14:20:27 +0000 (16:20 +0200)]
resolvectl: use compat status string instead of a field-by-field table

The status string is modeled after our --version output: +enabled -disabled equals=more-info

For example:
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=allow-downgrade/supported

(cherry picked from commit fe37e5a5d192ec55f87cd57893688a865b7f72d2)

4 years agoresolvectl: sort domain/nta output
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 10:19:46 +0000 (12:19 +0200)]
resolvectl: sort domain/nta output

dns list shall not be sorted.

(cherry picked from commit af781878d5986127ca00831c4b524c2b62649823)

4 years agoresolvectl: add the usual typedef for struct link_info/global_info
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 11:46:53 +0000 (13:46 +0200)]
resolvectl: add the usual typedef for struct link_info/global_info

Also move the struct defintions up in preparation for further changes.

(cherry picked from commit 80b8c3d7fd90e1e1943873c54dafc9e3b88fca94)

4 years agoman: add example of negative trust anchor file
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 10:55:10 +0000 (12:55 +0200)]
man: add example of negative trust anchor file

Fixes #17226.

(cherry picked from commit 2c91906e25ab0a4caa30f0bfaa1bdff6994cb9d9)

4 years agoresolvectl: break nta/domain/dns listings with newlines
Zbigniew Jędrzejewski-Szmek [Sun, 11 Oct 2020 09:54:18 +0000 (11:54 +0200)]
resolvectl: break nta/domain/dns listings with newlines

We would print the whole string as a single super-long line. Let's nicely
break the text into lines that fit on the screen.

$ COLUMNS=70 build/resolvectl --no-pager nta
Global: home local intranet 23.172.in-addr.arpa lan
        18.172.in-addr.arpa 16.172.in-addr.arpa 19.172.in-addr.arpa
        25.172.in-addr.arpa 21.172.in-addr.arpa d.f.ip6.arpa
        20.172.in-addr.arpa 30.172.in-addr.arpa 17.172.in-addr.arpa
        internal 168.192.in-addr.arpa 28.172.in-addr.arpa
        22.172.in-addr.arpa 24.172.in-addr.arpa 26.172.in-addr.arpa
        corp 10.in-addr.arpa private 29.172.in-addr.arpa test
        27.172.in-addr.arpa 31.172.in-addr.arpa
Link 2 (hub0):
Link 4 (enp0s31f6):
Link 5 (wlp4s0):
Link 7 (virbr0): adsfasdfasdfasd.com 21.172.in-addr.arpa lan j b
        a.com home d.f.ip6.arpa b.com local 16.172.in-addr.arpa
        19.172.in-addr.arpa 18.172.in-addr.arpa 25.172.in-addr.arpa
        20.172.in-addr.arpa k i h 23.172.in-addr.arpa
        168.192.in-addr.arpa d g intranet 17.172.in-addr.arpa c e.com
        30.172.in-addr.arpa a f d.com e internal
Link 8 (virbr0-nic):
Link 9 (vnet0):
Link 10 (vb-rawhide):
Link 15 (wwp0s20f0u2i12):

(cherry picked from commit 7c5023037815228280dcf461bf9b9f2b3575f600)

4 years agoxdg-autostart-generator: use Type=exec
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 07:01:48 +0000 (09:01 +0200)]
xdg-autostart-generator: use Type=exec

We check that the binary exists before writing the service file, but
let's also not consider the service started until the fork has happened.
This is still relatively new stuff, so we're can change the implementation
details like this.

(cherry picked from commit 67b2edb21f11d7b3bd2b5f8c88ceed4c5194c78a)

4 years agotest-path: use Type=exec
Zbigniew Jędrzejewski-Szmek [Mon, 14 Sep 2020 06:58:54 +0000 (08:58 +0200)]
test-path: use Type=exec

In general, Type=exec is superior to Type=simple. Let's not assume that
the service is started before it was really started.

(cherry picked from commit 333d102c644e7539b071ff5409d5a5e2dab35d65)

4 years agoman: document differences between nss-resolve and nss-dns
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 15:52:37 +0000 (17:52 +0200)]
man: document differences between nss-resolve and nss-dns

https://bugzilla.redhat.com/show_bug.cgi?id=1889012
https://serverfault.com/questions/626612/dns-just-started-resolving-my-server-prod-addresses-to-127-0-53-53
https://serverfault.com/questions/649352/what-are-the-security-implications-of-the-allow-dns-suffix-appending-to-unquali
(cherry picked from commit bace688394ab32d182f0624133f5db8367259402)

4 years agoman/org.freedesktop.resolve1: briefly document a bunch of methods and properties
Zbigniew Jędrzejewski-Szmek [Wed, 21 Oct 2020 11:53:59 +0000 (13:53 +0200)]
man/org.freedesktop.resolve1: briefly document a bunch of methods and properties

Fixes #13799.

(cherry picked from commit 2ce493672cb9a42ff0960ed127a850a8abfd12d1)

4 years agoman/systemd-resolved: reword the description of query a bit
Zbigniew Jędrzejewski-Szmek [Sun, 18 Oct 2020 14:51:14 +0000 (16:51 +0200)]
man/systemd-resolved: reword the description of query a bit

The phrase "routing domains" is used to mean both route-only domains and search
domains. Route-only domains are always called like that, and not just "route domains".

Some paragraphs are reordered to describe synthetisized records first, then
LLMNR, then various ways quries are routed.

Fixes #8928, hopefully.

(cherry picked from commit 9e1804b24c2fc75cd049b967d0f6411b6b42fecb)

4 years agoutil: make size macros unsigned
Lennart Poettering [Thu, 15 Oct 2020 15:33:04 +0000 (17:33 +0200)]
util: make size macros unsigned

By making them unsigned comparing them with other sizes is less likely
to trigger compiler warnings regarding signed/unsigned comparisons.
After all sizes (i.e. size_t) are generally assumed to be unsigned, so
these should be too.

Prompted-by: https://github.com/systemd/systemd/pull/17345#issuecomment-709402332
(cherry picked from commit 67bd5620f6cf481c0a59cedbcf63ddcab355cc55)

4 years agopreset: don't enable proc-sys-fs-binfmt_misc.mount
Harald Seiler [Sun, 6 Sep 2020 19:23:36 +0000 (21:23 +0200)]
preset: don't enable proc-sys-fs-binfmt_misc.mount

The proc-sys-fs-binfmt_misc.mount unit should not be enabled by
preset-all because it should only be used as fallback in case
proc-sys-fs-binfmt_misc.automount cannot be used on a system.  In these
cases it should be enabled manually by an administrator.

(cherry picked from commit 7139e9d9a3857724a857615a4bd80f857685eb97)

4 years agoupdate-done: Do not fail with read-only /etc or /var
Felix Riemann [Mon, 19 Oct 2020 16:54:53 +0000 (18:54 +0200)]
update-done: Do not fail with read-only /etc or /var

With the switch from log_debug() to log_debug_errno() in commit c413bb28df
systemd-update-done would fail without any error message if /etc
or /var were read-only. This restores the previous behaviour to
silently ignore these directories again.

(cherry picked from commit 1eee15c3885fcc9f6a40df7e42347cb8fca71280)

4 years agologind: use notify_start/notify_on_cleanup
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2020 17:20:05 +0000 (19:20 +0200)]
logind: use notify_start/notify_on_cleanup

Logging about the pid is dropped, pid1 does that better.

(cherry picked from commit 21fe744cfb72238822a0df9e0b8f06ef95c52ade)

4 years agoshared/daemon-util: fix notify_on_cleanup()
Zbigniew Jędrzejewski-Szmek [Thu, 15 Oct 2020 17:22:21 +0000 (19:22 +0200)]
shared/daemon-util: fix notify_on_cleanup()

p itself is never null. Because of this, we would always
call sd_notify() in cleanup, even though the intention was to only
call it if notify_start() was executed.

(cherry picked from commit 297fc20dc469694f054ed2be4358eb21efe89660)

4 years agosd-bus: add custom return code when $XDG_RUNTIME_DIR is not set
Zbigniew Jędrzejewski-Szmek [Wed, 14 Oct 2020 10:15:58 +0000 (12:15 +0200)]
sd-bus: add custom return code when $XDG_RUNTIME_DIR is not set

We would return ENOENT, which is extremely confusing. Strace is not helpful because
no *file* is actually missing. So let's add some logs at debug level and also use
a custom return code. Let all user-facing utilities print a custom error message
in that case.

(cherry picked from commit ab4a88eb920e2f64a79a60c1ea9aecb7907a9635)

4 years agosd-bus: add debug logs where we try to connect
Zbigniew Jędrzejewski-Szmek [Wed, 14 Oct 2020 09:59:23 +0000 (11:59 +0200)]
sd-bus: add debug logs where we try to connect

When connection to the bus fails it can be mighty hard to figure out
what went wrong because we have many different connection mechanisms and
we don't log what is happenning.

(cherry picked from commit 165fee860a384b2e1ea4317551bc4463b3d53b61)

4 years agobootspec: tweak error message
Lennart Poettering [Mon, 19 Oct 2020 12:20:03 +0000 (14:20 +0200)]
bootspec: tweak error message

Clarify that the name of the entry failed validation, not the entry
itself.

(cherry picked from commit dfc22cb4724851990d3d2ebcc2404a708e1b7223)

4 years agocore: log about "systemctl kill" requests
Lennart Poettering [Fri, 16 Oct 2020 15:20:20 +0000 (17:20 +0200)]
core: log about "systemctl kill" requests

let's add informational logging about each client requested signal
sending. While we are at, let's beef up error handling/log messages in
this case quite a bit: let's log errors both to syslog and report errors
back to client.

Fixes: #17254
(cherry picked from commit d991100291b6d5b81176417a42c0ca6a17cf6ab8)

4 years agocore: correct handling of "systemctl kill --kill-who=main-fail"
Lennart Poettering [Fri, 16 Oct 2020 15:16:23 +0000 (17:16 +0200)]
core: correct handling of "systemctl kill --kill-who=main-fail"

--kill-who=main-fail never worked correctly, due to a copy and paste
mistake in ac5e3a505e49c80b56c971a8fc13bacac961640d, where the same item
was listed twice. The mistake was
later noticed, but fixed incorrectly, in
201f0c916d8f65ad2595a651b1371fcd39a4cf55.

Let's list all *-fail types correctly, finally.

And while we are at it, add a nice comment and generate a prettier D-Bus
error about this.

(cherry picked from commit 2ae0508e6dab3bb61893132fa936c1f62af8aa29)

4 years agoman: document that for Type=dbus services dropping bus name has consequences
Lennart Poettering [Fri, 16 Oct 2020 16:04:59 +0000 (18:04 +0200)]
man: document that for Type=dbus services dropping bus name has consequences

Fixes: #17150
(cherry picked from commit bb63863304795a2454a9071ebad75ee673c145d8)

4 years agoman: document that ConditionKernelCommandLine= looks at /proc/1/environ in containers
Lennart Poettering [Fri, 16 Oct 2020 16:22:37 +0000 (18:22 +0200)]
man: document that ConditionKernelCommandLine= looks at /proc/1/environ in containers

Fixes: #16941
(cherry picked from commit af4b8f8048e2d2da0b1a1a4927339cf39c62fb8a)

4 years agomeson: Fix missing libseccomp dependencies
Michal Koutný [Thu, 15 Oct 2020 15:56:30 +0000 (17:56 +0200)]
meson: Fix missing libseccomp dependencies

The builds with HAVE_SECCOMP fail on missing include paths:

FAILED: src/basic/libbasic.a.p/parse-util.c.o
cc -Isrc/basic/libbasic.a.p -Isrc/basic -I../src/basic -Isrc/boot -I../src/boot -Isrc/home -I../src/home -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/udev -I../src/udev -Isrc/libudev -I../src/libudev -Isrc/core -I../src/core -Isrc/shutdown -I../src/shutdown -I../src/xdg-autostart-generator -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../src/libsystemd-network -I. -I.. -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -g -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=shadow -include config.h -fPIC -pthread -fvisibility=default -MD -MQ src/basic/libbasic.a.p/parse-util.c.o -MF src/basic/libbasic.a.p/parse-util.c.o.d -o src/basic/libbasic.a.p/parse-util.c.o -c ../src/basic/parse-util.c
In file included from ../src/basic/parse-util.c:20:
../src/shared/seccomp-util.h:4:10: fatal error: seccomp.h: No such file or directory
    4 | #include <seccomp.h>
      |          ^~~~~~~~~~~
compilation terminated.

FAILED: test-parse-util.p/src_test_test-parse-util.c.o
cc -Itest-parse-util.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/boot -I../src/boot -Isrc/home -I../src/home -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/udev -I../src/udev -Isrc/libudev -I../src/libudev -Isrc/core -I../src/core -Isrc/shutdown -I../src/shutdown -I../src/xdg-autostart-generator -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../src/libsystemd-network -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -g -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=shadow -include config.h -MD -MQ test-parse-util.p/src_test_test-parse-util.c.o -MF test-parse-util.p/src_test_test-parse-util.c.o.d -o test-parse-util.p/src_test_test-parse-util.c.o -c ../src/test/test-parse-util.c
In file included from ../src/test/test-parse-util.c:14:
../src/shared/seccomp-util.h:4:10: fatal error: seccomp.h: No such file or directory
    4 | #include <seccomp.h>
      |          ^~~~~~~~~~~
compilation terminated.

Add the respective deps.

Fixes: 005bfaf118 ("exec: Add kill action to system call filters")
(cherry picked from commit 0bc2f071e199daca9e02e0261ddf5bfd208e2c9a)

4 years agopid1: ignore whole /run/host hierarchy
Lennart Poettering [Thu, 15 Oct 2020 13:25:56 +0000 (15:25 +0200)]
pid1: ignore whole /run/host hierarchy

Let's mark the whole /run/host hierarchy as something to ignore by PID 1
for generation of .mount units, i.e. consider it as "extrinsic".

By unifying container mgr supplied resources in one dir it's also easy
to exclude the whole lot from PID1's management inside the container.
This is the right thing to do, since from the payload's PoV these mounts
are just API and not manipulatable as they are established, managed and
owned by the container manager, not the payload.

(While we are it, also add the boot ID mount to the existing list, as
nspawn and other container managers overmount that too, typically, and
it is thus owned by the container manager and not the payload
typically.)

(cherry picked from commit 6f997852c8830ca073c55241b0068ebbf1f94a72)

4 years agovarlink: add server write states to disconnect check
Anita Zhang [Wed, 9 Sep 2020 01:35:27 +0000 (18:35 -0700)]
varlink: add server write states to disconnect check

While a server is in the VARLINK_PENDING_METHOD or VARLINK_PENDING_METHOD_MORE
states and its write end is disconnected and it gets a POLLHUP, we
should disconnect since it can't write anymore.

In the case of systemd-oomd disconnecting while pid1 was pending-more, this
condition left pid1 in a state where it started throttling from
continually getting POLLHUP.

(cherry picked from commit e8e9227f5c3f8d47bec1d57a2801b22d53d0b341)

4 years agopager: lets check SYSTEMD_PAGERSECURE with secure_getenv()
Lennart Poettering [Thu, 15 Oct 2020 08:54:48 +0000 (10:54 +0200)]
pager: lets check SYSTEMD_PAGERSECURE with secure_getenv()

I can't think of any real vulnerability about this, but it still feels
better to check a variable with "secure" in its name with
secure_getenv() rather than plain getenv().

Paranoia FTW!

(cherry picked from commit b8f736b30e20a2b44e7c34bb4e43b0d97ae77e3c)

4 years agosd-bus: break the loop in bus_ensure_running() if the bus is not connecting
Zbigniew Jędrzejewski-Szmek [Wed, 14 Oct 2020 12:03:13 +0000 (14:03 +0200)]
sd-bus: break the loop in bus_ensure_running() if the bus is not connecting

This might fix #17025:
> the call trace is
> bus_ensure_running -> sd_bus_process -> bus_process_internal -> process_closeing --> sd_bus_close
>                                                                                  |
>                                                                                  \-> process_match

We ended doing callouts to the Disconnected matches from bus_ensure_running()
and shouldn't. bus_ensure_running() should never do callouts. This change
should fix this however: once we notice that the connection is going down we
will now fail instantly with ENOTOCONN instead of calling any callbacks.

(cherry picked from commit 93a59b1ae5d3bcb0ec1488ebc13d0d1ff4d1729a)

4 years agocore: debug log about received fds
Lennart Poettering [Wed, 14 Oct 2020 14:35:37 +0000 (16:35 +0200)]
core: debug log about received fds

(cherry picked from commit 670eed4c8ca36505fc93ff140341ccb9c04510f4)

4 years agoexecute: fix single character typo
Lennart Poettering [Wed, 14 Oct 2020 14:21:04 +0000 (16:21 +0200)]
execute: fix single character typo

Corrects: c413bb28df0996be99fd6b3f2335dfe8739d62fb

Fixes: #17313
(cherry picked from commit f5fa352f1ef5a9cc05df87bc282b13a24f9d5398)

https://github.com/systemd/systemd-stable/issues/79

4 years agoman: update sd_bus_message_read_array() docs to clarify return value 0 vs. 1
Lennart Poettering [Wed, 14 Oct 2020 15:08:26 +0000 (17:08 +0200)]
man: update sd_bus_message_read_array() docs to clarify return value 0 vs. 1

(cherry picked from commit 4840807c6ddd15f093eea32acc6bb93ffac67dfe)

4 years agosd-bus: initialize return values on success in sd_bus_message_read_array()
Lennart Poettering [Wed, 14 Oct 2020 14:35:55 +0000 (16:35 +0200)]
sd-bus: initialize return values on success in sd_bus_message_read_array()

Fixes: #17346
(cherry picked from commit 6293d958a4e12269261a7b68441b1c5be71d1f02)

4 years agopager: make pager secure when under euid is changed or explicitly requested
Zbigniew Jędrzejewski-Szmek [Wed, 7 Oct 2020 09:15:05 +0000 (11:15 +0200)]
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)

4 years agopager: set $LESSSECURE whenver we invoke a pager
Lennart Poettering [Mon, 31 Aug 2020 17:37:13 +0000 (19:37 +0200)]
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)

4 years agosystemctl: ignore invalid variables in import-environment
Zbigniew Jędrzejewski-Szmek [Mon, 28 Sep 2020 15:29:34 +0000 (17:29 +0200)]
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)

4 years agoseccomp: allowlist close_range() by default in @basic-io
Lennart Poettering [Wed, 14 Oct 2020 07:40:37 +0000 (09:40 +0200)]
seccomp: allowlist close_range() by default in @basic-io

(cherry picked from commit 6ea0d25c573c6ef64f62333b7e850067a202c7ee)

4 years agoalloc-util: avoid allocating zero size memory blocks
Lennart Poettering [Wed, 14 Oct 2020 08:24:08 +0000 (10:24 +0200)]
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)

4 years agosd-device: use trivial_hash_ops_free_free for managing match sysattrs or properties
Yu Watanabe [Tue, 13 Oct 2020 13:41:34 +0000 (22:41 +0900)]
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)

4 years agoutil: introduce two trivial hash_ops
Yu Watanabe [Tue, 13 Oct 2020 13:40:19 +0000 (22:40 +0900)]
util: introduce two trivial hash_ops

Will be used in a later commit.

(cherry picked from commit 5e71868ced159355a25dc935b24c8e9b1d946bd7)

4 years agohashmap: introduce {hashmap,set}_put_strdup_full()
Yu Watanabe [Tue, 13 Oct 2020 13:39:02 +0000 (22:39 +0900)]
hashmap: introduce {hashmap,set}_put_strdup_full()

They can take hash_ops.

(cherry picked from commit 11e9fec2590d9726c57498d5c2ed9ea2860ad443)

4 years agotypo in systemd.network(5): IPv6PrefixDelegation=dhcpv6
Dmitry Borodaenko [Tue, 13 Oct 2020 21:35:59 +0000 (14:35 -0700)]
typo in systemd.network(5): IPv6PrefixDelegation=dhcpv6

(cherry picked from commit 5fad3913e2db5eda2339419e049af88953c17ff3)

4 years agounits: update serial-getty@.service to support 57600 baud rate
Bjørn Mork [Tue, 13 Oct 2020 15:07:07 +0000 (17:07 +0200)]
units: update serial-getty@.service to support 57600 baud rate

Fixes: #17306
(cherry picked from commit 7fe7547ba3b953c142f41a9931dba7b6ff78fe0b)

4 years agosysctl: set kernel.core_pipe_limit=16
Lennart Poettering [Mon, 12 Oct 2020 14:31:42 +0000 (16:31 +0200)]
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)

4 years agoxdg-autostart: Lower most info messages to debug level
Benjamin Berg [Mon, 12 Oct 2020 09:02:26 +0000 (11:02 +0200)]
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)

4 years agologind: print what action is ignored
Zbigniew Jędrzejewski-Szmek [Sat, 10 Oct 2020 07:49:28 +0000 (09:49 +0200)]
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)

4 years agoresolved: don't append RFC6975 data to stub replies
Lennart Poettering [Fri, 9 Oct 2020 14:47:34 +0000 (16:47 +0200)]
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)

4 years agoxdg-autostart: Ignore more common XDG Desktop Entry fields
Benjamin Berg [Thu, 8 Oct 2020 13:58:37 +0000 (15:58 +0200)]
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)

4 years agoxdg-autostart: Add support for Path= in XDG Desktop File
Benjamin Berg [Thu, 8 Oct 2020 13:58:08 +0000 (15:58 +0200)]
xdg-autostart: Add support for Path= in XDG Desktop File

This sets the working directory of the application.

(cherry picked from commit d5273f51a1f452575eccfb855a8dc383c8d23f3a)

4 years agomissing_syscall: fixup syscall numbers for x32 vs. amd64
Zbigniew Jędrzejewski-Szmek [Tue, 8 Dec 2020 14:11:01 +0000 (15:11 +0100)]
missing_syscall: fixup syscall numbers for x32 vs. amd64

Ported from 356e9c668732895c2887e48fa618367683dd9fff.

4 years agosd-event: check return value of syscals directly, avoid redundant variable assignment
Lennart Poettering [Thu, 8 Oct 2020 16:50:36 +0000 (18:50 +0200)]
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)

4 years agomissing-syscall: fix copypasta
Lennart Poettering [Thu, 8 Oct 2020 08:27:30 +0000 (10:27 +0200)]
missing-syscall: fix copypasta

As noticed by @mbiebl:

https://github.com/systemd/systemd/commit/5134e18eedc30bfe5397ed31f94903d984a60cfc#r43033443
(cherry picked from commit ba28df775d451edfcca9f996d60ed34c1dde2ac5)

4 years agobasic/missing_syscall: fix syscall numbers for mips*
Zbigniew Jędrzejewski-Szmek [Tue, 8 Dec 2020 14:03:03 +0000 (15:03 +0100)]
basic/missing_syscall: fix syscall numbers for mips*

Based on cd2065989163a5b6f71c8f1e4a8d73f1be63a52b.

4 years agopretty-print: don't abbreviate needlessly in user-facing string
Lennart Poettering [Wed, 7 Oct 2020 14:38:29 +0000 (16:38 +0200)]
pretty-print: don't abbreviate needlessly in user-facing string

(cherry picked from commit e2d839d316b006fe86b1f156d90da35fa0857bfb)

4 years agobasic: include stddef.h since we use NULL in header
Lennart Poettering [Wed, 7 Oct 2020 14:38:07 +0000 (16:38 +0200)]
basic: include stddef.h since we use NULL in header

(cherry picked from commit 0f2219bb8f19f0e3afb479e9c8f2ca6cbd1d9608)

4 years agounit: don't emit PropertiesChanged signal if adding a dependency to a unit is a no-op
Renaud Métrich [Fri, 2 Oct 2020 15:30:35 +0000 (17:30 +0200)]
unit: don't emit PropertiesChanged signal if adding a dependency to a unit is a no-op

(cherry picked from commit 5177cb0a9add4ae568cff6e6f7c2b3c77760c343)

4 years agosystemctl: drop unsused variable original_stdout_is_tty
Lennart Poettering [Wed, 7 Oct 2020 09:30:32 +0000 (11:30 +0200)]
systemctl: drop unsused variable original_stdout_is_tty

Unused since de9a8fe18e0168b65ae50b6dde2865f647fc92a2.

(cherry picked from commit b8aaceb9b599ab61843165f0c162844f5499bcb4)

4 years agosocket-proxy: close correct fd, log at right log level
Lennart Poettering [Thu, 1 Oct 2020 20:20:42 +0000 (22:20 +0200)]
socket-proxy: close correct fd, log at right log level

(cherry picked from commit 76c59537f3fef708109f90f6a728a8252d65e420)

4 years agoDocument some reasonable DNS servers in the example config file
Zbigniew Jędrzejewski-Szmek [Tue, 6 Oct 2020 11:59:25 +0000 (13:59 +0200)]
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)

4 years agoboot/efi: Explicitly specify void in parameter list
Marco Wang [Tue, 6 Oct 2020 17:07:55 +0000 (01:07 +0800)]
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)

4 years agoudevadm: ignore -ENODEV on trigger
Yu Watanabe [Mon, 5 Oct 2020 21:39:22 +0000 (06:39 +0900)]
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)

4 years agobasic/virt: Detect PowerVM hypervisor
Michal Suchanek [Fri, 2 Oct 2020 09:05:23 +0000 (11:05 +0200)]
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)

4 years agoman: reword description of KillOnlyUsers=/KillExcludeUsers=
Zbigniew Jędrzejewski-Szmek [Mon, 5 Oct 2020 12:27:04 +0000 (14:27 +0200)]
man: reword description of KillOnlyUsers=/KillExcludeUsers=

Fixes #17177.

(cherry picked from commit 41b6ae4da3d3e1360a9f78ca3e1176a3bfe2ec2d)

4 years agoman: reword the descriptions of VXLAN DestinationPort= and PortRange=
Zbigniew Jędrzejewski-Szmek [Mon, 5 Oct 2020 12:23:19 +0000 (14:23 +0200)]
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)

4 years agoman: reword of fido2 key derivation
Zbigniew Jędrzejewski-Szmek [Mon, 5 Oct 2020 12:11:02 +0000 (14:11 +0200)]
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)

4 years agoman: fix table alignment
Lennart Poettering [Mon, 5 Oct 2020 15:45:58 +0000 (17:45 +0200)]
man: fix table alignment

(cherry picked from commit ddd6dd9f2398c01f69acf163bfdedf161d7cea0d)

4 years agoshell-completion: add missing completions to meson.build
Lucas Werkmeister [Sun, 4 Oct 2020 13:39:24 +0000 (15:39 +0200)]
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)

4 years agoseccomp-util: fix typo in help message
Samanta Navarro [Sat, 3 Oct 2020 11:56:40 +0000 (11:56 +0000)]
seccomp-util: fix typo in help message

(cherry picked from commit 7b121df640475a3c8b9891a307f562abc754293d)

4 years agocryptsetup-generator: drop unused fstat()
Zbigniew Jędrzejewski-Szmek [Thu, 24 Sep 2020 08:45:25 +0000 (10:45 +0200)]
cryptsetup-generator: drop unused fstat()

The result stopped being used in 71e4e1258436e7e81d772aed52a02bb5d9c87cb8.

(cherry picked from commit 115a7fb624091a431e834f82c0633b00598eb510)

4 years agonspawn: give better message when invoked as non-root without arguments
Zbigniew Jędrzejewski-Szmek [Wed, 23 Sep 2020 10:20:14 +0000 (12:20 +0200)]
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)

4 years agobootspec: don't fail with EIO if searching for ESP and finding one without an envelop...
Lennart Poettering [Wed, 30 Sep 2020 09:04:08 +0000 (11:04 +0200)]
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)

4 years agoman: mention that sd_bus_send() buffers locally, and sd_bus_process() is needed to...
Lennart Poettering [Wed, 23 Sep 2020 08:09:53 +0000 (10:09 +0200)]
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)

4 years agoresolvectl: show resolv.conf mode in resolvectl output
Lennart Poettering [Tue, 29 Sep 2020 15:28:31 +0000 (17:28 +0200)]
resolvectl: show resolv.conf mode in resolvectl output

(cherry picked from commit 147a5046aadc2909647be32194c65d67eb42d9ce)

4 years agoresolved: expose a new bus property that informs about the /etc/resolv.conf mode
Lennart Poettering [Tue, 29 Sep 2020 15:25:15 +0000 (17:25 +0200)]
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)

4 years agologinctl: add -P as short for --value --property=
Ronan Pigott [Wed, 30 Sep 2020 06:51:08 +0000 (23:51 -0700)]
loginctl: add -P as short for --value --property=

(cherry picked from commit 60b254ca1a4ac81b71dd5de8c396c663bafa64a7)

4 years agosysusers: use "!*" instead of "!!" as an invalid group password
nl6720 [Wed, 30 Sep 2020 05:09:25 +0000 (08:09 +0300)]
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)

4 years agoseccomp-util: add cacheflush() syscall to @default syscall set
Lennart Poettering [Tue, 29 Sep 2020 13:59:28 +0000 (15:59 +0200)]
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)

4 years agozsh: loginctl: complete alias 'self'
Ronan Pigott [Wed, 30 Sep 2020 07:11:48 +0000 (00:11 -0700)]
zsh: loginctl: complete alias 'self'

(cherry picked from commit 0fb8f025065ddaf3d197cce6776962ff64de5300)