]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agocore/cgroup: fix return value of unit_cgorup_freezer_action()
Michal Sekletar [Thu, 7 May 2020 15:23:30 +0000 (17:23 +0200)] 
core/cgroup: fix return value of unit_cgorup_freezer_action()

We should return 0 only if current freezer state, as reported by the
kernel, is already the desired state. Otherwise, we would dispatch
return dbus message prematurely in bus_unit_method_freezer_generic().

Thanks to Frantisek Sumsal for reporting the issue.

3 years agoMerge pull request #15745 from keszybz/one-more-specifier
Lennart Poettering [Thu, 7 May 2020 20:18:59 +0000 (22:18 +0200)] 
Merge pull request #15745 from keszybz/one-more-specifier

Add %l as specifier for short hostname

3 years agoMerge pull request #15713 from poettering/home-discard-when-offline
Lennart Poettering [Thu, 7 May 2020 17:17:48 +0000 (19:17 +0200)] 
Merge pull request #15713 from poettering/home-discard-when-offline

homed: optionally, issue FITRIM ioctl when logging out

3 years agomeson: re-run ninja update-man-rules
Lennart Poettering [Thu, 7 May 2020 13:07:26 +0000 (15:07 +0200)] 
meson: re-run ninja update-man-rules

Split out of #15703, because it has nothing to do with that.

Follow-up for: 4f07ddfa9bc2242eaa6c288a15b8bce4e4383931

3 years agoMerge pull request #15681 from vcaputo/buslocator
Vito Caputo [Thu, 7 May 2020 16:46:01 +0000 (09:46 -0700)] 
Merge pull request #15681 from vcaputo/buslocator

*: switch to BusLocator-oriented helpers

3 years agotimedate: switch to BusLocator-oriented helpers 15681/head
Vito Caputo [Sun, 3 May 2020 07:03:16 +0000 (00:03 -0700)] 
timedate: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agosystemctl: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:55:24 +0000 (23:55 -0700)] 
systemctl: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agorun: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:41:14 +0000 (23:41 -0700)] 
run: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agoresolve: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:39:14 +0000 (23:39 -0700)] 
resolve: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agoportable: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:27:35 +0000 (23:27 -0700)] 
portable: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agonss-resolve: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:23:50 +0000 (23:23 -0700)] 
nss-resolve: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agonss-mymachines: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:21:31 +0000 (23:21 -0700)] 
nss-mymachines: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agonspawn: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:18:27 +0000 (23:18 -0700)] 
nspawn: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agonetwork: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:14:23 +0000 (23:14 -0700)] 
network: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agomount: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:11:33 +0000 (23:11 -0700)] 
mount: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agomachine: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 06:04:27 +0000 (23:04 -0700)] 
machine: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agologin: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 05:52:38 +0000 (22:52 -0700)] 
login: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agolocale: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 05:45:52 +0000 (22:45 -0700)] 
locale: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agoanalyze: switch to BusLocator-oriented helpers
Vito Caputo [Sun, 3 May 2020 05:41:12 +0000 (22:41 -0700)] 
analyze: switch to BusLocator-oriented helpers

Mechanical substitution reducing some verbosity

3 years agohome: switch to shared bus_home_mgr
Vito Caputo [Thu, 7 May 2020 07:58:25 +0000 (00:58 -0700)] 
home: switch to shared bus_home_mgr

Largely mechanical change; s/&home_mgr/bus_home_mgr/g

3 years agobus: introduce bus-locator.[ch]
Vito Caputo [Thu, 7 May 2020 08:16:59 +0000 (01:16 -0700)] 
bus: introduce bus-locator.[ch]

Move BusLocator into its own header, introduce collection of
locators for use throughout the code.

3 years agotest-specifier: add a simple test which prints "global" specifiers 15745/head
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 14:25:36 +0000 (16:25 +0200)] 
test-specifier: add a simple test which prints "global" specifiers

...i.e. those which can be resolved without a context parameter.

