Commit Graph

44576 Commits

Author SHA1 Message Date
Lennart Poettering 1f7c6f906b update TODO 2020-05-07 15:46:00 +02:00
Lennart Poettering 6d68a0b3dd man: document homed key management
Fixes: #15235
2020-05-07 15:46:00 +02:00
Zbigniew Jędrzejewski-Szmek 6bae4b905c Revert "Add Kensington SlimBlade Trackball"
This reverts commit 8049c79b65.
2020-05-07 13:11:41 +02:00
Daan De Meyer d402edb764 resolved: Fix build error due to missing include. 2020-05-07 03:05:50 -07:00
gaurav 48a3b5c6db
netlink socket correct check (#15720) 2020-05-07 09:55:31 +02:00
Lennart Poettering f5b7d681c7 homectl: show disk free in percent in 'inspect' 2020-05-07 09:52:56 +02:00
Zbigniew Jędrzejewski-Szmek 354722dde4
Merge pull request #15733 from benjarobin/fix_warn_ndebug
Allow to build without any warning with NDEBUG defined + Bugfix
2020-05-07 09:47:19 +02:00
Benjamin Robin 08f468567d tree-wide: Workaround -Wnonnull GCC bug
See issue #6119
2020-05-07 09:43:28 +02:00
Lennart Poettering ba876a4c8d homed: open up home dir Acquire operation to unpriv clients
Apparently unpriv clients expect to be able to auth via PAM. Kinda
sucks. But it is what it is. Hence open this up.

This shouldn't be too bad in effect since clients after all need to
provide security creds for unlocking the home dir, in order to misuse
this.

Fixes: #15072
2020-05-07 09:43:02 +02:00
Daan De Meyer be28f72d6a resolved: Break include cycles 2020-05-07 09:00:48 +02:00
Benjamin Robin 0454681395 meson: Do not drop warnings (unused variable) when NDEBUG is defined
This is no longer needed, since there is now no warning with NDEBUG
defined
2020-05-06 23:03:25 +02:00
Benjamin Robin 683d0bc041 resize-fs: Use xsprintf instead of snprintf 2020-05-06 23:03:25 +02:00
Benjamin Robin 060d9c61b6 test: Use assert_se() where variables are only checked by assert
Allow to build without any warning with NDEBUG defined
2020-05-06 23:03:25 +02:00
Benjamin Robin f391597c67 tree-wide: Fix, replace assert() by assert_se() when there is side effect 2020-05-06 23:03:25 +02:00
Benjamin Robin 0a0e594a26 tree-wide: Mark as _unused_ variables that are only used in assert()
Allow to build without any warning with NDEBUG defined
2020-05-06 23:03:25 +02:00
Zbigniew Jędrzejewski-Szmek 96249bf8d6
Merge pull request #15735 from poettering/pam-snippet-update
Slightly update our shipped and suggested PAM snippets, so that pam_systemd_home.so is more likely to just work
2020-05-06 22:45:29 +02:00
Zbigniew Jędrzejewski-Szmek a06df2a4bd
Merge pull request #15727 from poettering/systemctl-list-sockets-tweak
systemctl: some table output tweaks
2020-05-06 22:38:25 +02:00
Lennart Poettering 4ad5bf7865 man: bring example PAM snippet of pam_systemd and pam_systemd_home back in sync
Let's make it the same snippet, just highlight different lines.
2020-05-06 22:30:43 +02:00
Lennart Poettering c6472bb019 man: highlight relevant lines in pam_systemd_home.so example PAM snippet
let's do this like we do in the NSS module man pages.
2020-05-06 22:30:27 +02:00
Lennart Poettering bd685faa1a login: include pam_systemd_home.so in the default PAM snippet we ship for user@.service
Let's make sure systemd-homed works out-of-the box as well as possible.
2020-05-06 22:30:07 +02:00
Balint Reczey e48471b948 test: Skip test-boot-timestamps on permission denied
In containers even root can be denied to access the needed files.
2020-05-06 22:01:50 +02:00
Bastien Nocera 259f0dfbec hwdb: Force "mouse" type on Logitech Ultrathin Touch Mouse
Closes: #15657
2020-05-06 21:09:29 +02:00
Lennart Poettering 1fab579743 systemctl: underline whole rows, gapless
Just some tweaking of the output.
2020-05-06 15:40:15 +02:00
Lennart Poettering b0395c1176 format-table: support coloring the gap right of each cell individually
This is useful for underlining a whole row of cells: previously we
couldn't underline the gap. Now we can.
2020-05-06 15:40:15 +02:00
Lennart Poettering 45d82c3f1c systemctl: ensure underline for "list-unit-files" empty cells 2020-05-06 15:40:15 +02:00
Lennart Poettering 50098d87fb systemctl: let's tweak how we synthesize a cell for activating unit
Let's create a string cell for the unit if possible (since there can
only be one unit right now, and the JSON alternative output then
generates a string instead of an array for us), an empty cell if empty.
2020-05-06 15:40:15 +02:00
Lennart Poettering bc04bb0d29 systemctl: change column name in "list-sockets" out from "units" to "unit"
All our other tables call the field in singular, hence let's do so here,
too.
2020-05-06 15:40:15 +02:00
Lennart Poettering 0773357ad1 systemctl: show empty cells as '-'
This is mostly relevant for "systemct list-sockets" which can have empty
cells for the activating unit.
2020-05-06 15:40:15 +02:00
Lennart Poettering 557b0841b7 format-table: display an empty strv cell the same way as an empty cell
An empty list conceptually is very close to null, hence let's show it
the same way, i.e. using the defined "empty" string, and greyed out.
2020-05-06 15:40:15 +02:00
Zbigniew Jędrzejewski-Szmek 0894f08bf1 resolve: fix type of parameter and update man page
The "a" got dropped in eff7c2d3c9.
2020-05-06 15:02:38 +02:00
Zbigniew Jędrzejewski-Szmek ba5a389d24 Merge pull request #15473 from keszybz/bus-introspection 2020-05-06 15:00:07 +02:00
Eric Anderson 9e12d5bf63 socket-proxy: Support exit-on-idle
This adds the --exit-idle-time argument that causes
systemd-socket-proxyd to exit when there has been an idle period. An
open connection prevents the idle period from starting, even if there is
no activity on that connection.

