]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agoutil: introduce format_ifname()
Yu Watanabe [Wed, 29 May 2019 05:03:18 +0000 (14:03 +0900)] 
util: introduce format_ifname()

4 years agonetworkctl: use Table for 'lldp' command
Yu Watanabe [Wed, 22 May 2019 20:13:13 +0000 (05:13 +0900)] 
networkctl: use Table for 'lldp' command

4 years agonetworkctl: use Table for 'label' command
Yu Watanabe [Wed, 22 May 2019 20:03:42 +0000 (05:03 +0900)] 
networkctl: use Table for 'label' command

4 years agonetworkctl: use Table for 'status' command
Yu Watanabe [Wed, 22 May 2019 16:43:21 +0000 (01:43 +0900)] 
networkctl: use Table for 'status' command

4 years agonetworkctl: use Table for 'list' command
Yu Watanabe [Wed, 22 May 2019 17:21:17 +0000 (02:21 +0900)] 
networkctl: use Table for 'list' command

4 years agotable: add TABLE_IFINDEX type
Yu Watanabe [Fri, 24 May 2019 09:11:13 +0000 (18:11 +0900)] 
table: add TABLE_IFINDEX type

4 years agotable: add more basic types
Yu Watanabe [Fri, 24 May 2019 09:01:04 +0000 (18:01 +0900)] 
table: add more basic types

4 years agotable: add teble_add_string_cell()
Yu Watanabe [Thu, 23 May 2019 10:59:06 +0000 (19:59 +0900)] 
table: add teble_add_string_cell()

4 years agoMerge pull request #12687 from yuwata/parse_ifindex_or_ifname
Yu Watanabe [Wed, 29 May 2019 05:20:36 +0000 (14:20 +0900)] 
Merge pull request #12687 from yuwata/parse_ifindex_or_ifname

util: introduce parse_ifindex_or_ifname() and use it in networkctl and resolvectl

4 years agonetworkctl: use parse_ifindex_or_ifname() 12687/head
Yu Watanabe [Wed, 29 May 2019 02:02:09 +0000 (11:02 +0900)] 
networkctl: use parse_ifindex_or_ifname()

4 years agoresolvectl: use parse_ifindex_or_ifname()
Yu Watanabe [Wed, 29 May 2019 01:56:55 +0000 (10:56 +0900)] 
resolvectl: use parse_ifindex_or_ifname()

4 years agoutil: add assertions
Yu Watanabe [Wed, 29 May 2019 04:21:43 +0000 (13:21 +0900)] 
util: add assertions

4 years agoutil: introduce parse_ifindex_or_ifname()
Yu Watanabe [Wed, 29 May 2019 01:43:12 +0000 (10:43 +0900)] 
util: introduce parse_ifindex_or_ifname()

4 years agonetworkctl: add support to delete virtual netdevs
Susant Sahani [Wed, 22 May 2019 09:46:41 +0000 (15:16 +0530)] 
networkctl: add support to delete virtual netdevs

We now don't have the support to delete netdevs and dependent
upon iproute to delete. With this we can delete via networkctl
and use in our test cases too.

Note that it supports deleting multiple links at once.

```
 sudo ./networkctl delete test1 test2 test3 test4
```

4 years agoMerge pull request #12635 from yuwata/nlmon-support
Yu Watanabe [Wed, 29 May 2019 01:22:09 +0000 (10:22 +0900)] 
Merge pull request #12635 from yuwata/nlmon-support

network: add nlmon support

4 years agoMerge pull request #12573 from yuwata/network-dhcp-issue-12490
Yu Watanabe [Wed, 29 May 2019 01:21:31 +0000 (10:21 +0900)] 
Merge pull request #12573 from yuwata/network-dhcp-issue-12490

network: set preferred source in removing route entry on address lost

