systemd/.git
4 years agocurl-util: fix callback prototype
Etienne Doms [Fri, 20 Nov 2020 16:15:25 +0000 (17:15 +0100)]
curl-util: fix callback prototype

CURLMOPT_SOCKETFUNCTION callback is an easy handle, not a multi.

(cherry picked from commit 5b639090d0b4a49d77ba58bebe180b2a6f8da322)

4 years agocurl-util: fix type CURL -> CURLM
Yu Watanabe [Fri, 20 Nov 2020 16:51:03 +0000 (01:51 +0900)]
curl-util: fix type CURL -> CURLM

(cherry picked from commit 2d052a0a48cc184ea3748c2e364c661985aa21d5)

4 years agounits: restore sysfs conditions in sys-fs-fuse-connections.mount and sys-kernel-confi...
Franck Bui [Fri, 20 Nov 2020 10:52:36 +0000 (11:52 +0100)]
units: restore sysfs conditions in sys-fs-fuse-connections.mount and sys-kernel-config.mount

Commit 42cc2855ba2fe4c6f5d incorrectly removed the condition on sysfs in both
sys-fs-fuse-connections.mount and sys-kernel-config.mount. However there are
still needed in case modprobe of one of these modules is intentionally skipped
(due to lack of privs for example).

This patch restores the 2 conditions which should be safe for the common case,
since all conditions are only checked after all deps ordered before are
complete.

Follow-up for 42cc2855ba2fe4c6f5dc863507a1c843611350a0.

(cherry picked from commit 07ccf434e77b17b20d773ce8b2637083cd4fdafc)

4 years agocore/mount: mount_start() may be called during the state is MOUNT_MOUNTING_DONE
Yu Watanabe [Tue, 17 Nov 2020 01:50:12 +0000 (10:50 +0900)]
core/mount: mount_start() may be called during the state is MOUNT_MOUNTING_DONE

As, both MOUNT_MOUNTING and MOUNT_MOUNTING_DONE are mapped to
UNIT_ACTIVATING.

Fixes #17570.

(cherry picked from commit db39a62784e8f857a67cb4a83ade28a906f79679)

4 years agoseccomp: move brk+mmap+mmap2 into @default syscall filter set
Lennart Poettering [Thu, 19 Nov 2020 10:14:41 +0000 (11:14 +0100)]
seccomp: move brk+mmap+mmap2 into @default syscall filter set

These three syscalls are internally used by libc's memory allocation
logic, i.e. ultimately back malloc(). Allocating a bit of memory is so
basic, it should just be in the default set.

This fixes a couple of issues with asan/msan and the seccomp tests: when
asan/msan is used some additional, large memory allocations take place
in the background, and unless mmap/mmap2/brk are allowlisted these will
fail, aborting the test prematurely.

(cherry picked from commit 5abede3247591248718026cb8be6cd231de7728b)

4 years agounits: wait until some fs modules are entirely loaded before mounting their correspon...
Franck Bui [Thu, 19 Nov 2020 08:17:19 +0000 (09:17 +0100)]
units: wait until some fs modules are entirely loaded before mounting their corresponding filesystem

udev requests to start the fs mount units when their respective module is
loaded. For that it monitors uevents of type "ADD" for the relevant fs modules.

However the uevent is sent by the kernel too early, ie before the init() of the
module is called hence before directories in /sys/fs/ are created.

This patch workarounds adds "Requires/After=modprobe@<fs-module>.service" to
the mount unit, which means that modprobe(8) will be called once the fs module
is announced to be loaded. This sounds pointless, but given that modprobe only
returns after the initialization of the module is complete, it should
workaround the issue.

As a side effect, the module will be automatically loaded if the mount unit is
started manually.

Fixes #17586.

(cherry picked from commit 42cc2855ba2fe4c6f5dc863507a1c843611350a0)

4 years agoRevert "units: skip modprobe@.service if the unit appears to be already loaded"
Franck Bui [Thu, 19 Nov 2020 07:55:56 +0000 (08:55 +0100)]
Revert "units: skip modprobe@.service if the unit appears to be already loaded"

This reverts commit 9cbf1e58f9629af5c6b56777ee73dc6320306d6d.

The presence of /sys/module/%I directory can't be used to assert that the load
of a given module is complete and therefore the call to modprobe(8) can be
skipped. Indeed this directory is created before the init() function of the
module is called.