When combined with another service that uses StopWhenUnneeded=, the
proxy exiting can trigger a resource-intensive process to exit. So
although the proxy may consume minimal resources, significant resources
can be saved indirectly.

Fixes #2106
2020-05-06 13:58:57 +02:00
Gergely Polonkai c28904dae0 Update the rsync command in CONVERTING_TO_HOMED
The old version of this command will delete everything under the new home directory (including `.identity`), rendering the directory unusable with homed.
2020-05-06 10:52:22 +02:00
Daan De Meyer eff7c2d3c9 sd-bus: Add a nicer way of specifying sd-bus vtable method arguments
SD_BUS_NAMES_WITH_ARGS is a less error-prone way of specifying D-Bus
method arguments.
2020-05-06 10:22:54 +02:00
Evgeny Vereshchagin 7f3a5eb70e build-system: bring back 'nonnull'
Having taken a look at https://github.com/systemd/systemd/runs/645252074?check_suite_focus=true
where fuzz-journal-remote failed with
```
AddressSanitizer:DEADLYSIGNAL
=================================================================
==16==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f864f98948e bp 0x7ffde5c6b7c0 sp 0x7ffde5c6b560 T0)
==16==The signal is caused by a READ memory access.
==16==Hint: address points to the zero page.
SCARINESS: 10 (null-deref)
    #0 0x7f864f98948e in output_short /work/build/../../src/systemd/src/shared/logs-show.c
    #1 0x7f864f984624 in show_journal_entry /work/build/../../src/systemd/src/shared/logs-show.c:1154:15
    #2 0x7f864f984b63 in show_journal /work/build/../../src/systemd/src/shared/logs-show.c:1239:21
    #3 0x4cabab in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-journal-remote.c:67:21
    #4 0x51fd16 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:556:15
    #5 0x51c330 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:470:3
    #6 0x523700 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__1::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/libfuzzer/FuzzerLoop.cpp:765:7
    #7 0x5246cd in fuzzer::Fuzzer::Loop(std::__1::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/libfuzzer/FuzzerLoop.cpp:792:3
    #8 0x4de3d1 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:824:6
    #9 0x4cfb47 in main /src/libfuzzer/FuzzerMain.cpp:19:10
    #10 0x7f864e69782f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #11 0x41f2a8 in _start (out/fuzz-journal-remote+0x41f2a8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /work/build/../../src/systemd/src/shared/logs-show.c in output_short
==16==ABORTING
MS: 0 ; base unit: 0000000000000000000000000000000000000000
0x44,0x3d,0xa,0x5f,0x5f,0x52,0x45,0x41,0x4c,0x54,0x49,0x4d,0x45,0x5f,0x54,0x49,0x4d,0x45,0x53,0x54,0x41,0x4d,0x50,0x3d,0x31,0xa,0xa,
D=\x0a__REALTIME_TIMESTAMP=1\x0a\x0a
artifact_prefix='./'; Test unit written to ./crash-d635b9dd31cceff3c912fd45e1a58d7e90f0ad73
Base64: RD0KX19SRUFMVElNRV9USU1FU1RBTVA9MQoK
```
I was wondering why it hadn't been caught by the compiler even though clang should have failed to compile it with
```
../src/shared/logs-show.c:624:25: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
                        print_multiline(f, 4 + fieldlen + 1, 0, OUTPUT_FULL_WIDTH, 0, false,
                        ^
../src/shared/logs-show.c:161:24: note: callee declares array parameter as static here
                size_t highlight[static 2]) {
                       ^        ~~~~~~~~~~
../src/shared/logs-show.c:1239:21: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
                r = show_journal_entry(f, j, mode, n_columns, flags, NULL, NULL, ellipsized);
                    ^                                                      ~~~~
../src/shared/logs-show.c:1133:30: note: callee declares array parameter as static here
                const size_t highlight[static 2],
                             ^        ~~~~~~~~~~
2 warnings generated.
```