4 years agosystemd-sleep: replace rtc wakealarm with CLOCK_BOOTTIME_ALARM s2h
Zach Smith [Thu, 16 May 2019 16:12:41 +0000 (11:12 -0500)] 
systemd-sleep: replace rtc wakealarm with CLOCK_BOOTTIME_ALARM s2h

refactor to use timerfd in place of rtc wakealarm

confirm CLOCK_BOOTTIME_ALARM support in can_s2h

Remove CLOCK_BOOTTIME_ALARM task from TODO

remove unnecessary check on clock_supported return

4 years agoseccomp: add new 5.1 syscall pidfd_send_signal() to filter set list
Lennart Poettering [Tue, 28 May 2019 13:06:49 +0000 (15:06 +0200)] 
seccomp: add new 5.1 syscall pidfd_send_signal() to filter set list

4 years agotest: exit cleanly on success
Lennart Poettering [Fri, 24 May 2019 19:09:07 +0000 (21:09 +0200)] 
test: exit cleanly on success

4 years agocryptsetup: Add LUKS2 token support. 12636/head
Milan Broz [Mon, 27 May 2019 07:44:14 +0000 (09:44 +0200)] 
cryptsetup: Add LUKS2 token support.

LUKS2 supports so-called tokens. The libcryptsetup internally
support keyring token (it tries to open device using specified
keyring entry).
Only if all token fails (or are not available), it uses a passphrase.

This patch aligns the functionality with the cryptsetup utility
(cryptsetup luksOpen tries tokens first) but does not replace
the systemd native ask-password function (can be used the same in
combination with this patch).

4 years agotest-network: add a basic test for nlmon 12635/head
Yu Watanabe [Thu, 23 May 2019 02:37:53 +0000 (11:37 +0900)] 
test-network: add a basic test for nlmon

4 years agonetwork: add nlmon support
Yu Watanabe [Thu, 23 May 2019 02:36:25 +0000 (11:36 +0900)] 
network: add nlmon support

nlmon is a Netlink monitor device.

4 years agonetwork: add NetDevVTable::generate_mac flag
Yu Watanabe [Thu, 23 May 2019 02:27:12 +0000 (11:27 +0900)] 
network: add NetDevVTable::generate_mac flag

4 years agocryptsetup: call crypt_load() for LUKS only once
Milan Broz [Mon, 27 May 2019 07:43:03 +0000 (09:43 +0200)] 
cryptsetup: call crypt_load() for LUKS only once

The crypt_load() for LUKS2 can read a quite big area of disk
(metadata area size is configurable and can increase up to megabytes).

This initialization is not needed to be repeated, just use the existing context.

(This patch is also required for the following change.)

4 years agocryptsetup: Do not fallback to PLAIN mapping if LUKS data device set fails.
Milan Broz [Mon, 27 May 2019 07:27:54 +0000 (09:27 +0200)] 
cryptsetup: Do not fallback to PLAIN mapping if LUKS data device set fails.

If crypt_load() for LUKS succeeds, we know that it is a LUKS device.
Failure of data device setting should fail in this case; remapping
as a PLAIN device late could mean data corruption.

(If a user wants to map PLAIN device over a device with LUKS header,
it should be said explicitly with "plain" argument type.)

Also, if there is no explicit PLAIN type requested and crypt device
is already initialized (crypt_data_type() is set), do not run
the initialization again.

4 years agonetwork: do not send DHCPRELEASE when CriticalConnection= is enabled 12573/head
Yu Watanabe [Mon, 27 May 2019 20:45:10 +0000 (05:45 +0900)] 
network: do not send DHCPRELEASE when CriticalConnection= is enabled

4 years agotest-network: use wait_online() in NetworkdDHCPServerTests or friends
Yu Watanabe [Fri, 24 May 2019 06:43:14 +0000 (15:43 +0900)] 
test-network: use wait_online() in NetworkdDHCPServerTests or friends

