]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agoCONTRIBUTING: be clearer about versions and RFE process 16917/head
Lennart Poettering [Mon, 31 Aug 2020 21:23:29 +0000 (23:23 +0200)] 
CONTRIBUTING: be clearer about versions and RFE process

Fixes: #16550
4 years agodissect-image: generate nice error when we can't detect any file system
Lennart Poettering [Mon, 31 Aug 2020 17:01:49 +0000 (19:01 +0200)] 
dissect-image: generate nice error when we can't detect any file system

4 years agoMerge pull request #16841 from keszybz/acl-util-bitmask
Lennart Poettering [Mon, 31 Aug 2020 14:45:13 +0000 (16:45 +0200)] 
Merge pull request #16841 from keszybz/acl-util-bitmask

Use a bitmask in fd_add_uid_acl_permission()

4 years agoman: document fd ownership for sd-bus fd marshalling
Lennart Poettering [Fri, 28 Aug 2020 19:18:14 +0000 (21:18 +0200)] 
man: document fd ownership for sd-bus fd marshalling

Fixes: #8003
4 years agoMerge pull request #16898 from poettering/resolved-errno
Daan De Meyer [Sun, 30 Aug 2020 17:05:38 +0000 (18:05 +0100)] 
Merge pull request #16898 from poettering/resolved-errno

make sure we have `answer_errno` always properly initialized before we end a transaction with ERRNO cause

4 years agohomed: fix log message to honor real homework path
Florian Klink [Sat, 29 Aug 2020 17:57:24 +0000 (19:57 +0200)] 
homed: fix log message to honor real homework path

This seems to be overridable by setting the SYSTEMD_HOMEWORK_PATH env
variable, but the error message always printed the SYSTEMD_HOMEWORK_PATH
constant.