3 years agoAdd %l as specifier for the hostname without any domain component
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 14:16:19 +0000 (16:16 +0200)] 
Add %l as specifier for the hostname without any domain component

As described in #15603, it is a fairly common setup to use a fqdn as the
configured hostname. But it is often convenient to use just the actual
hostname, i.e. until the first dot. This adds support in tmpfiles, sysusers,
and unit files for %l which expands to that.

Fixes #15603.

3 years agoAdd a basic test that the configured fallback hostname is OK
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 15:30:02 +0000 (17:30 +0200)] 
Add a basic test that the configured fallback hostname is OK

Ideally, assert_cc() would be used for this, so that it is not possible to even
compile systemd with something like '-Dfallback-hostname=.foo'. But to do a
proper check we need to call hostname_is_valid(), and we cannot depend on being
able to run code (e.g. during cross-compilation). So let's do a very superficial
check in meson, and a proper on in test-util.

3 years agoMerge pull request #15635 from keszybz/set-put-strdup
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 15:01:59 +0000 (17:01 +0200)] 
Merge pull request #15635 from keszybz/set-put-strdup

Let set_put_strdup() allocate the set and related changes

3 years agoMerge pull request #15714 from poettering/homed-key-mgmt-doc
Lennart Poettering [Thu, 7 May 2020 14:39:54 +0000 (16:39 +0200)] 
Merge pull request #15714 from poettering/homed-key-mgmt-doc

man: document homed key management

3 years agoman: put all pages which mention a specifier in the index
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 13:05:29 +0000 (15:05 +0200)] 
man: put all pages which mention a specifier in the index

I wasn't 100% convinced that this is the right thing to do, hence the separate
commit. But e.g. for paths we index all mentions, so I think it's reasonable to
do the same here.

3 years agoman: fix indentation in sysusers.d.xml
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 13:02:02 +0000 (15:02 +0200)] 
man: fix indentation in sysusers.d.xml

3 years agoupdate TODO 15713/head
Lennart Poettering [Tue, 5 May 2020 13:20:10 +0000 (15:20 +0200)] 
update TODO

3 years agodocs: document the new offline discard logic
Lennart Poettering [Tue, 5 May 2020 16:48:47 +0000 (18:48 +0200)] 
docs: document the new offline discard logic

3 years agohomework: run fitrim or fallocate on logout based on the new user record property
Lennart Poettering [Tue, 5 May 2020 13:13:20 +0000 (15:13 +0200)] 
homework: run fitrim or fallocate on logout based on the new user record property

3 years agohomectl: add option for controlling new luksOfflineDiscard user record field
Lennart Poettering [Tue, 5 May 2020 13:12:55 +0000 (15:12 +0200)] 
homectl: add option for controlling new luksOfflineDiscard user record field

3 years agouser-record: add new field for requesting LUKS discard on logout
Lennart Poettering [Tue, 5 May 2020 13:05:59 +0000 (15:05 +0200)] 
user-record: add new field for requesting LUKS discard on logout

We make this entirely independent of the regular discard field, i.e. the
one that controls discard behaviour when the home directory is online.
Not all combinations make a ridiculous amount of sense, but most do.
Specifically:

online-discard = yes, offline-discard = yes
       → Discard when activating explicitly, and during runtime using
       the "discard" mount option, and discard explicitly when logging
       out again.

online-discard = no, offline-discard = yes
       → The new default: when logging in allocate the full backing
       store, and use no discard while active. When loging out discard
       everything. This provides nice behaviour: we take minimal storage
       when offline but provide allocation guarantees while online.

online-discard = no, offline-discard = no
       → Never, ever discard, always operate with fully allocated
       backing store. The extra safe mode.

3 years agohomed: allow overriding homework path via env var
Lennart Poettering [Tue, 5 May 2020 16:27:37 +0000 (18:27 +0200)] 
homed: allow overriding homework path via env var

Let's make debugging a bit easier: when invoking homed from the build
tree it's now possible to make sure homed invokes the build tree's
homework binary by setting an env var.