4 years agotest-network: move test_domain() to NetworkdNetworkTests class
Yu Watanabe [Fri, 24 May 2019 06:34:19 +0000 (15:34 +0900)] 
test-network: move test_domain() to NetworkdNetworkTests class

4 years agotest-network: rename needlessly long class names
Yu Watanabe [Fri, 24 May 2019 06:17:41 +0000 (15:17 +0900)] 
test-network: rename needlessly long class names

4 years agotest-network: use wait_online() instead of waiting for 10 seconds
Yu Watanabe [Fri, 24 May 2019 04:59:34 +0000 (13:59 +0900)] 
test-network: use wait_online() instead of waiting for 10 seconds

But some tests requires both IPv4 and IPv6 addresses are configured.
Only in that case wait for addresses to be configured.

4 years agotest-network: drop unused link
Yu Watanabe [Fri, 24 May 2019 05:03:07 +0000 (14:03 +0900)] 
test-network: drop unused link

4 years agotest-network: rename link_remove() to remove_links()
Yu Watanabe [Fri, 24 May 2019 04:50:51 +0000 (13:50 +0900)] 
test-network: rename link_remove() to remove_links()

4 years agotest-network: remove routes even on failure
Yu Watanabe [Fri, 24 May 2019 04:49:51 +0000 (13:49 +0900)] 
test-network: remove routes even on failure

4 years agotest-network: use setUp() and tearDown() to delete routing policy rule tables
Yu Watanabe [Fri, 24 May 2019 04:44:49 +0000 (13:44 +0900)] 
test-network: use setUp() and tearDown() to delete routing policy rule tables

4 years agotest-network: remove fou ports on failure
Yu Watanabe [Fri, 24 May 2019 04:39:50 +0000 (13:39 +0900)] 
test-network: remove fou ports on failure

4 years agotest-network: stop dnsmasq before removing links
Yu Watanabe [Fri, 24 May 2019 04:38:08 +0000 (13:38 +0900)] 
test-network: stop dnsmasq before removing links

4 years agotest-network: warn when firewalld.service is running
Yu Watanabe [Fri, 24 May 2019 03:04:59 +0000 (12:04 +0900)] 
test-network: warn when firewalld.service is running

4 years agotest-network: add tests for issue #12490
Yu Watanabe [Fri, 24 May 2019 02:39:26 +0000 (11:39 +0900)] 
test-network: add tests for issue #12490

4 years agonetwork: lower log level about critical connection
Yu Watanabe [Fri, 24 May 2019 05:14:12 +0000 (14:14 +0900)] 
network: lower log level about critical connection

4 years agonetwork: split dhcp_lease_lost() into small pieces
Yu Watanabe [Fri, 24 May 2019 07:47:47 +0000 (16:47 +0900)] 
network: split dhcp_lease_lost() into small pieces

4 years agonetwork: set dhcp4_configured flag false before configuring address
Yu Watanabe [Tue, 28 May 2019 13:14:13 +0000 (22:14 +0900)] 
network: set dhcp4_configured flag false before configuring address

Otherwise, even if dhcp_lease_acquired() fails, the flag is still on.

4 years agonetwork: reset Link::dhcp4_configured flag earlier
Yu Watanabe [Tue, 28 May 2019 13:13:01 +0000 (22:13 +0900)] 
network: reset Link::dhcp4_configured flag earlier

4 years agonetwork: set preferred source in removing route entry on address lost
Yu Watanabe [Wed, 15 May 2019 05:55:31 +0000 (14:55 +0900)] 
network: set preferred source in removing route entry on address lost

Closes #12490.

4 years agoMerge pull request #12437 from poettering/chmod-and-chown-rewrite
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 13:12:20 +0000 (15:12 +0200)] 
Merge pull request #12437 from poettering/chmod-and-chown-rewrite

chmod_and_chown() rewrite

4 years agoMerge pull request #12390 from poettering/string-file-mkdir
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 12:42:55 +0000 (14:42 +0200)] 
Merge pull request #12390 from poettering/string-file-mkdir