4 years agotree-wide: drop pointless zero initialization (#16900)
fangxiuning [Sat, 29 Aug 2020 21:21:20 +0000 (05:21 +0800)] 
tree-wide: drop pointless zero initialization (#16900)

4 years agosrc/shared/dissect-image.c: fix build without blkdid (#16901)
Fabrice Fontaine [Sat, 29 Aug 2020 21:17:18 +0000 (23:17 +0200)] 
src/shared/dissect-image.c: fix build without blkdid (#16901)

N_DEVICE_NODE_LIST_ATTEMPTS is unconditionally used since version 246 and
https://github.com/systemd/systemd/commit/ac1f3ad05f7476ae58981dcba45dfeb2c0006824

However, this variable is only defined if HAVE_BLKID is set resulting in
the following build failure if cryptsetup is enabled but not libblkid:

../src/shared/dissect-image.c:1336:34: error: 'N_DEVICE_NODE_LIST_ATTEMPTS' undeclared (first use in this function)
 1336 |         for (unsigned i = 0; i < N_DEVICE_NODE_LIST_ATTEMPTS; i++) {
      |

Fixes:
 - http://autobuild.buildroot.org/results/67782c225c08387c1bbcbea9eee3ca12bc6577cd

4 years agoMerge pull request #16850 from mbiebl/networkd-socket-activation
Michael Biebl [Sat, 29 Aug 2020 14:12:46 +0000 (16:12 +0200)] 
Merge pull request #16850 from mbiebl/networkd-socket-activation

networkd: use socket activation when starting networkd

4 years agosym: fix bad symbol file addition
Lennart Poettering [Fri, 28 Aug 2020 17:52:36 +0000 (19:52 +0200)] 
sym: fix bad symbol file addition

The next release is 247, not 248.

A follow-up for 2b07ec316a0e25a3e10c270c7f6baee9e0187bf8

4 years agoresolved: remove superfluous ;; 16898/head
Lennart Poettering [Fri, 28 Aug 2020 20:59:26 +0000 (22:59 +0200)] 
resolved: remove superfluous ;;

4 years agotree-wide: no need to negate argument to ERROR_IS_XYZ()
Lennart Poettering [Fri, 28 Aug 2020 20:58:56 +0000 (22:58 +0200)] 
tree-wide: no need to negate argument to ERROR_IS_XYZ()

These macros call abs() internally, hence let's simplify invocations.

4 years agoresolved: make sure we initialize t->answer_errno before completing the transaction
Lennart Poettering [Fri, 28 Aug 2020 20:44:57 +0000 (22:44 +0200)] 
resolved: make sure we initialize t->answer_errno before completing the transaction

We must have the error number around when completing the transaction.
Let's hence make sure we always initialize it *first* (we accidentally
did it once after).

Fixes: #11626
4 years agotest-network: stop networkd and its socket 16850/head
Michael Biebl [Fri, 28 Aug 2020 15:21:27 +0000 (17:21 +0200)] 
test-network: stop networkd and its socket

With the changes from 2c0dffe82db574b6b9e850e48f444674e4e1d7ea, starting
systemd-networkd.service will also activate systemd-networkd.socket.
When tearing down a test, we need to stop the socket as well, to make
sure networkd can't be activated accidentally with the wrong
configuration.

4 years agoMerge pull request #16874 from poettering/analyze-cap
Lennart Poettering [Fri, 28 Aug 2020 19:01:56 +0000 (21:01 +0200)] 
Merge pull request #16874 from poettering/analyze-cap

introduce "systemd-analyze capability" command for dumping locally defined caps

4 years agoclock-util: read timestamp from /usr/lib/clock-epoch
Daniel Mack [Fri, 28 Aug 2020 14:14:12 +0000 (16:14 +0200)] 
clock-util: read timestamp from /usr/lib/clock-epoch

On systems without an RTC, systemd currently sets the clock to a
compile-time epoch value, derived from the NEWS file in the
repository. This is not ideal as the initial clock hence depends
on the last time systemd was built, not when the image was compiled.

Let's provide a different way here and look at `/usr/lib/clock-epoch`.
If that file exists, it's timestamp for the last modification will be
used instead of the compile-time default.

4 years agounits: add missing usb-gadget.target
Kyle Russell [Fri, 28 Aug 2020 13:36:35 +0000 (09:36 -0400)] 
units: add missing usb-gadget.target

4 years agoanalyze: add 'capability' verb for dumping all known and unknown caps 16874/head
Lennart Poettering [Thu, 27 Aug 2020 13:45:53 +0000 (15:45 +0200)] 
analyze: add 'capability' verb for dumping all known and unknown caps

4 years agoanalyze: fix error handling in one case
Lennart Poettering [Thu, 27 Aug 2020 13:46:03 +0000 (15:46 +0200)] 
analyze: fix error handling in one case

4 years agobasic: make sure we include inttypes.h when we use its types
Lennart Poettering [Thu, 27 Aug 2020 13:46:28 +0000 (15:46 +0200)] 
basic: make sure we include inttypes.h when we use its types

4 years agoman: extend on the usec/sec discrepancy
Lennart Poettering [Thu, 27 Aug 2020 13:45:29 +0000 (15:45 +0200)] 
man: extend on the usec/sec discrepancy

Let's document the discrepancy between the Sec and USec suffixing of
unit files and D-Bus properties at three places: in "systemctl show"
(where it already was briefly mentioned), in the D-Bus interface
description (at one place at least, i.e. the most prominent of
properties that encapsulate time values, there are many more) and in the
general man page explaining time values.

By documenting this at all three places I think we now do as much as we
can do about this highlighting the discrepancy of the naming and the
reasons behind it.

Fixes: #2047
4 years agotree-wide: drop pointless zero initialization (#16884)
fangxiuning [Fri, 28 Aug 2020 15:45:54 +0000 (23:45 +0800)] 
tree-wide: drop pointless zero initialization (#16884)

tree-wide: drop pointless zero initialization

4 years agonetworkd: consider any uevent other than "remove" sufficient for the network device...
Lennart Poettering [Wed, 12 Dec 2018 20:32:29 +0000 (21:32 +0100)] 
networkd: consider any uevent other than "remove" sufficient for the network device to be ready

4 years agologin/logind: Include sys/stat.h for struct stat usage
Ikey Doherty [Fri, 28 Aug 2020 13:23:44 +0000 (14:23 +0100)] 
login/logind: Include sys/stat.h for struct stat usage

We need to include `<sys/stat.h>` for usage of the `struct stat` in
the Manager struct, much as we already include `<stdbool.h>` for C99
booleans.

This helps alleviate another minor build failure on non-glibc systems.

4 years agoAdd simple usage message to systemd-backlight (#16709)
Plan C [Fri, 28 Aug 2020 11:50:35 +0000 (19:50 +0800)] 
Add simple usage message to systemd-backlight (#16709)

4 years agopartition/makefs: Include missing sys/file.h header
Ikey Doherty [Thu, 27 Aug 2020 16:45:45 +0000 (17:45 +0100)] 
partition/makefs: Include missing sys/file.h header

This file must be included on non-glibc systems to ensure
the `LOCK_EX` definition is available.

Signed-off-by: Ikey Doherty <ikey.doherty@lispysnake.com>
4 years agodevice: propagate reload events from devices on everything but "add", and "remove"
Lennart Poettering [Wed, 12 Dec 2018 20:31:12 +0000 (21:31 +0100)] 
device: propagate reload events from devices on everything but "add", and "remove"

Any uevent other then the initial and the last uevent we see for a
device (which is "add" and "remove") should result in a reload being
triggered, including "bind" and "unbind". Hence, let's fix up the check.

("move" is kinda a combined "remove" + "add", hence cover that too)

4 years agoMerge pull request #16879 from keszybz/test-last-cap-and-dbus-docs
Zbigniew Jędrzejewski-Szmek [Fri, 28 Aug 2020 06:30:00 +0000 (08:30 +0200)] 
Merge pull request #16879 from keszybz/test-last-cap-and-dbus-docs

Add "developer mode" and test last cap and dbus docs

4 years agoMerge pull request #16872 from keszybz/test-50
Zbigniew Jędrzejewski-Szmek [Fri, 28 Aug 2020 06:27:55 +0000 (08:27 +0200)] 
Merge pull request #16872 from keszybz/test-50

Improve handling of os-release in tests

4 years agohwdb: fix size lenovo x240 touchpad (#16871)
Jérémy Nouhaud [Thu, 27 Aug 2020 19:59:23 +0000 (21:59 +0200)] 
hwdb: fix size lenovo x240 touchpad (#16871)

As discussed in https://gitlab.freedesktop.org/libinput/libinput/-/issues/521, it adds a narrower
match that only applies to X240. Other laptops that match `pvrThinkPad??40` are not affected:

$ systemd-hwdb query 'evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pvrThinkPadX240:*'
EVDEV_ABS_00=1232:5711:51
EVDEV_ABS_01=1159:4700:53
EVDEV_ABS_35=1232:5711:51
EVDEV_ABS_36=1159:4700:53
$ systemd-hwdb query 'evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pvrThinkPadX140:*'
EVDEV_ABS_00=::41
EVDEV_ABS_01=::37
EVDEV_ABS_35=::41
EVDEV_ABS_36=::37

4 years agoman: update dbus doc stubs 16879/head
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 18:20:08 +0000 (20:20 +0200)] 
man: update dbus doc stubs

For 4e39995371738b04d98d27b0d34ea8fe09ec9fab and
bb0c0d6f29236645c8beb7ba662b2c4e7b241407.

4 years agoupdate-dbus-docs: add hint
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 18:18:05 +0000 (20:18 +0200)] 
update-dbus-docs: add hint

4 years agoupdate-dbus-docs: omit verbose output when in --test mode
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 18:15:30 +0000 (20:15 +0200)] 
update-dbus-docs: omit verbose output when in --test mode

It makes the ninja output listing very long for no good purpose.

4 years agotest: verify that dbus docs are fresh
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 18:10:01 +0000 (20:10 +0200)] 
test: verify that dbus docs are fresh

This makes use of the developer mode switch: the test is only done
if the user opted-in into developer mode.

Before the man/update-dbus-docs was using the argument form where
we don't need to run find_command(), but that doesn't work with test(),,
so find_command() is used and we get one more line in the config log.

4 years agonetwork: dhcp6: logs only new address
Yu Watanabe [Sat, 15 Aug 2020 10:01:49 +0000 (19:01 +0900)] 
network: dhcp6: logs only new address

Closes #16731.

4 years agoMerge pull request #16863 from weblate/weblate-systemd-master
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 19:10:55 +0000 (21:10 +0200)] 
Merge pull request #16863 from weblate/weblate-systemd-master

Translations update from Weblate

4 years agoupdate-dbus-docs: add test mode
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 17:55:55 +0000 (19:55 +0200)] 
update-dbus-docs: add test mode

4 years agoupdate-dbus-docs: use argparse
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 17:27:18 +0000 (19:27 +0200)] 
update-dbus-docs: use argparse

4 years agoupdate-dbus-docs: print statistics at the end
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 17:21:21 +0000 (19:21 +0200)] 
update-dbus-docs: print statistics at the end

Right now:
org.freedesktop.LogControl1.xml: 3/3
org.freedesktop.home1.xml:       44/44
org.freedesktop.hostname1.xml:   21/21
org.freedesktop.import1.xml:     17/19
org.freedesktop.locale1.xml:     10/10
org.freedesktop.login1.xml:      172/172
org.freedesktop.machine1.xml:    49/65
org.freedesktop.resolve1.xml:    25/61
org.freedesktop.systemd1.xml:    214/1468
org.freedesktop.timedate1.xml:   12/12
total:                           567/1875

:(

4 years agobasic/missing_capability: clean up our defines and check that our fallback is up...
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 16:22:45 +0000 (18:22 +0200)] 
basic/missing_capability: clean up our defines and check that our fallback is up-to-date

There is little point in #defining and #undefining CAP_LAST_CAP multiple times.

The check is only done in developer mode. After all, it's not an error to
compile on a newer kernel, and we shouldn't even warn in that case.

4 years agomeson: add "develop mode" config switch
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 15:26:49 +0000 (17:26 +0200)] 
meson: add "develop mode" config switch

4 years agotest-path: remove unnecessary check
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 07:58:58 +0000 (09:58 +0200)] 
test-path: remove unnecessary check