Users of modprobe@.service needs to be sure that once this service returns the
module is fully operational.

(cherry picked from commit b3e32582f67c68896b6b05893b138a975fa26454)

4 years agokhash: fix structured initializer
Yu Watanabe [Wed, 18 Nov 2020 07:43:58 +0000 (16:43 +0900)]
khash: fix structured initializer

Fixes #17646.

(cherry picked from commit f56a9cbf9c20cd798258d3db302d51bf21458b38)

4 years agoman: Fix sd_bus_message_append_array_space function signature
igo95862 [Wed, 18 Nov 2020 09:21:37 +0000 (12:21 +0300)]
man: Fix sd_bus_message_append_array_space function signature

(cherry picked from commit 0e577869f3fc287223d31cfed52921c4d3579ff2)

4 years agosd-device: drop unwanted newline in netlink message
Yu Watanabe [Mon, 16 Nov 2020 15:51:14 +0000 (00:51 +0900)]
sd-device: drop unwanted newline in netlink message

(cherry picked from commit b9cbb08e0a35070d57721cd5bf810659a0b80f5e)

4 years agoman: drop misplaced phrase
Zbigniew Jędrzejewski-Szmek [Tue, 17 Nov 2020 10:46:50 +0000 (11:46 +0100)]
man: drop misplaced phrase

I think it was added in 6c2b9c8da1eb1bac7e8f170b913f63dbd13a16d7 as c&p.

(cherry picked from commit de70ff66dc628062d4f04270988b92ba0aef2420)

4 years agoman: Add a paragraph to sd_bus_call explaning callback message lifetime
igo95862 [Tue, 17 Nov 2020 09:47:28 +0000 (12:47 +0300)]
man: Add a paragraph to sd_bus_call explaning callback message lifetime

(cherry picked from commit e6ce785d611702532ae71547e78fbb49eff3aded)

4 years agoman: fix prototpe of sd_bus_message_peek_type()
Yu Watanabe [Sat, 14 Nov 2020 20:13:55 +0000 (05:13 +0900)]
man: fix prototpe of sd_bus_message_peek_type()

Fixes #17609.

(cherry picked from commit 483abcc65bd5efe43b0cea453580bac45cd0f177)

4 years agoman: add missing <para> tag, and drop redundant ">"
Yu Watanabe [Sat, 14 Nov 2020 20:10:10 +0000 (05:10 +0900)]
man: add missing <para> tag, and drop redundant ">"

Fixes #17609.

(cherry picked from commit e55c073161d469fb01ecd5bea3ff8845194e25d9)

4 years agoman: Separated paragraph about making sd_bus object reply async
igo95862 [Tue, 17 Nov 2020 07:54:19 +0000 (10:54 +0300)]
man: Separated paragraph about making sd_bus object reply async

(cherry picked from commit 2e4238a6d14223728dbfbb24830e644d31b04111)

4 years agomeson: use "_" as separator in test names
Yu Watanabe [Fri, 13 Nov 2020 06:55:54 +0000 (15:55 +0900)]
meson: use "_" as separator in test names

Follow-up for ca121e20c42219e3bc4e5cb63dcc96cc5eae2879.

Fixes #17568.

(cherry picked from commit d448888924c1d4815cb97bcd5d94419812c053b9)

4 years agomissing: define several syscall numbers for MIPS arch
Yu Watanabe [Fri, 13 Nov 2020 05:58:49 +0000 (14:58 +0900)]
missing: define several syscall numbers for MIPS arch

Fixes #17591.

(cherry picked from commit 77419ba463999a25922146ac424348adc2fe23af)

4 years agonetworkd: fix default value of DHCPv6Client
Christof Efkemann [Sun, 15 Nov 2020 19:08:39 +0000 (20:08 +0100)]
networkd: fix default value of DHCPv6Client

The configuration of networkd has a DHCPv6Client setting in its
[IPv6AcceptRA] section, which, according to the man page, can be
a boolean, or the special value "always". The man page states
that "true" is the default.

The default value is implemented in src/network/networkd-network.c
by setting field ipv6_accept_ra_start_dhcp6_client of network to
true. However, this field is not a boolean, but an enum type
IPv6AcceptRAStartDHCP6Client (src/network/networkd-ndisc.h).