fileio: add a WRITE_STRING_FILE_MKDIR_0755 flag to write_string_file() that creates parent directories if needed

4 years agoMerge pull request #12392 from poettering/firstboot-salt
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 12:36:54 +0000 (14:36 +0200)] 
Merge pull request #12392 from poettering/firstboot-salt

generalize crypt_r() salt generation code

4 years agoMerge pull request #12597 from keszybz/analyze-timestamp
Lennart Poettering [Tue, 28 May 2019 12:34:53 +0000 (14:34 +0200)] 
Merge pull request #12597 from keszybz/analyze-timestamp

Analyze timestamps

4 years agoMerge pull request #12682 from keszybz/pull-in-user-targets
Lennart Poettering [Tue, 28 May 2019 12:28:59 +0000 (14:28 +0200)] 
Merge pull request #12682 from keszybz/pull-in-user-targets

rules: enable hardware-related targets also for user instances

4 years agoNEWS: add some entries
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 10:36:34 +0000 (12:36 +0200)] 
NEWS: add some entries

For #12680, #12571.

4 years agocapability-util: be more careful with types
Lennart Poettering [Wed, 24 Apr 2019 16:41:25 +0000 (18:41 +0200)] 
capability-util: be more careful with types

4 years agoMerge pull request #12679 from yuwata/journal-issue-12400
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 12:20:34 +0000 (14:20 +0200)] 
Merge pull request #12679 from yuwata/journal-issue-12400

journal: do not trigger assertion when journal_file_close() get NULL

4 years agorules: enable hardware-related targets also for user instances 12682/head
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 12:10:44 +0000 (14:10 +0200)] 
rules: enable hardware-related targets also for user instances

> the odd thing is that these units are also defined for the systemd user
> instance. However, because these are bound to SYSTEMD_USER_WANTS rather than
> SYSTEMD_WANTS they are effectively useless unless some other software
> installs the corresponding udev rules first.

This adds the rules and starts those targets also for user instances.
Fixes #12330.

4 years agojournal: use cleanup attribute at one more place 12679/head
Yu Watanabe [Tue, 28 May 2019 09:07:01 +0000 (18:07 +0900)] 
journal: use cleanup attribute at one more place

4 years agojournal: do not trigger assertion when journal_file_close() get NULL
Yu Watanabe [Tue, 28 May 2019 03:40:17 +0000 (12:40 +0900)] 
journal: do not trigger assertion when journal_file_close() get NULL

We generally expect destructors to not complain if a NULL argument is passed.

Closes #12400.

4 years agoudev: fix error message
Yu Watanabe [Wed, 22 May 2019 16:30:02 +0000 (01:30 +0900)] 
udev: fix error message

4 years agoMerge pull request #12653 from yuwata/test-network-improvements-2
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2019 08:27:58 +0000 (10:27 +0200)] 
Merge pull request #12653 from yuwata/test-network-improvements-2

network: fix configuring vxcan devices and several test-network follow-ups

4 years agozsh-completion: fix completion for systemd-inhibit --what
Douglas Christman [Sat, 25 May 2019 07:50:49 +0000 (15:50 +0800)] 
zsh-completion: fix completion for systemd-inhibit --what

4 years agoudev: suppress warning when interface matches 99-default.link
Yu Watanabe [Sat, 25 May 2019 22:21:00 +0000 (07:21 +0900)] 
udev: suppress warning when interface matches 99-default.link

This suppress the following warning:
```
systemd-udevd[437]: Config file /usr/lib/systemd/network/99-default.link
applies to device based on potentially unpredictable interface name 'wlan0'
```

Follow-up for 84ea567eb4326eb970a33188649fde6bea2a0d4e.

4 years agobash-completion: update options for bootctl
Yu Watanabe [Sun, 26 May 2019 19:58:30 +0000 (04:58 +0900)] 
bash-completion: update options for bootctl