3 years agoupdate TODO 15714/head
Lennart Poettering [Tue, 5 May 2020 17:36:21 +0000 (19:36 +0200)] 
update TODO

3 years agoman: document homed key management
Lennart Poettering [Tue, 5 May 2020 17:33:27 +0000 (19:33 +0200)] 
man: document homed key management

Fixes: #15235
3 years agoman: add specifiers section to directives index
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 12:59:24 +0000 (14:59 +0200)] 
man: add specifiers section to directives index

The hack with getparent().txt is not very pretty, but the whole
thing seems to work well enough. It is useful to figure out whihc
specifiers are supported where.

3 years agotools: move directive index template to separate file
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 12:31:13 +0000 (14:31 +0200)] 
tools: move directive index template to separate file

In the beginning, it was rather short, and reasonable to include inline.
Now it is long and unwieldy, let's split it out.

While at it, let's reindent and wrap using our current standards.

3 years agoman: update rules
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 12:05:17 +0000 (14:05 +0200)] 
man: update rules

Forgotten in 4f07ddfa9bc2242eaa6c288a15b8bce4e4383931.

3 years agomeson: rename make-man-rules.py to update-man-rules.py
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 12:01:09 +0000 (14:01 +0200)] 
meson: rename make-man-rules.py to update-man-rules.py

The name of the helper didn't match the name of the meson target, which was
always confusing me. With this change, we consistenly use "update" to
re-generate things which we otherwise keep in vc, and "make" for things
which are generated during each build.

3 years agomeson: drop "meson-" prefix from various helper script filenames
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 11:54:10 +0000 (13:54 +0200)] 
meson: drop "meson-" prefix from various helper script filenames

In a few cases, the prefix was originally necessary because a different helper
script was used for automake, and a different one for meson. But now we use
meson exclusively, and the prefix isn't useful. This also synchronizes the
target name, file name, and variable name in meson.build. The targets exposed
by meson didn't have the prefix, so the user interface is unchanged.

(The prefix is retained in the few tools that are used for meson itself,
e.g. meosn-vcs-tag.sh, meson-make-symlink.sh, etc.)

3 years agoman: suffix pam options with "=" where arg is required too
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 11:28:39 +0000 (13:28 +0200)] 
man: suffix pam options with "=" where arg is required too

3 years agoRevert "Add Kensington SlimBlade Trackball"
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 11:10:25 +0000 (13:10 +0200)] 
Revert "Add Kensington SlimBlade Trackball"

This reverts commit 8049c79b654f9c00da883423813ec25b7b54f3d6.

3 years agoresolved: Fix build error due to missing include.
Daan De Meyer [Thu, 7 May 2020 09:51:02 +0000 (11:51 +0200)] 
resolved: Fix build error due to missing include.