Setting ipv6_accept_ra_start_dhcp6_client to true effectively
corresponds to the enum value IPV6_ACCEPT_RA_START_DHCP6_CLIENT_ALWAYS,
resulting in the DHCPv6Client setting having the default value
"always".

This patch changes the initialisation to the correct enum value
IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES.

(cherry picked from commit cabe57119f07a9f86ab281f6260bbb006b89a854)

4 years agoratelimit: fix integer overflow
Etienne Doms [Thu, 12 Nov 2020 10:09:54 +0000 (11:09 +0100)]
ratelimit: fix integer overflow

If StartLimitIntervalSec is huge, or more specifically, set to "infinity", we need to take care about overflows.

(cherry picked from commit e2357b1c8a87b610066b8b2a59517bcfb20b832e)

4 years agoman: fix tag
Yu Watanabe [Mon, 9 Nov 2020 21:10:16 +0000 (06:10 +0900)]
man: fix tag

(cherry picked from commit af7ce3faf88f6bcd5c82a71412fa81e8ae34acbb)

4 years agoman: mention that sd_bus_call() may return a negative errno mapped from D-Bus error...
Yu Watanabe [Mon, 9 Nov 2020 20:57:41 +0000 (05:57 +0900)]
man: mention that sd_bus_call() may return a negative errno mapped from D-Bus error reply

Closes #17556.

(cherry picked from commit c660668ed9daf15358c522c09ba3932393bd5451)

4 years agoman: add missing period
Yu Watanabe [Mon, 9 Nov 2020 20:25:29 +0000 (05:25 +0900)]
man: add missing period

(cherry picked from commit 23243adf69ffed2630c778e021c3cf2e97a6b999)

4 years agomeson: use "_" as separator in test names
Zbigniew Jędrzejewski-Szmek [Wed, 11 Nov 2020 13:37:07 +0000 (14:37 +0100)]
meson: use "_" as separator in test names

":" is prettier, but meson 0.56+ doesn't like it:
src/systemd/meson.build:73: DEPRECATION: ":" is not allowed in test name "cc-sd-bus.h:c", it has been replaced with "_"
src/systemd/meson.build:73: DEPRECATION: ":" is not allowed in test name "cc-sd-bus.h:c-ansi", it has been replaced with "_"
...

Fixes #17568.

(cherry picked from commit ca121e20c42219e3bc4e5cb63dcc96cc5eae2879)

4 years agoethtool: make ethtool_get_driver() return -ENODATA if ioctl succeeds but driver name...
Yu Watanabe [Mon, 9 Nov 2020 16:14:38 +0000 (01:14 +0900)]
ethtool: make ethtool_get_driver() return -ENODATA if ioctl succeeds but driver name is empty

Inspired by #17532.

(cherry picked from commit 861de64e6858bc92b154ad70d1cee41ae5b75835)

4 years agojournal: refuse skip parameter for sd_journal_next_skip() larger than INT_MAX
Yu Watanabe [Mon, 9 Nov 2020 06:23:32 +0000 (15:23 +0900)]
journal: refuse skip parameter for sd_journal_next_skip() larger than INT_MAX

Fixes #17502.

(cherry picked from commit 41d544a1c124a63f94b571e5ed924c4fb03193bb)

4 years agocore: add missing oom check
Yu Watanabe [Mon, 9 Nov 2020 14:59:36 +0000 (23:59 +0900)]
core: add missing oom check

Fixes #17552.

(cherry picked from commit 72585a584d26eec4bb9ea6c30fc101f1e4f0d7f9)

4 years agoudev: log when we fail to query ID_NET_DRIVER
Zbigniew Jędrzejewski-Szmek [Mon, 9 Nov 2020 14:39:29 +0000 (15:39 +0100)]
udev: log when we fail to query ID_NET_DRIVER

Inspired by #17532.

(cherry picked from commit d61db498bf86fe64c66e30d15aafc020cc87d068)

4 years agonetwork: make default router lifetime to 30min
Yu Watanabe [Mon, 9 Nov 2020 07:29:32 +0000 (16:29 +0900)]
network: make default router lifetime to 30min

Closes #17527.

(cherry picked from commit 71a5db49fd07864078348359200921d6d441f85a)

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.