test points to an array, so it canont be NULL at this point.

4 years agoDon't run test-repart when loop devices are not available
Daan De Meyer [Wed, 26 Aug 2020 22:08:52 +0000 (23:08 +0100)] 
Don't run test-repart when loop devices are not available

4 years agoMerge pull request #16864 from yuwata/coverity-fixes
Lennart Poettering [Thu, 27 Aug 2020 14:36:40 +0000 (16:36 +0200)] 
Merge pull request #16864 from yuwata/coverity-fixes

Two coverity fixes

4 years agoMerge pull request #16866 from yuwata/networkctl-tiny-cleanups
Lennart Poettering [Thu, 27 Aug 2020 14:34:43 +0000 (16:34 +0200)] 
Merge pull request #16866 from yuwata/networkctl-tiny-cleanups

networkctl: tiny cleanups

4 years agomissing: Add new Linux capability
Michal Koutný [Wed, 26 Aug 2020 13:37:21 +0000 (15:37 +0200)] 
missing: Add new Linux capability

Yet another new capability coming in Linux kernel v5.9.
Make sure we can recongize them even when built with older kernel headers.

4 years agotest/test-functions: do not execute strip_binaries twice 16872/head
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 11:10:30 +0000 (13:10 +0200)] 
test/test-functions: do not execute strip_binaries twice