4 years agocoredumpctl: fix --debugger option
Yu Watanabe [Tue, 28 May 2019 01:52:55 +0000 (10:52 +0900)] 
coredumpctl: fix --debugger option

Closes #12660.

4 years agotest: correctly fail when system is borked
Frantisek Sumsal [Mon, 27 May 2019 17:59:26 +0000 (19:59 +0200)] 
test: correctly fail when system is borked

In certain situations, the systemctl commands may fail (e.g. due to
missing shared libraries), but the 'script' continues and creates a
/testok file, marking the test incorrectly as passed. Let's fix this and
bail out immediately when a command exits with a non-zero exit code.

4 years agoMerge pull request #12663 from mrc0mmand/clang-asan-improvements
Evgeny Vereshchagin [Mon, 27 May 2019 16:59:53 +0000 (19:59 +0300)] 
Merge pull request #12663 from mrc0mmand/clang-asan-improvements

test: improve handling of ASan under clang

4 years agodocs: add documentation for sanitizers 12663/head
Frantisek Sumsal [Mon, 27 May 2019 12:14:26 +0000 (14:14 +0200)] 
docs: add documentation for sanitizers

4 years agotest: improve handling of ASan under clang
Frantisek Sumsal [Fri, 24 May 2019 20:35:52 +0000 (22:35 +0200)] 
test: improve handling of ASan under clang

Running integration tests with ASan is somewhat tricky to begin with, as
we need to pre-load the ASan runtime DSO for certain services (like
dbus), otherwise they won't start or behave as expected. In case of gcc
this is pretty easy, as we need the runtime DSO during compilation, so
it's already present on the host system. For clang things get more
complicated, as ASan is compiled in statically by default, thus to
enable the necessary dynamic-ish behavior one needs to compile with
-shared-libasan and then correctly set LD_PRELOAD_PATH, as the runtime
libraries are not in a standard library path.

4 years ago--bind-device does not take a bool
Oliver Harley [Sun, 26 May 2019 05:31:29 +0000 (07:31 +0200)] 
--bind-device does not take a bool

See https://github.com/systemd/systemd/blob/e95be7def26c6c5feaf08a4135aa4f50c53263a8/src/mount/mount-tool.c#L164
Also makes the man page consistent with the `--help` option