Given that judging by https://github.com/systemd/systemd/issues/13039 it doesn't seem to be
the first time issues like that have been missed I think it would be better to turn nonnull on
and get around false positives on a case-by-case basis with DISABLE_WARNING_NONNULL .. REENABLE_WARNING

Reopens https://github.com/systemd/systemd/issues/6119
2020-05-06 09:50:57 +02:00
Lennart Poettering fc58c0c7bf sysusers: be extra careful when locking accounts
Let's use "!*" instead of "!!" as invalid password string.

Generally, any invalid password string can be used to for locking an
account, according to shadow(5). To temporarily lock a password of an
account it is commonly implemented to prefix the original password with
a single "!", so that it can later on be unlocked again by removing the
"!", restoring the original password. Thus, the "!" marker is an
indicator for a locked password; the act of prefixing "!" to a
password string is the locking operation; and the removal of a "!"
prefix is the unlock operation. (This is also suggested in shadow(5)).

If we want to entirely lock an account we previously used "!!" as
password string. This is nice since it indicates the password is locked.
However, it is less than ideal, since applying the password unlock
operation once will change the string to "!", which is still a locked
password. Unlocking the password a second time will result in "", i.e.
the empty password, which will in many cases allow logging in without
password. And that's a problem. Hopefully, tools do not allow such
duplicate unlocking, but it's still not a nice property.

By changing our password string to "!*" we get different behaviour: the
password will appear locked. When it is unlocked the password is "*"
which is an invalid password. In that case the password is hence
unlocked but invalid, which is a much better state to be in than the
above.

This is paranoia hardening. Not more. There's no report that anyone
every unlocked an account twice and people could log in.
2020-05-06 09:44:35 +02:00
Zbigniew Jędrzejewski-Szmek b61cc5fdad man: update login1(5) for SetType()
Added in db72aea4a9.
2020-05-06 09:13:42 +02:00
Zbigniew Jędrzejewski-Szmek b856b346c1 man: add stub for home1(5) 2020-05-06 09:13:42 +02:00
Zbigniew Jędrzejewski-Szmek cfd508a9d6 homed: convert to the new scheme and add --bus-introspect 2020-05-06 09:13:42 +02:00
Lennart Poettering c92391f52f
Merge pull request #15692 from keszybz/preset-cleanup
Make systemctl list-unit-files output more useful
2020-05-06 08:19:37 +02:00
Zbigniew Jędrzejewski-Szmek 1a0e562a5b man: add description of org.freedesktop.LogControl1
I'm not sure if the LogTarget property is sufficiently general to be made into
a property that can be generally implemented. It is very closely tied to the internal
systemd logic. The other two seem fine thoough.
2020-05-05 22:41:23 +02:00
Zbigniew Jędrzejewski-Szmek 81e06775be meson: add man/update-dbus-docs target 2020-05-05 22:41:23 +02:00
Zbigniew Jędrzejewski-Szmek 7cb4f4145f man: drop LogLevel from resolve1(5)
Removed in 4c4520789d.
2020-05-05 22:41:23 +02:00
Zbigniew Jędrzejewski-Szmek 38b52b6918 man: drop CanMultiSession from documention
Removed in 8f8cc84ba4.
2020-05-05 22:41:23 +02:00
Zbigniew Jędrzejewski-Szmek 48f99d7c06 man: use --bus-introspect to autogenerate dbus api docs
This has the advantage that the executables are always in place and we don't
need any units to exist on the bus, so we can eventually hook this up into
a normal build system. (Probably as a build time check.)
2020-05-05 22:41:23 +02:00
Zbigniew Jędrzejewski-Szmek c351d568c3 update-dbus-docs: use executables in build/ 2020-05-05 22:41:23 +02:00
Zbigniew Jędrzejewski-Szmek 5c08257b70 pid1: add --bus-introspect 2020-05-05 22:40:44 +02:00
Zbigniew Jędrzejewski-Szmek f6e9aa9e45 pid1: convert to the new scheme
In all the other cases, I think the code was clearer with the static table.
Here, not so much. And because of the existing dump code, the vtables cannot
be made static and need to remain exported. I still think it's worth to do the
change to have the cmdline introspection, but I'm disappointed with how this
came out.
2020-05-05 22:40:37 +02:00
Zbigniew Jędrzejewski-Szmek 4faa530cf6 machined: convert to the new scheme and add --bus-introspect 2020-05-05 22:38:31 +02:00
Zbigniew Jędrzejewski-Szmek 5ceceff170 localed: convert to the new scheme and add --bus-introspect 2020-05-05 22:37:08 +02:00