It is called from setup_basic_environment(), which also calls install_symtemd()
a bit earlier, so in effect it would be called twice.

4 years agotests/TEST-50: support the case when /etc/os-release is present
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 09:59:45 +0000 (11:59 +0200)] 
tests/TEST-50: support the case when /etc/os-release is present

We have four legal cases:
1. /usr/lib/os-release exists and /etc/os-release is a symlink to it
2. both exist but /etc/os-release is not a symlink to /usr/lib/os-release
3. only /usr/lib/os-release exists
4. only /etc/os-release exists

The generic setup code in test-functions and create-busybox-image didn't handle
case 3.

The test-specific code in TEST-50 didn't handle 2 (because the general setup
code would only install /etc/os-release in the image and
grep -f /usr/lib/os-release would not work) and 4 (same reason) and would fail
in case 3 in generic setup.

4 years agotest: remove executable bit from testsuite-52.service
Michael Biebl [Thu, 27 Aug 2020 10:09:08 +0000 (12:09 +0200)] 
test: remove executable bit from testsuite-52.service

4 years agoTEST-50: sfdisk is already installed by setup_basic_environment
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 09:31:11 +0000 (11:31 +0200)] 
TEST-50: sfdisk is already installed by setup_basic_environment

4 years agojournal: fix divide-by-zero warning 16864/head
Yu Watanabe [Thu, 27 Aug 2020 05:02:33 +0000 (14:02 +0900)] 
journal: fix divide-by-zero warning