3 years agonetlink socket correct check (#15720)
gaurav [Thu, 7 May 2020 07:55:31 +0000 (03:55 -0400)] 
netlink socket correct check (#15720)

3 years agohomectl: show disk free in percent in 'inspect'
Lennart Poettering [Wed, 6 May 2020 20:43:54 +0000 (22:43 +0200)] 
homectl: show disk free in percent in 'inspect'

3 years agoMerge pull request #15733 from benjarobin/fix_warn_ndebug
Zbigniew Jędrzejewski-Szmek [Thu, 7 May 2020 07:47:19 +0000 (09:47 +0200)] 
Merge pull request #15733 from benjarobin/fix_warn_ndebug

Allow to build without any warning with NDEBUG defined + Bugfix

3 years agotree-wide: Workaround -Wnonnull GCC bug
Benjamin Robin [Wed, 6 May 2020 19:24:05 +0000 (21:24 +0200)] 
tree-wide: Workaround -Wnonnull GCC bug

See issue #6119

3 years agohomed: open up home dir Acquire operation to unpriv clients
Lennart Poettering [Wed, 6 May 2020 15:54:35 +0000 (17:54 +0200)] 
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
3 years agoresolved: Break include cycles
Daan De Meyer [Wed, 6 May 2020 17:10:59 +0000 (19:10 +0200)] 
resolved: Break include cycles

3 years agomeson: Do not drop warnings (unused variable) when NDEBUG is defined 15733/head
Benjamin Robin [Wed, 6 May 2020 21:02:39 +0000 (23:02 +0200)] 
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

3 years agoresize-fs: Use xsprintf instead of snprintf
Benjamin Robin [Wed, 6 May 2020 20:58:24 +0000 (22:58 +0200)] 
resize-fs: Use xsprintf instead of snprintf

3 years agotest: Use assert_se() where variables are only checked by assert
Benjamin Robin [Wed, 6 May 2020 18:32:27 +0000 (20:32 +0200)] 
test: Use assert_se() where variables are only checked by assert

Allow to build without any warning with NDEBUG defined

3 years agotree-wide: Fix, replace assert() by assert_se() when there is side effect
Benjamin Robin [Wed, 6 May 2020 18:30:43 +0000 (20:30 +0200)] 
tree-wide: Fix, replace assert() by assert_se() when there is side effect

3 years agotree-wide: Mark as _unused_ variables that are only used in assert()
Benjamin Robin [Wed, 6 May 2020 18:29:31 +0000 (20:29 +0200)] 
tree-wide: Mark as _unused_ variables that are only used in assert()

Allow to build without any warning with NDEBUG defined

3 years agoMerge pull request #15735 from poettering/pam-snippet-update
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2020 20:45:29 +0000 (22:45 +0200)] 
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

3 years agoMerge pull request #15727 from poettering/systemctl-list-sockets-tweak
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2020 20:38:25 +0000 (22:38 +0200)] 
Merge pull request #15727 from poettering/systemctl-list-sockets-tweak

systemctl: some table output tweaks

3 years agoman: bring example PAM snippet of pam_systemd and pam_systemd_home back in sync 15735/head
Lennart Poettering [Wed, 6 May 2020 20:28:37 +0000 (22:28 +0200)] 
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.

3 years agoman: highlight relevant lines in pam_systemd_home.so example PAM snippet
Lennart Poettering [Wed, 6 May 2020 20:26:54 +0000 (22:26 +0200)] 
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.

3 years agologin: include pam_systemd_home.so in the default PAM snippet we ship for user@.service
Lennart Poettering [Wed, 6 May 2020 20:25:34 +0000 (22:25 +0200)] 
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.

3 years agotest: Skip test-boot-timestamps on permission denied
Balint Reczey [Tue, 5 May 2020 19:24:53 +0000 (21:24 +0200)] 
test: Skip test-boot-timestamps on permission denied

In containers even root can be denied to access the needed files.

3 years agohwdb: Force "mouse" type on Logitech Ultrathin Touch Mouse
Bastien Nocera [Tue, 5 May 2020 14:38:37 +0000 (16:38 +0200)] 
hwdb: Force "mouse" type on Logitech Ultrathin Touch Mouse

Closes: #15657
3 years agotree-wide: use _cleanup_set_free_ where appropriate 15635/head
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 12:53:26 +0000 (14:53 +0200)] 
tree-wide: use _cleanup_set_free_ where appropriate

If we already have the helper defined, let's use it instead of open-coding.

3 years agoshared/logs-show: constify Set *fields
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 12:47:48 +0000 (14:47 +0200)] 
shared/logs-show: constify Set *fields

3 years agosd-device: get rid of device_enumerator_clear_match_parent
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 12:44:25 +0000 (14:44 +0200)] 
sd-device: get rid of device_enumerator_clear_match_parent

This helper wasn't helping all that much. It seems better to verify args
first, and only then start modifying the state.

3 years agosd-device: optimize addition of already present matches
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 12:33:51 +0000 (14:33 +0200)] 
sd-device: optimize addition of already present matches

Our hashmap and set helpers return a different code whenever an entry
already exists, so let's use this to avoid unsetting scan_uptodate when
not necessary.