4 years agohwdb: Add support for Linx 12V64 (#12665)
Jack [Sat, 25 May 2019 20:42:00 +0000 (21:42 +0100)] 
hwdb: Add support for Linx 12V64 (#12665)

This fixes the accelerometer for the Linx 12V64.
Note that even though the configuration for both models is the same, the 12V64 and 12X64 are different models.

4 years agotran: update Chinese (Traditional) translation to the latest. (#12662)
pan93412 [Sat, 25 May 2019 13:40:43 +0000 (21:40 +0800)] 
tran: update Chinese (Traditional) translation to the latest. (#12662)

l10n: update Chinese (Traditional) translation

4 years agomeson: let's make unified cgroupsv2 the default
Lennart Poettering [Tue, 25 Sep 2018 12:09:54 +0000 (14:09 +0200)] 
meson: let's make unified cgroupsv2 the default

Prompted by @evverx' comments:

https://github.com/systemd/systemd/pull/10161#pullrequestreview-158327715

4 years agotest-fs-util: don't validate mode of symlinks 12437/head
Lennart Poettering [Tue, 30 Apr 2019 17:32:31 +0000 (19:32 +0200)] 
test-fs-util: don't validate mode of symlinks

Some file systems refuse changing the mode, and the mode has zero effect
anyway, hence let's no test for this.

4 years agoterminal-util: reset access mode in vt_restore(), too
Lennart Poettering [Tue, 30 Apr 2019 17:26:14 +0000 (19:26 +0200)] 
terminal-util: reset access mode in vt_restore(), too

Only changing ownership back to root is not enough we also need to
change the access mode, otherwise the user might have set 666 first, and
thus allow everyone access before and after the chown().

4 years agotree-wide: port various places over to use chmod_and_chown()
Lennart Poettering [Tue, 30 Apr 2019 17:25:29 +0000 (19:25 +0200)] 
tree-wide: port various places over to use chmod_and_chown()

Doing this properly is hard, hence let's unify the code.

4 years agotmpfile-util: simplify umask reset declaration
Lennart Poettering [Tue, 30 Apr 2019 07:28:10 +0000 (09:28 +0200)] 
tmpfile-util: simplify umask reset declaration

4 years agotests: add simple test case for chmod_and_chown()
Lennart Poettering [Mon, 29 Apr 2019 18:18:21 +0000 (20:18 +0200)] 
tests: add simple test case for chmod_and_chown()

4 years agofs-util: rewrite chmod_and_chown()
Lennart Poettering [Mon, 29 Apr 2019 18:15:06 +0000 (20:15 +0200)] 
fs-util: rewrite chmod_and_chown()

Inspired by #12431 let's also rework chmod_and_chown() and make sure we
never add more rights to a file not owned by the right user.

Also, let's make chmod_and_chown() just a wrapper arond
fchmod_and_chown().

let's also change strategy: instead of chown()ing first and stating
after on failure and supressing errors, let's avoid the chown in the
firts place, in the interest on keeping things minimal.

4 years agologind: split out dbus header files into their own 12424/head
Lennart Poettering [Tue, 30 Apr 2019 13:05:14 +0000 (15:05 +0200)] 
logind: split out dbus header files into their own

Previously, logind's logind-session.h would define prototypes for
logind-session.c and logind-session-dbus.c. Split that out, so that
there's a separate logind-session-dbus.h for that. Similar for seats and
users as well as the manager itself.

This changes no code, just rearranges where protoypes are located.

4 years agoupdate TODO
Lennart Poettering [Sun, 28 Apr 2019 11:00:36 +0000 (13:00 +0200)] 
update TODO

4 years agologind: convert ENXIO into 0, to signal 'not found' cleanly
Lennart Poettering [Tue, 30 Apr 2019 11:48:34 +0000 (13:48 +0200)] 
logind: convert ENXIO into 0, to signal 'not found' cleanly

4 years agologind: support self/auto seats for AttachDevice(), too
Lennart Poettering [Tue, 30 Apr 2019 11:48:11 +0000 (13:48 +0200)] 
logind: support self/auto seats for AttachDevice(), too

4 years agologind: validate /sys fs path a bit more strictly
Lennart Poettering [Tue, 30 Apr 2019 11:47:52 +0000 (13:47 +0200)] 
logind: validate /sys fs path a bit more strictly

4 years agologind: prefer hashmap_contains() over hashmap_get()
Lennart Poettering [Tue, 30 Apr 2019 11:47:33 +0000 (13:47 +0200)] 
logind: prefer hashmap_contains() over hashmap_get()

4 years agologinctl: drop $XDG_SESSION_ID env var magic
Lennart Poettering [Sun, 28 Apr 2019 16:02:03 +0000 (18:02 +0200)] 
loginctl: drop $XDG_SESSION_ID env var magic

The server side can do something similar, but better on its own, let's
hence rely on that.

4 years agologind: make "self" and "auto" magic strings when operating on seats + sessions
Lennart Poettering [Sun, 28 Apr 2019 15:55:36 +0000 (17:55 +0200)] 
logind: make "self" and "auto" magic strings when operating on seats + sessions

Most of the operations one can do on sessions so far accepted an empty
session name as a shortcut for the caller's session. This is quite
useful traditionally, but much less useful than it used to be, since
most user code now (rightfully) runs in --user context, not in a
session.

With this change we tweak the logic a bit: we introduce the two special
session and seat names "self" and "auto". The former refers to the
session/seat the client is in, and is hence mostly equivalent to te
empty string "" as before. However, the latter refers to the
session/seat the client is in if that exists, with a fallback of the
user's display session if not. Clients can hence reference "auto"
instead of the empty string if they really don't want to think much
about sessions.

Why "self" btw? Previously, we'd already expose a special dbus object
with the path /org/freedesktop/login1/session/self (and similar for the
seat), matching what the empty string did for bus calls that took a
session name. With this scheme we reuse this identifier and introduce
"auto" in a similar way.

Of course this means real-life seats and sessions can never be named
"self" or "auto", but they aren't anyway: valid seat names have to start
with "seat" anyway, and sessions are generated server-side as either a
numeric value or "c" suffixed with a counter ID.

Fixes: #12399
4 years agologind: make a constant array static
Lennart Poettering [Sun, 28 Apr 2019 09:25:48 +0000 (11:25 +0200)] 
logind: make a constant array static

4 years agologind: consider "greeter" sessions suitable as "display" sessions of a user
Lennart Poettering [Sun, 28 Apr 2019 09:24:15 +0000 (11:24 +0200)] 
logind: consider "greeter" sessions suitable as "display" sessions of a user

Interestingly, elect_display_compare() already ordered "user" sessions
before "greeter" sessions, though nothing other than "user" sessions
where ever considered anyway.

Fixes: #12399
4 years agologind: make sure the service gets access to the linger directory
Lennart Poettering [Sun, 28 Apr 2019 09:17:59 +0000 (11:17 +0200)] 
logind: make sure the service gets access to the linger directory

Fixes: #12401
4 years agologind: add SetBrightness() bus call for setting brightness of leds/backlight devices...
Lennart Poettering [Sun, 28 Apr 2019 09:07:56 +0000 (11:07 +0200)] 
logind: add SetBrightness() bus call for setting brightness of leds/backlight devices associated with a seat

This augments the drm/input device management by adding a single method
call for setting the brightness of an "leds" or "backlight" kernel class
device.

This method call requires no privileges to call, but a caller can only
change the brightness on sessions that are currently active, and they
must own the session.

This does not do enumeration of such class devices, feature or range
probing, chnage notification; it doesn't help associating graphics or
input devices with their backlight or leds devices. For all that clients
should go directly to udev/sysfs. The SetBrightness() call is just for
executing the actual change operation, that is otherwise privileged.

Example line:

   busctl call org.freedesktop.login1 /org/freedesktop/login1/session/self org.freedesktop.login1.Session SetBrightness ssu "backlight" "intel_backlight" 200

The parameter the SetBrightness() call takes are the kernel subsystem
(i.e. "leds" or "backlight"), the device name, and the brightness
value.

On some hw setting the brightness is slow, and implementation and write
access to the sysfs knobs exposes this slowness. Due to this we'll fork
off a writer process in the background so that logind doesn't have to
block. Moreover, write requestes are coalesced: when a write request is
enqueued while one is already being executed it is queued. When another
write reques is then enqueued the earlier one is replaced by the newer
one, so that only one queued write request per device remains at any
time. Method replies are sent as soon as the first write request that
happens after the request was received is completed.

It is recommended that bus clients turn off the "expect_reply" flag on
the dbus messages they send though, that relieves logind from sending
completion notification and is particularly a good idea if clients
implement reactive UI sliders that send a quick secession of write
requests.

Replaces: #12413

4 years agologind: small simplification
Lennart Poettering [Sun, 28 Apr 2019 09:06:50 +0000 (11:06 +0200)] 
logind: small simplification

4 years agoudev: tag "leds" and "backlight" devices for association to a seat
Lennart Poettering [Sun, 28 Apr 2019 09:05:07 +0000 (11:05 +0200)] 
udev: tag "leds" and "backlight" devices for association to a seat

These devices do not become user-accessible this way, but they are
logically assigned to a seat, which makes a lot of sense, since they are
human-facing output devices, and such should belong to one.

4 years agomachine-image: openat() doesn't operate on the cwd if the first argument is specified
Lennart Poettering [Fri, 24 May 2019 08:54:09 +0000 (10:54 +0200)] 
machine-image: openat() doesn't operate on the cwd if the first argument is specified

A fix-up for bcb846f30f9ca8f42e79d109706aee9f2032261b.

4 years agoMerge pull request #12430 from poettering/seccomp-kill-process
Zbigniew Jędrzejewski-Szmek [Fri, 24 May 2019 10:17:53 +0000 (12:17 +0200)] 
Merge pull request #12430 from poettering/seccomp-kill-process

use SCMP_ACT_KILL_PROCESS for SystemCallFilters=

4 years agotest-execute: turn off coredump generation in test services 12430/head
Lennart Poettering [Mon, 29 Apr 2019 11:02:32 +0000 (13:02 +0200)] 
test-execute: turn off coredump generation in test services

These services are likely to coredump, and we expect that but aren't
interested in the coredump. Hence let's turn off processing by setting
RLIMIT_CORE to 0/0.

4 years agotest-execute: let's ignore the difference between CLD_KILLED and CLD_DUMPED
Lennart Poettering [Mon, 29 Apr 2019 10:58:55 +0000 (12:58 +0200)] 
test-execute: let's ignore the difference between CLD_KILLED and CLD_DUMPED

Depending on system configuration and whether SCMP_ACT_KILL_PROCESS or
SCMP_ACT_KILL_THREAD is available/used processes might coredump on
specific coredumps or are just plain killed. For our test case the
difference doesn't really matter, hence let's hide it away.

4 years agotest-execute: check exit code before exit status
Lennart Poettering [Mon, 29 Apr 2019 10:54:26 +0000 (12:54 +0200)] 
test-execute: check exit code before exit status

The meaning of the status changes depending on the code, hence let's
always compare the code first, status second.

4 years agoservice: tweak capitalization of unit description
Lennart Poettering [Mon, 29 Apr 2019 10:05:33 +0000 (12:05 +0200)] 
service: tweak capitalization of unit description

4 years agoNEWS: document the new SystemCallFilter= behaviour
Lennart Poettering [Mon, 29 Apr 2019 10:05:16 +0000 (12:05 +0200)] 
NEWS: document the new SystemCallFilter= behaviour

4 years agonspawn: expose the new seccomp actions in the OCI logic
Lennart Poettering [Mon, 29 Apr 2019 10:04:55 +0000 (12:04 +0200)] 
nspawn: expose the new seccomp actions in the OCI logic

4 years agotest: use the new action in our tests
Lennart Poettering [Mon, 29 Apr 2019 10:04:34 +0000 (12:04 +0200)] 
test: use the new action in our tests

This way, we know that it works as intended.

4 years agocore: prefer SCMP_ACT_KILL_PROCESS for SystemCallFilter= behaviour
Lennart Poettering [Mon, 29 Apr 2019 10:03:58 +0000 (12:03 +0200)] 
core: prefer SCMP_ACT_KILL_PROCESS for SystemCallFilter= behaviour

If we have it, use it. It makes a ton more sense.

Fixes: #11967
4 years agoseccomp: add scmp_act_kill_process() helper that returns SCMP_ACT_KILL_PROCESS if...
Lennart Poettering [Mon, 29 Apr 2019 09:54:00 +0000 (11:54 +0200)] 
seccomp: add scmp_act_kill_process() helper that returns SCMP_ACT_KILL_PROCESS if supported

4 years agoMerge pull request #12601 from keszybz/two-log-color-adjustments
Lennart Poettering [Fri, 24 May 2019 08:43:07 +0000 (10:43 +0200)] 
Merge pull request #12601 from keszybz/two-log-color-adjustments

Two log color adjustments