Fixes CID#1430209.

4 years agocore: clear bind mounts on error
Yu Watanabe [Thu, 27 Aug 2020 04:49:21 +0000 (13:49 +0900)] 
core: clear bind mounts on error

Follow-up for bbb4e7f39f2c68c719c26c2c65f8b7b91b009e92.

Fixes CID#1431998.

4 years agoMerge pull request #16860 from poettering/tty-ask-pw-agent-list-fix
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 08:58:13 +0000 (10:58 +0200)] 
Merge pull request #16860 from poettering/tty-ask-pw-agent-list-fix

tty-ask-password-agent: three fixes

4 years agoAdd sensor configuration for Acer SW5-017-17BU
Njibhu [Wed, 26 Aug 2020 23:46:30 +0000 (01:46 +0200)] 
Add sensor configuration for Acer SW5-017-17BU

4 years agoMerge pull request #16847 from olivierlemoal/master
Zbigniew Jędrzejewski-Szmek [Thu, 27 Aug 2020 08:27:01 +0000 (10:27 +0200)] 
Merge pull request #16847 from olivierlemoal/master

shell-completion/zsh: add missing verbs for networkctl

4 years agoshared/acl-util: convert rd,wr,ex to a bitmask 16841/head
Zbigniew Jędrzejewski-Szmek [Wed, 26 Aug 2020 08:59:32 +0000 (10:59 +0200)] 
shared/acl-util: convert rd,wr,ex to a bitmask

I find this version much more readable.

Add replacement defines so that when acl/libacl.h is not available, the
ACL_{READ,WRITE,EXECUTE} constants are also defined. Those constants were
declared in the kernel headers already in 1da177e4c3f41524e886b7f1b8a0c1f,
so they should be the same pretty much everywhere.

4 years agoadd "list" verb to autocompleted commands 16847/head
Olivier Le Moal [Thu, 27 Aug 2020 08:01:36 +0000 (10:01 +0200)] 
add "list" verb to autocompleted commands

4 years agoman: clarify that several networkctl commands takes device names 16866/head
Yu Watanabe [Thu, 27 Aug 2020 07:35:25 +0000 (16:35 +0900)] 
man: clarify that several networkctl commands takes device names

4 years agonetworkctl: label command does not take any argument
Yu Watanabe [Thu, 27 Aug 2020 07:32:13 +0000 (16:32 +0900)] 
networkctl: label command does not take any argument

4 years agoudev: use path_startswith() instead of startswith() in two more cases
Lennart Poettering [Wed, 26 Aug 2020 15:22:06 +0000 (17:22 +0200)] 
udev: use path_startswith() instead of startswith() in two more cases