Thus, the return convention for
sd_device_enumerator_add_match_subsystem,
sd_device_enumerator_add_match_sysattr,
sd_device_enumerator_add_match_property,
sd_device_enumerator_add_match_sysname,
sd_device_enumerator_add_match_tag,
device_enumerator_add_match_parent_incremental,
sd_device_enumerator_add_match_parent,
sd_device_enumerator_allow_uninitialized,
device_enumerator_add_match_is_initialized
is that "1" is returned if action was taken, and "0" on noop.

3 years agosd-device: use hashmap_put_strdup()
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 12:28:56 +0000 (14:28 +0200)] 
sd-device: use hashmap_put_strdup()

3 years agobasic/hashmap: allow NULL values in strdup hashmaps and add test
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 07:55:28 +0000 (09:55 +0200)] 
basic/hashmap: allow NULL values in strdup hashmaps and add test

3 years agosd-device: use string hash ops in device enumerator
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 07:01:18 +0000 (09:01 +0200)] 
sd-device: use string hash ops in device enumerator

There should be no functional change, except that when the same string is
added more than once, we skip the duplicate entries.

3 years agotest-set: make test-set not link to libshared and test test_set_put_strdup*()
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 06:50:37 +0000 (08:50 +0200)] 
test-set: make test-set not link to libshared and test test_set_put_strdup*()

The sets are such basic functionality that it is convenient to be able to
build test-set without all the machinery in shared, and to test it without
the mempool to validate memory accesses easier.

3 years agobasic/set: let set_put_strdup() create the set with string hash ops
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 06:47:51 +0000 (08:47 +0200)] 
basic/set: let set_put_strdup() create the set with string hash ops

If we're using a set with _put_strdup(), most of the time we want to use
string hash ops on the set, and free the strings when done. This defines
the appropriate a new string_hash_ops_free structure to automatically free
the keys when removing the set, and makes set_put_strdup() and set_put_strdupv()
instantiate the set with those hash ops.

hashmap_put_strdup() was already doing something similar.

(It is OK to instantiate the set earlier, possibly with a different hash ops
structure. set_put_strdup() will then use the existing set. It is also OK
to call set_free_free() instead of set_free() on a set with
string_hash_ops_free, the effect is the same, we're just overriding the
override of the cleanup function.)

No functional change intended.

3 years agosystemctl: underline whole rows, gapless 15727/head
Lennart Poettering [Wed, 6 May 2020 13:37:33 +0000 (15:37 +0200)] 
systemctl: underline whole rows, gapless

Just some tweaking of the output.

3 years agoformat-table: support coloring the gap right of each cell individually
Lennart Poettering [Wed, 6 May 2020 13:36:50 +0000 (15:36 +0200)] 
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.

3 years agosystemctl: ensure underline for "list-unit-files" empty cells
Lennart Poettering [Wed, 6 May 2020 12:56:37 +0000 (14:56 +0200)] 
systemctl: ensure underline for "list-unit-files" empty cells

3 years agosystemctl: let's tweak how we synthesize a cell for activating unit
Lennart Poettering [Wed, 6 May 2020 12:48:54 +0000 (14:48 +0200)] 
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.

3 years agosystemctl: change column name in "list-sockets" out from "units" to "unit"
Lennart Poettering [Wed, 6 May 2020 12:48:14 +0000 (14:48 +0200)] 
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.

3 years agosystemctl: show empty cells as '-'
Lennart Poettering [Wed, 6 May 2020 12:47:46 +0000 (14:47 +0200)] 
systemctl: show empty cells as '-'

This is mostly relevant for "systemct list-sockets" which can have empty
cells for the activating unit.

3 years agoformat-table: display an empty strv cell the same way as an empty cell
Lennart Poettering [Wed, 6 May 2020 12:46:37 +0000 (14:46 +0200)] 
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.

3 years agoresolve: fix type of parameter and update man page
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2020 13:02:38 +0000 (15:02 +0200)] 
resolve: fix type of parameter and update man page

The "a" got dropped in eff7c2d3c905dec9ea4e1d5e53a0efd6af7d3d26.