4 years agoReplace gendered pronouns with gender neutral ones. (#16844)
PhoenixDiscord [Thu, 27 Aug 2020 02:52:48 +0000 (04:52 +0200)] 
Replace gendered pronouns with gender neutral ones. (#16844)

4 years agoTranslated using Weblate (Swedish) 16863/head
Göran Uddeborg [Thu, 27 Aug 2020 02:46:19 +0000 (04:46 +0200)] 
Translated using Weblate (Swedish)

Currently translated at 100.0% (121 of 121 strings)

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/sv/
Translation: systemd/master

4 years agoTranslated using Weblate (French)
Julien Humbert [Thu, 27 Aug 2020 02:46:19 +0000 (04:46 +0200)] 
Translated using Weblate (French)

Currently translated at 100.0% (184 of 184 strings)

Co-authored-by: Julien Humbert <julroy67@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fr/
Translation: systemd/master

4 years agopath: Improve $PATH search directory case
Chris Down [Wed, 26 Aug 2020 17:49:27 +0000 (18:49 +0100)] 
path: Improve $PATH search directory case

Previously:

1. last_error wouldn't be updated with errors from is_dir;
2. We'd always issue a stat(), even for binaries without execute;
3. We used stat() instead of access(), which is cheaper.

This change avoids all of those, by only checking inside X_OK-positive
case whether access() works on the path with an extra slash appended.
Thanks to Lennart for the suggestion.

4 years agotty-ask-pw-agent: properly propagate error 16860/head
Lennart Poettering [Wed, 26 Aug 2020 21:10:50 +0000 (23:10 +0200)] 
tty-ask-pw-agent: properly propagate error

4 years agotty-ask-pw-agent: the message string might not be set
Lennart Poettering [Wed, 26 Aug 2020 21:05:46 +0000 (23:05 +0200)] 
tty-ask-pw-agent: the message string might not be set

4 years agotty-ask-pw-agent: make sure "--list" works correctly
Lennart Poettering [Wed, 26 Aug 2020 21:02:13 +0000 (23:02 +0200)] 
tty-ask-pw-agent: make sure "--list" works correctly

Fixes: #16836
4 years agoMerge pull request #16757 from poettering/nss-resolve-varlink
Zbigniew Jędrzejewski-Szmek [Wed, 26 Aug 2020 20:07:34 +0000 (22:07 +0200)] 
Merge pull request #16757 from poettering/nss-resolve-varlink

resolved: use varlink for communication between nss-resolve and resolved

4 years agonetworkd: use socket activation when starting networkd
Michael Biebl [Wed, 26 Aug 2020 14:54:45 +0000 (16:54 +0200)] 
networkd: use socket activation when starting networkd

Add After=systemd-networkd.socket to avoid a race condition and networkd
falling back to the non-socket activation code.

Also add Wants=systemd-networkd.socket, so the socket is started when
networkd is started via `systemctl start systemd-networkd.service`.
A Requires is not strictly necessary, as networkd still ships the
non-socket activation code. Should this code be removed one day, the
Wants should be bumped to Requires accordingly.

See also 5544ee85163733eaa50f598fcf3bd9421d4a42f9.

Fixes: #16809
4 years agonss-resolve: port over to new varlink interface 16757/head
Lennart Poettering [Sun, 16 Aug 2020 17:05:37 +0000 (19:05 +0200)] 
nss-resolve: port over to new varlink interface

4 years agoresolved: add minimal varlink api for resolving hostnames/addresses
Lennart Poettering [Sun, 16 Aug 2020 11:45:55 +0000 (13:45 +0200)] 
resolved: add minimal varlink api for resolving hostnames/addresses

This allows us to later port nss-resolve to use Varlink rather than
D-Bus for resolution. This has the benefit that nss-resolve based
resoluton works even without D-Bus being up. And it's faster too.

4 years agoresolved: minor clean-ups for resolved-bus.c
Lennart Poettering [Sun, 16 Aug 2020 12:36:20 +0000 (14:36 +0200)] 
resolved: minor clean-ups for resolved-bus.c

4 years agoresolved: move query bus tracking to resolved-bus.c
Lennart Poettering [Sun, 16 Aug 2020 11:43:51 +0000 (13:43 +0200)] 
resolved: move query bus tracking to resolved-bus.c

It's strictly bus-specific, hence let's move this to resolved-bus.c like
the rest of the bus specific logic.

This is also in preparation for adding an alternative varlink transport,
which needs similar functionality, but varlink instead of bus-specific.

4 years agoresolved: rename request → bus_request
Lennart Poettering [Sun, 16 Aug 2020 09:29:55 +0000 (11:29 +0200)] 
resolved: rename request → bus_request

Let's prepare for adding a new varlink interface, and thus rename the
"request" field to "bus_request", so that we can later add a
varlink_request field too.

4 years agoresolved: drop suppress_unroutable_family field
Lennart Poettering [Sun, 16 Aug 2020 11:35:14 +0000 (13:35 +0200)] 
resolved: drop suppress_unroutable_family field

It's unused since 90bdc8be66765df09bbc355783cee7204a5ebb31.

4 years agojson: also add explicit dispatchers for 'int' and 'unsigned'
Lennart Poettering [Mon, 17 Aug 2020 06:53:05 +0000 (08:53 +0200)] 
json: also add explicit dispatchers for 'int' and 'unsigned'

4 years agojson: add support for byte arrays to json builder
Lennart Poettering [Sun, 16 Aug 2020 12:34:38 +0000 (14:34 +0200)] 
json: add support for byte arrays to json builder

4 years agovarlink: add helper for generating errno errors
Lennart Poettering [Sun, 16 Aug 2020 11:45:25 +0000 (13:45 +0200)] 
varlink: add helper for generating errno errors

4 years agoin-addr-util: add byte accessor array to union in_addr_union
Lennart Poettering [Sun, 16 Aug 2020 09:28:34 +0000 (11:28 +0200)] 
in-addr-util: add byte accessor array to union in_addr_union

It's pretty useful to be able to access the bytes generically, without
acknowledging a specific family, hence let's a third way to access an
in_addr_union.

4 years agoshell-completion/zsh: add missing verbs for networkctl
Olivier Le Moal [Wed, 26 Aug 2020 14:03:35 +0000 (16:03 +0200)] 
shell-completion/zsh: add missing verbs for networkctl

4 years agoman: shorten description of recursive credential passing in nspawn
Zbigniew Jędrzejewski-Szmek [Wed, 26 Aug 2020 08:42:27 +0000 (10:42 +0200)] 
man: shorten description of recursive credential passing in nspawn

The text suggested that either nspawn or systemd can make use of credentials
themselves. In fact they only pass them to children.

4 years agoMerge pull request #16568 from poettering/creds-store
Zbigniew Jędrzejewski-Szmek [Wed, 26 Aug 2020 08:32:30 +0000 (10:32 +0200)] 
Merge pull request #16568 from poettering/creds-store

credentials logic to pass privileged data to services

4 years agopath: Skip directories when finalising $PATH search
Chris Down [Tue, 25 Aug 2020 20:59:11 +0000 (21:59 +0100)] 
path: Skip directories when finalising $PATH search

Imagine $PATH /a:/b. There is an echo command at /b/echo. Under this
configuration, this works fine:

    % systemd-run --user --scope echo .
    Running scope as unit: run-rfe98e0574b424d63a641644af511ff30.scope
    .

However, if I do `mkdir /a/echo`, this happens:

    % systemd-run --user --scope echo .
    Running scope as unit: run-rcbe9369537ed47f282ee12ce9f692046.scope
    Failed to execute: Permission denied

We check whether the resulting file is executable for the performing
user, but of course, most directories are anyway, since that's needed to
list within it. As such, another is_dir() check is needed prior to
considering the search result final.

Another approach might be to check S_ISREG, but there may be more gnarly
edge cases there than just eliminating this obviously pathological
example, so let's just do this for now.

4 years agosd-journal: narrow scope of boot id variable
Vito Caputo [Tue, 25 Aug 2020 18:56:27 +0000 (11:56 -0700)] 
sd-journal: narrow scope of boot id variable

Something trivial I noticed during some unrelated code spelunking

4 years agoMerge pull request #16765 from poettering/homed-recovery
Lennart Poettering [Tue, 25 Aug 2020 20:01:40 +0000 (22:01 +0200)] 
Merge pull request #16765 from poettering/homed-recovery

homed: add "recovery key" concept plus track "dirty" state of LUKS volumes

4 years agoupdate TODO 16568/head
Lennart Poettering [Thu, 23 Jul 2020 06:46:43 +0000 (08:46 +0200)] 
update TODO

4 years agotest: add test suite for new credentials logic
Lennart Poettering [Tue, 11 Aug 2020 15:08:41 +0000 (17:08 +0200)] 
test: add test suite for new credentials logic

4 years agoman: document credentials passing in the container interface
Lennart Poettering [Tue, 28 Jul 2020 07:10:18 +0000 (09:10 +0200)] 
man: document credentials passing in the container interface

4 years agoman: document nspawn's new credential switches
Lennart Poettering [Thu, 23 Jul 2020 15:43:18 +0000 (17:43 +0200)] 
man: document nspawn's new credential switches

4 years agoman: document pid1's new credentials logic
Lennart Poettering [Thu, 23 Jul 2020 16:05:54 +0000 (18:05 +0200)] 
man: document pid1's new credentials logic

4 years agonspawn: add --set-credential= and --load-credential=
Lennart Poettering [Thu, 23 Jul 2020 06:47:08 +0000 (08:47 +0200)] 
nspawn: add --set-credential= and --load-credential=

Let's allow passing in creds to containers, so that PID 1 inside the
container can pick them up.

4 years agocore: hide /run/credentials whenever namespacing is requested
Lennart Poettering [Fri, 14 Aug 2020 13:54:48 +0000 (15:54 +0200)] 
core: hide /run/credentials whenever namespacing is requested

Ideally we would like to hide all other service's credentials for all
services. That would imply for us to enable mount namespacing for all
services, which is something we cannot do, both due to compatibility
with the status quo ante, and because a number of services legitimately
should be able to install mounts in the host hierarchy.

Hence we do the second best thing, we hide the credentials automatically
for all services that opt into mount namespacing otherwise. This is
quite different from other mount sandboxing options: usually you have to
explicitly opt into each. However, given that the credentials logic is a
brand new concept we invented right here and now, and particularly
security sensitive it's OK to reverse this, and by default hide
credentials whenever we can (i.e. whenever mount namespacing is
otherwise opt-ed in to).

Long story short: if you want to hide other service's credentials, the
most basic options is to just turn on PrivateMounts= and there you go,
they should all be gone.

4 years agocore: add credentials logic
Lennart Poettering [Thu, 23 Jul 2020 06:49:52 +0000 (08:49 +0200)] 
core: add credentials logic

Fixes: #15778 #16060
4 years agoacl-util: beef up add_acls_for_user()
Lennart Poettering [Tue, 21 Jul 2020 20:14:57 +0000 (22:14 +0200)] 
acl-util: beef up add_acls_for_user()

Let's add support for controlling r/w/x bits separetely. This is useful
for using it to control access to directories, where r + x shall be
enabled.

4 years agoacl-util: make sure acl_find_uid() initializes return parameters on success
Lennart Poettering [Tue, 21 Jul 2020 20:13:12 +0000 (22:13 +0200)] 
acl-util: make sure acl_find_uid() initializes return parameters on success

Let's follow our usual coding style and initialize return parameters on
success in all cases.

4 years agorm-rf: add new flag REMOVE_CHMOD
Lennart Poettering [Thu, 23 Jul 2020 13:24:54 +0000 (15:24 +0200)] 
rm-rf: add new flag REMOVE_CHMOD

When removing a directory tree as unprivileged user we might encounter
files owned by us but not deletable since the containing directory might
have the "r" bit missing in its access mode. Let's try to deal with
this: optionally if we get EACCES try to set the bit and see if it works
then.

4 years agoupdate TODO 16765/head
Lennart Poettering [Mon, 17 Aug 2020 17:46:14 +0000 (19:46 +0200)] 
update TODO

4 years agohomed: report a home directory as "dirty" if image file has dirty flag
Lennart Poettering [Mon, 17 Aug 2020 20:08:29 +0000 (22:08 +0200)] 
homed: report a home directory as "dirty" if image file has dirty flag

4 years agohomed: mark LUKS loopback file as "dirty" via xattr when in use
Lennart Poettering [Mon, 17 Aug 2020 18:37:04 +0000 (20:37 +0200)] 
homed: mark LUKS loopback file as "dirty" via xattr when in use

Let's track the "dirty" state of a home directory backed by a LUKS
volume by setting a new xattr "home.home-dirty" on the backing file
whenever it is in use.

This allows us to later user this information to show a home directory
as "dirty". This is useful because we trim/allocate on log-out, and
if we don't do that a home directory will be larger than necessary. This
fact is something we should communicate to the admin.

The idea is that when an admin sees a user with a "dirty" home directory
they can ask them to log in, to clean up the dirty state, and thus trim
everything again.

4 years agoman: document new homectl --recovery-key= switch
Lennart Poettering [Tue, 18 Aug 2020 07:33:10 +0000 (09:33 +0200)] 
man: document new homectl --recovery-key= switch