3 years agoMerge pull request #15473 from keszybz/bus-introspection
Zbigniew Jędrzejewski-Szmek [Wed, 6 May 2020 13:00:07 +0000 (15:00 +0200)] 
Merge pull request #15473 from keszybz/bus-introspection

3 years agosocket-proxy: Support exit-on-idle
Eric Anderson [Sat, 2 May 2020 22:54:24 +0000 (15:54 -0700)] 
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

3 years agoUpdate the rsync command in CONVERTING_TO_HOMED
Gergely Polonkai [Wed, 6 May 2020 08:49:39 +0000 (08:49 +0000)] 
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.

3 years agosd-bus: Add a nicer way of specifying sd-bus vtable method arguments
Daan De Meyer [Tue, 28 Apr 2020 17:04:33 +0000 (19:04 +0200)] 
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.

3 years agobuild-system: bring back 'nonnull'
Evgeny Vereshchagin [Tue, 5 May 2020 11:10:56 +0000 (11:10 +0000)] 
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

3 years agosysusers: be extra careful when locking accounts
Lennart Poettering [Tue, 5 May 2020 19:46:56 +0000 (21:46 +0200)] 
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.

3 years agoman: update login1(5) for SetType() 15473/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 May 2020 21:03:36 +0000 (23:03 +0200)] 
man: update login1(5) for SetType()

Added in db72aea4a952cdfdef51eda03408d7c4a11e7359.

3 years agoman: add stub for home1(5)
Zbigniew Jędrzejewski-Szmek [Sun, 3 May 2020 08:19:53 +0000 (10:19 +0200)] 
man: add stub for home1(5)

3 years agohomed: convert to the new scheme and add --bus-introspect
Zbigniew Jędrzejewski-Szmek [Sun, 3 May 2020 08:05:06 +0000 (10:05 +0200)] 
homed: convert to the new scheme and add --bus-introspect

3 years agoMerge pull request #15692 from keszybz/preset-cleanup
Lennart Poettering [Wed, 6 May 2020 06:19:37 +0000 (08:19 +0200)] 
Merge pull request #15692 from keszybz/preset-cleanup

Make systemctl list-unit-files output more useful

3 years agoman: add description of org.freedesktop.LogControl1
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2020 19:04:43 +0000 (21:04 +0200)] 
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.

3 years agomeson: add man/update-dbus-docs target
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2020 18:12:03 +0000 (20:12 +0200)] 
meson: add man/update-dbus-docs target

3 years agoman: drop LogLevel from resolve1(5)
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2020 15:55:11 +0000 (17:55 +0200)] 
man: drop LogLevel from resolve1(5)

Removed in 4c4520789d2bfa3fa51b38b826cac2efb5a4d252.

3 years agoman: drop CanMultiSession from documention
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2020 15:54:28 +0000 (17:54 +0200)] 
man: drop CanMultiSession from documention

Removed in 8f8cc84ba4612e74cd1e26898c6816e6e60fc4e9.

3 years agoman: use --bus-introspect to autogenerate dbus api docs
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2020 10:08:10 +0000 (12:08 +0200)] 
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.)

3 years agoupdate-dbus-docs: use executables in build/
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2020 10:09:07 +0000 (12:09 +0200)] 
update-dbus-docs: use executables in build/

3 years agopid1: add --bus-introspect
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2020 21:50:31 +0000 (23:50 +0200)] 
pid1: add --bus-introspect

3 years agopid1: convert to the new scheme
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2020 21:50:12 +0000 (23:50 +0200)] 
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.

3 years agomachined: convert to the new scheme and add --bus-introspect
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2020 12:21:46 +0000 (14:21 +0200)] 
machined: convert to the new scheme and add --bus-introspect

3 years agolocaled: convert to the new scheme and add --bus-introspect
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2020 12:10:33 +0000 (14:10 +0200)] 
localed: convert to the new scheme and add --bus-introspect

3 years agohostnamed: convert to the new scheme and add --bus-introspect
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2020 12:08:16 +0000 (14:08 +0200)] 
hostnamed: convert to the new scheme and add --bus-introspect