]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agonetwork: add NextServer= and Filename= setting to [DHCPServer] section 22615/head
Yu Watanabe [Thu, 24 Feb 2022 17:43:40 +0000 (02:43 +0900)] 
network: add NextServer= and Filename= setting to [DHCPServer] section

Closes #4403.

3 years agosd-dhcp-server: add support to send next server and filename option for PXE boot...
Yu Watanabe [Thu, 24 Feb 2022 17:32:58 +0000 (02:32 +0900)] 
sd-dhcp-server: add support to send next server and filename option for PXE boot systems

3 years agoMerge pull request #22607 from yuwata/network-address-hash-func
Zbigniew Jędrzejewski-Szmek [Thu, 24 Feb 2022 09:28:30 +0000 (10:28 +0100)] 
Merge pull request #22607 from yuwata/network-address-hash-func

network: compare addresses more strictly

3 years agotest-network: add testcases for address property change 22607/head
Yu Watanabe [Tue, 22 Feb 2022 21:16:17 +0000 (06:16 +0900)] 
test-network: add testcases for address property change

This adds a testcase for issue #22515.

3 years agonetwork: also hash address label and broadcast address
Yu Watanabe [Wed, 23 Feb 2022 22:24:19 +0000 (07:24 +0900)] 
network: also hash address label and broadcast address

Otherwise, even if the address label and/or broadcast address are changed
in a .network file, the change will not be applied on reconfigure.

3 years agonetwork: use address_set_broadcast() at one more place
Yu Watanabe [Wed, 23 Feb 2022 22:13:31 +0000 (07:13 +0900)] 
network: use address_set_broadcast() at one more place

3 years agonetwork: set broadcast address on request
Yu Watanabe [Wed, 23 Feb 2022 22:07:02 +0000 (07:07 +0900)] 
network: set broadcast address on request

Previously, the broadcast address was set to a Address object in
address_section_verify() (or address_acquire()). But, for wireguard
interfaces, we do not use the broadcast address. The .network file may
be assigned to multiple interfaces, hence, we cannot determine if we
should set the broadcast address in address_section_verify().

This makes the broadcast address set in link_request_address().
Then, we set the broadcast address only when we need it.

3 years agonetwork: compare addresses more strictly
Yu Watanabe [Tue, 22 Feb 2022 19:10:51 +0000 (04:10 +0900)] 
network: compare addresses more strictly

This re-introduce the full hash and compre functions for Address,
which was reverted 1d30fc5cb64ecba2f03fe42aa0d8c65c3decad82 (#17851).

The issue #17831, which is fixed by #17851, is handled in a different way;
simply ignore to configure the conflicted DHCPv6 address. Previously, we
warn about the conflict, but continue to configure the address anyway, and
the kernel ignores the request. So, it is not necessary to request the
conflicted address in networkd side.

This fixes the following issues:
- when a link has an address, and corresponding .network file has the
  address with different prefix length, then the prefix length specified
  in the .network file will not be applied,
- we cannot specify multiple IPv4 addresses with different prefix
  length, e.g.
  ----
  Address=10.10.10.10/24
  Address=10.10.10.10/16
  ----
  This is spurious setup, but the kernel allows it.

Fixes #22515.

3 years agosystemctl: Show how long a service ran for after it exited in status output
Daan De Meyer [Tue, 22 Feb 2022 11:06:00 +0000 (11:06 +0000)] 
systemctl: Show how long a service ran for after it exited in status output

3 years agoMerge pull request #22591 from evverx/no-deps
Frantisek Sumsal [Wed, 23 Feb 2022 09:27:41 +0000 (09:27 +0000)] 
Merge pull request #22591 from evverx/no-deps

ci: build systemd without optional dependencies

3 years agoMerge pull request #22605 from yuwata/test-journal-send-fd-leaks
Zbigniew Jędrzejewski-Szmek [Wed, 23 Feb 2022 08:15:41 +0000 (09:15 +0100)] 
Merge pull request #22605 from yuwata/test-journal-send-fd-leaks

test-journal-send: fix fd leaks

3 years agoMerge pull request #22608 from keszybz/doc-cleanups
Zbigniew Jędrzejewski-Szmek [Wed, 23 Feb 2022 08:11:07 +0000 (09:11 +0100)] 
Merge pull request #22608 from keszybz/doc-cleanups

Man page cleanups

3 years agoMerge pull request #22414 from yuwata/resolve-synthesize-empty-domain-follow-up
Zbigniew Jędrzejewski-Szmek [Wed, 23 Feb 2022 08:10:49 +0000 (09:10 +0100)] 
Merge pull request #22414 from yuwata/resolve-synthesize-empty-domain-follow-up

resolve: follow-up for synthesizing empty name

3 years agoudev-builtin-input_id: don't label absolute mice as pointing sticks
Peter Hutterer [Tue, 22 Feb 2022 23:12:43 +0000 (09:12 +1000)] 
udev-builtin-input_id: don't label absolute mice as pointing sticks

The Getac UX10 tablet exposes a "CUST0000:00 0EEF:C002 Mouse" device
with BTN_LEFT/RIGHT and ABS_X/Y on the i2c bus. This causes the builtin
to incorrectly label it as pointing stick (all i2c mice are
tagged as ID_INPUT_POINTING_STICK, see 3d7ac1c655ec4).

Fix this by adding a separate variable for absolute pointing
devices like the VMmouse USB mouse or this Getac tablet - this way we
skip the pointing stick check.

See https://gitlab.freedesktop.org/libinput/libinput/-/issues/743
for recordings.

3 years agoMerge pull request #22600 from poettering/timestamp_is_set-more
Zbigniew Jędrzejewski-Szmek [Wed, 23 Feb 2022 07:59:49 +0000 (08:59 +0100)] 
Merge pull request #22600 from poettering/timestamp_is_set-more

make more use of timestamp_is_set()

3 years agoman: various issues reported in #22432 22608/head
Zbigniew Jędrzejewski-Szmek [Tue, 22 Feb 2022 21:54:23 +0000 (22:54 +0100)] 
man: various issues reported in #22432

Fixes #22432.

3 years agoman/systemd-network: reword descriptions of DHCPPrefixDelegation= and dst-host
Zbigniew Jędrzejewski-Szmek [Tue, 22 Feb 2022 21:56:10 +0000 (22:56 +0100)] 
man/systemd-network: reword descriptions of DHCPPrefixDelegation= and dst-host

3 years agoman/systemd-analyze: split out example to a separate section
Zbigniew Jędrzejewski-Szmek [Tue, 22 Feb 2022 21:55:42 +0000 (22:55 +0100)] 
man/systemd-analyze: split out example to a separate section

It turns out we can't have an Example nested in a list, and every
combination of nesting I tried looked bad either in troff or in html.
The whole example is moved to a separate section.

3 years agoman: adjust command for Fedora installations
Zbigniew Jędrzejewski-Szmek [Thu, 17 Feb 2022 19:34:14 +0000 (20:34 +0100)] 
man: adjust command for Fedora installations

glibc now has Suggests:glibc-minimal-langpack, so we don't
need to mention it ourselves.

--repo=… is a nicer alternative to --disablerepo=* --enablerepo=….
It also avoids the issue with quoting.

Let's exclude weak deps, but install systemd-networkd, so the container
can configure networking if necessary.

3 years agoresolve: synthesize empty domain only when A and/or AAAA key is requested 22414/head
Yu Watanabe [Fri, 4 Feb 2022 03:05:33 +0000 (12:05 +0900)] 
resolve: synthesize empty domain only when A and/or AAAA key is requested

Follow-up for 3b2ac14ac45bef01cf489c3231b868936866444b (#22231).

Before this commit.
---
$ dig -t SRV '.'

; <<>> DiG 9.16.24-RH <<>> -t SRV .
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16836
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;. IN SRV

;; Query time: 1 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Fri Feb 04 12:01:09 JST 2022
;; MSG SIZE  rcvd: 28
---

After this commit.
---
$ dig -t SRV '.'

; <<>> DiG 9.16.24-RH <<>> -t SRV .
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19861
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;. IN SRV

;; AUTHORITY SECTION:
. 86394 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2022020302 1800 900 604800 86400

;; Query time: 20 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Fri Feb 04 12:00:12 JST 2022
;; MSG SIZE  rcvd: 103
---

Fixes #22401.

3 years agoresolve: make dns_scope_good_domain() take DnsQuery*
Yu Watanabe [Tue, 22 Feb 2022 22:50:30 +0000 (07:50 +0900)] 
resolve: make dns_scope_good_domain() take DnsQuery*

3 years agoresolve: drop never matched condition
Yu Watanabe [Tue, 22 Feb 2022 22:49:40 +0000 (07:49 +0900)] 
resolve: drop never matched condition

As dns_scope_good_domain() does not return negative errno.

3 years agojournal-send: close fd on exit when running with valgrind 22605/head
Yu Watanabe [Tue, 22 Feb 2022 17:03:54 +0000 (02:03 +0900)] 
journal-send: close fd on exit when running with valgrind

Fixes an issue reported in #22576.

3 years agotest-journal-send: close fd opend by syslog()
Yu Watanabe [Tue, 22 Feb 2022 16:52:29 +0000 (01:52 +0900)] 
test-journal-send: close fd opend by syslog()

Fixes an issue reported in #22576.

3 years agoMerge pull request #22582 from medhefgo/boot-input
Luca Boccassi [Tue, 22 Feb 2022 22:11:44 +0000 (22:11 +0000)] 
Merge pull request #22582 from medhefgo/boot-input

boot: Minor input fixes

3 years agoMerge pull request #19970 from curtistklein/watchdog-pretimeout-merge
Luca Boccassi [Tue, 22 Feb 2022 22:08:09 +0000 (22:08 +0000)] 
Merge pull request #19970 from curtistklein/watchdog-pretimeout-merge

watchdog: Add watchdog pretimeout support

3 years agounit: escape %
Yu Watanabe [Tue, 22 Feb 2022 16:29:42 +0000 (01:29 +0900)] 
unit: escape %

Fixes #22601.

3 years agounits: drop After=systemd-networkd.service from systemd-resolved.service
Lennart Poettering [Tue, 22 Feb 2022 15:21:29 +0000 (16:21 +0100)] 
units: drop After=systemd-networkd.service from systemd-resolved.service

This ordering existed since resolved was first created, but there should
not be any need to order the two services against each other, as
resolved should be able to pick up networkd DNS metadata either way (as
it works with inotify in /run).

Let's drop this hence, and not cargo-cult this to eternity

Also see: https://github.com/systemd/systemd/pull/22389#issuecomment-1045978403

3 years agoMerge pull request #22596 from yuwata/test-fix-fd-leaks
Yu Watanabe [Tue, 22 Feb 2022 21:51:06 +0000 (06:51 +0900)] 
Merge pull request #22596 from yuwata/test-fix-fd-leaks

test: fix fd leaks

3 years agotree-wide: use timestamp_is_set() more 22600/head
Lennart Poettering [Tue, 22 Feb 2022 14:34:04 +0000 (15:34 +0100)] 
tree-wide: use timestamp_is_set() more

3 years agococcinelle: automatically look for timestamp_is_set candidates
Lennart Poettering [Tue, 22 Feb 2022 13:59:10 +0000 (14:59 +0100)] 
coccinelle: automatically look for timestamp_is_set candidates

Based on @mrc0mmand's Coccinelle skills, not mine. All credit is his.

Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
3 years agomeson: pass skip-deps on to the fuzzers as well 22591/head
Evgeny Vereshchagin [Tue, 22 Feb 2022 17:47:48 +0000 (17:47 +0000)] 
meson: pass skip-deps on to the fuzzers as well

they should be tested without optional dependecines as well. CIFuzz
kind of covers that but let's just make sure local builds are fine as
well.

3 years agoMerge pull request #22592 from yuwata/test-oomd-util-fixlets
Zbigniew Jędrzejewski-Szmek [Tue, 22 Feb 2022 17:25:45 +0000 (18:25 +0100)] 
Merge pull request #22592 from yuwata/test-oomd-util-fixlets

test: test-oomd-util fixlets

3 years agowatchdog: add setting to configure pretimeout governor 19970/head
Luca Boccassi [Tue, 8 Feb 2022 12:58:30 +0000 (12:58 +0000)] 
watchdog: add setting to configure pretimeout governor

3 years agowatchdog: check pretimeout governor
Curtis Klein [Sun, 10 Oct 2021 00:51:09 +0000 (17:51 -0700)] 
watchdog: check pretimeout governor

Check and log the default pretimeout governor configured in the kernel.
The pretimeout will not work unless at least one governor is available
and configured. This requires loading a kernel module manually.

3 years agowatchdog: Add watchdog pretimeout support
Curtis Klein [Sun, 27 Jun 2021 22:36:49 +0000 (15:36 -0700)] 
watchdog: Add watchdog pretimeout support

Add support for managing and configuring watchdog pretimeout values if
the watchdog hardware supports it. The ping interval is adjusted to
account for a pretimeout so that it will still ping at half the timeout
interval before a pretimeout event would be triggered. By default the
pretimeout defaults to 0s or disabled.

The RuntimeWatchdogPreSec config option is added to allow the pretimeout
to be specified (similar to RuntimeWatchdogSec). The
RuntimeWatchdogPreUSec dbus property is added to override the pretimeout
value at runtime (similar to RuntimeWatchdogUSec). Setting the
pretimeout to 0s will disable the pretimeout.

3 years agoci: fix clang-13 installation
Frantisek Sumsal [Tue, 22 Feb 2022 13:43:40 +0000 (14:43 +0100)] 
ci: fix clang-13 installation

For some reason Ubuntu Focal repositories now have `llvm-13` virtual
package which can't be installed, but successfully fools our check,
resulting in no clang/llvm being installed...

```
$ apt show llvm-13
Package: llvm-13
State: not a real package (virtual)
N: Can't select candidate version from package llvm-13 as it has no candidate
N: Can't select versions from package 'llvm-13' as it is purely virtual
N: No packages found

$ apt install --dry-run llvm-13
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package llvm-13 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'llvm-13' has no installation candidate
```

3 years agoMerge pull request #22574 from yuwata/network-dhcp-pd-fixes
Zbigniew Jędrzejewski-Szmek [Tue, 22 Feb 2022 16:53:00 +0000 (17:53 +0100)] 
Merge pull request #22574 from yuwata/network-dhcp-pd-fixes

network: dhcp-pd: fix two issues

3 years agoclang-format: we actually typically use 16ch continuation indentation
Lennart Poettering [Tue, 22 Feb 2022 15:51:58 +0000 (16:51 +0100)] 
clang-format: we actually typically use 16ch continuation indentation

We use 8 for blocks, and 16 for continuation in most cases afaics, hence
say so in .clang-format too

3 years agotest: fix file descriptor leak in test-psi-util 22596/head
Yu Watanabe [Tue, 22 Feb 2022 12:46:41 +0000 (21:46 +0900)] 
test: fix file descriptor leak in test-psi-util

Fixes an issue reported in #22576.

3 years agotest: fix file descriptor leak in test-tmpfiles.c
Yu Watanabe [Tue, 22 Feb 2022 12:44:58 +0000 (21:44 +0900)] 
test: fix file descriptor leak in test-tmpfiles.c

Also fixes a typo in assertion.

Fixes an issure reported in #22576.

3 years agotest: fix file descriptor leak in test-fs-util
Yu Watanabe [Tue, 22 Feb 2022 12:42:22 +0000 (21:42 +0900)] 
test: fix file descriptor leak in test-fs-util

Fixes an issue reported in #22576.

3 years agoci: build systemd without optional dependencies
Evgeny Vereshchagin [Tue, 22 Feb 2022 11:02:44 +0000 (11:02 +0000)] 
ci: build systemd without optional dependencies

to catch issues like https://github.com/systemd/systemd/pull/22585#issuecomment-1047640155

3 years agoboot: Handle shift and logo keys too 22582/head
Jan Janssen [Mon, 21 Feb 2022 12:45:06 +0000 (13:45 +0100)] 
boot: Handle shift and logo keys too

Some firmware supports sending input events for shift and logo keys.
Previously, we would suppress these with EFI_NOT_READY unless
some other key was pressed alongside, but it is really the job of the
caller to decide how to handle these.

Note that for keys that already have a printable shift representation
the reported input event will not have the shift key bits set
(Shift+a is reported as A). Should some firmware turn out to violate the
spec here we can always remove that part.

3 years agoboot: Properly check status code of console_key_read
Jan Janssen [Mon, 21 Feb 2022 11:52:30 +0000 (12:52 +0100)] 
boot: Properly check status code of console_key_read

In some cases there was a unlikely possibility that we would look
at an uninitialized key value.
Also, returning in case of unexpected input error cases should prevent
infinite looping.

3 years agoMerge pull request #22584 from poettering/systemctl-verb-renamed
Lennart Poettering [Tue, 22 Feb 2022 15:16:58 +0000 (16:16 +0100)] 
Merge pull request #22584 from poettering/systemctl-verb-renamed

systemctl: rename "verb" entrypoint functions systematically to verb_xyz()

3 years agoanalyze: fix build on non-seccomp builds
Lennart Poettering [Tue, 22 Feb 2022 10:40:53 +0000 (11:40 +0100)] 
analyze: fix build on non-seccomp builds

Follow-up for #22585

See: https://github.com/systemd/systemd/pull/22585#issuecomment-1047658990

3 years agosystemctl: rework daemon_reload() functions 22584/head
Lennart Poettering [Mon, 21 Feb 2022 16:11:52 +0000 (17:11 +0100)] 
systemctl: rework daemon_reload() functions

Let's split out the inner parts of verb_daemon_reload() as a function
daemon_reload() and then stop using the former outside of the verbs
logic, and instead call the latter whenever we need to reload the daemon
as auxiliary opeation.

This should make our logic more systematic as we don't have to provide
fake or misleading argc/argv to verb_daemon_reload() anymore.

3 years agosystemctl: systematically rename verb entrypoints verb_xyz()
Lennart Poettering [Mon, 21 Feb 2022 15:30:45 +0000 (16:30 +0100)] 
systemctl: systematically rename verb entrypoints verb_xyz()

Let's clean up our function naming a bit, and always name the
verb_xyz(), where the xyz maps to the command line verb as closely as
possible.

No actual code changes, just an attempt to make the systemctl sources a
bit more systematic, and less surprising.

3 years agotest: fix file descriptor leak in test-oomd-util
Yu Watanabe [Tue, 22 Feb 2022 12:38:15 +0000 (21:38 +0900)] 
test: fix file descriptor leak in test-oomd-util

Fixes an issue reported in #22576.

3 years agotest: fix memory and fd leak in test-dhcp6-client
Yu Watanabe [Tue, 22 Feb 2022 12:34:37 +0000 (21:34 +0900)] 
test: fix memory and fd leak in test-dhcp6-client

Fixes an issue reported in #22576.

3 years agotest: drop timeout handlers
Yu Watanabe [Tue, 22 Feb 2022 12:30:18 +0000 (21:30 +0900)] 
test: drop timeout handlers

Fixes file descriptor leak reported in #22576.

3 years agotest: fix file descriptor leak in test-catalog
Yu Watanabe [Tue, 22 Feb 2022 12:11:51 +0000 (21:11 +0900)] 
test: fix file descriptor leak in test-catalog

Fixes an issue reported in #22576.

3 years agonetwork: dhcp-pd: allow to assign the same subnet prefix to multiple interfaces 22574/head
Yu Watanabe [Sun, 20 Feb 2022 02:46:16 +0000 (11:46 +0900)] 
network: dhcp-pd: allow to assign the same subnet prefix to multiple interfaces

There is no reason networkd refuses that. Especially, when multiple
downstream interfaces are connected to the same network, it is natural to
assign the same subnet prefix to them.

Prompted by #22571.

3 years agonetwork: dhcp-pd: fix prefix length of address assigned to upstream interface
Yu Watanabe [Sun, 20 Feb 2022 02:23:18 +0000 (11:23 +0900)] 
network: dhcp-pd: fix prefix length of address assigned to upstream interface

This effectively revert ab0c82d9f749cc397a6b7e0327ddb2c08cd7d7e0.

I have no idea why I did that...

Fixes #22559.

3 years agotest-oomd-util: fix conditional jump on uninitialised value 22592/head
Yu Watanabe [Tue, 22 Feb 2022 11:23:58 +0000 (20:23 +0900)] 
test-oomd-util: fix conditional jump on uninitialised value

Fixes #22577.

3 years agotest-oomd-util: style fixlets
Yu Watanabe [Tue, 22 Feb 2022 11:21:45 +0000 (20:21 +0900)] 
test-oomd-util: style fixlets

3 years agomeson: allow skipping optional dependencies
Evgeny Vereshchagin [Tue, 22 Feb 2022 10:49:46 +0000 (10:49 +0000)] 
meson: allow skipping optional dependencies

mostly to make sure that systemd is buildable without some dependencies
but other than that it should make it easier to build it with MSan without
having to compile all the dependencies with MSan.

3 years agocore: really skip automatic restart when a JOB_STOP job is pending
Franck Bui [Fri, 18 Feb 2022 09:06:24 +0000 (10:06 +0100)] 
core: really skip automatic restart when a JOB_STOP job is pending

It's not clear why we rescheduled a service auto restart while a stop job for
the unit was pending. The comment claims that the unit shouldn't be restarted
but the code did reschedule an auto restart meanwhile.

In practice that was rarely an issue because the service waited for the next
auto restart to be rescheduled, letting the queued stop job to be proceed and
service_stop() to be called preventing the next restart to complete.

However when RestartSec=0, the timer expired right away making PID1 to
reschedule the unit again, making the timer expired right away... and so
on. This busy loop prevented PID1 to handle any queued jobs (and hence giving
no chance to the start rate limiting to trigger), which made the busy loop last
forever.

This patch breaks this loop by skipping the reschedule of the unit auto restart
and hence not depending on the value of u->restart_usec anymore.

Fixes: #13667
3 years agosystemctl: improve error messages related to halt failures
Ludwig Nussel [Wed, 9 Feb 2022 09:59:22 +0000 (10:59 +0100)] 
systemctl: improve error messages related to halt failures

3 years agoMerge pull request #22585 from poettering/analyze-split-up
Zbigniew Jędrzejewski-Szmek [Tue, 22 Feb 2022 10:02:57 +0000 (11:02 +0100)] 
Merge pull request #22585 from poettering/analyze-split-up

analyze: split out each verb into its own .c/.h pair

3 years agohwdb: Force release calculator key on all HP OMEN laptops
Lan Tian [Tue, 22 Feb 2022 07:43:32 +0000 (01:43 -0600)] 
hwdb: Force release calculator key on all HP OMEN laptops

3 years agohwdb: add CST Laser Trackball (#22583)
prumian [Tue, 22 Feb 2022 06:47:39 +0000 (07:47 +0100)] 
hwdb: add CST Laser Trackball (#22583)

Set the default to 800DPI as this is what user manual suggests.

3 years agoenv-util: drop unsetenv_erase()
Lennart Poettering [Mon, 21 Feb 2022 16:31:33 +0000 (17:31 +0100)] 
env-util: drop unsetenv_erase()

Follow-up for: e99ca1474145f7fad38bb0255d344f4ad7717ef5

Found by @grigorig: https://github.com/systemd/systemd/commit/e99ca1474145f7fad38bb0255d344f4ad7717ef5#r67071855

3 years agoanalyze: modernize pretty_boot_time() a bit 22585/head
Lennart Poettering [Mon, 21 Feb 2022 15:07:19 +0000 (16:07 +0100)] 
analyze: modernize pretty_boot_time() a bit

Use simple strextend() backed by dynamic memory instead of format string
logic with fixed buffer.

3 years agoanalyze: systematically name verb entry point functions verb_xyz()
Lennart Poettering [Mon, 21 Feb 2022 13:51:56 +0000 (14:51 +0100)] 
analyze: systematically name verb entry point functions verb_xyz()

Some of the functions so far were named do_xyz(), others dump_xyz() and
even others test_xyz(). let's instead name them exactly like the verb
exposed in the command line, just prefixed with verb_

3 years agoanalyze: move "condition" verb into analyze-condition.[ch]
Lennart Poettering [Mon, 21 Feb 2022 13:42:20 +0000 (14:42 +0100)] 
analyze: move "condition" verb into analyze-condition.[ch]

3 years agoanalyze: split out "verify" verb into own .c/.h file
Lennart Poettering [Mon, 21 Feb 2022 13:39:16 +0000 (14:39 +0100)] 
analyze: split out "verify" verb into own .c/.h file

This renames the old analyze-verify.[ch] pair →
analyze-verify-util.[ch], because it's used by the test logic as well,
and by keeping it separate from the verify verb logic we don't have to
import the arg_xyz variables.

3 years agoanalyze: move inspect-elf verb entrypoint into analyze-elf.[ch], too
Lennart Poettering [Mon, 21 Feb 2022 13:09:16 +0000 (14:09 +0100)] 
analyze: move inspect-elf verb entrypoint into analyze-elf.[ch], too

like for the other verbs, let's move the whole entry point for the verb,
too.

3 years agoanalyze: fully move "security" verb to analyze-security.[ch]
Lennart Poettering [Mon, 21 Feb 2022 13:06:15 +0000 (14:06 +0100)] 
analyze: fully move "security" verb to analyze-security.[ch]

let's move the verb entropy point too, like for the other verbs now.

3 years agoanalyze: split out "time" verb
Lennart Poettering [Mon, 21 Feb 2022 12:59:46 +0000 (13:59 +0100)] 
analyze: split out "time" verb

3 years agoanalyze: split out critical chain
Lennart Poettering [Mon, 21 Feb 2022 12:56:59 +0000 (13:56 +0100)] 
analyze: split out critical chain

3 years agoanalyze: split out "unit-files" verb
Lennart Poettering [Mon, 21 Feb 2022 12:50:35 +0000 (13:50 +0100)] 
analyze: split out "unit-files" verb

3 years agoanalyze: split out "unit-paths" verb
Lennart Poettering [Mon, 21 Feb 2022 12:47:38 +0000 (13:47 +0100)] 
analyze: split out "unit-paths" verb

3 years agoanalyze: split out log control verb
Lennart Poettering [Mon, 21 Feb 2022 12:44:37 +0000 (13:44 +0100)] 
analyze: split out log control verb

3 years agoanalyze: split out cat-config verb
Lennart Poettering [Mon, 21 Feb 2022 12:40:45 +0000 (13:40 +0100)] 
analyze: split out cat-config verb

3 years agoanalyze: split out "plot" verb
Lennart Poettering [Mon, 21 Feb 2022 12:36:40 +0000 (13:36 +0100)] 
analyze: split out "plot" verb

3 years agoanalyze: split out "blame" verb + time helpers
Lennart Poettering [Mon, 21 Feb 2022 12:27:08 +0000 (13:27 +0100)] 
analyze: split out "blame" verb + time helpers

3 years agoanalyze: split out "capability" verb
Lennart Poettering [Mon, 21 Feb 2022 10:04:31 +0000 (11:04 +0100)] 
analyze: split out "capability" verb

3 years agoanalyze: split out "exit-status" verb
Lennart Poettering [Mon, 21 Feb 2022 10:00:53 +0000 (11:00 +0100)] 
analyze: split out "exit-status" verb

3 years agoanalyze: highlight the range of deprecated verbs in comments a bit better
Lennart Poettering [Mon, 21 Feb 2022 09:54:06 +0000 (10:54 +0100)] 
analyze: highlight the range of deprecated verbs in comments a bit better

3 years agoanalyze: split out "service-watchdogs" verb
Lennart Poettering [Mon, 21 Feb 2022 09:52:49 +0000 (10:52 +0100)] 
analyze: split out "service-watchdogs" verb

3 years agoanalyze: split out "dot" verb
Lennart Poettering [Mon, 21 Feb 2022 09:47:48 +0000 (10:47 +0100)] 
analyze: split out "dot" verb

3 years agoanalyze: split out "dump" verb
Lennart Poettering [Mon, 21 Feb 2022 09:39:09 +0000 (10:39 +0100)] 
analyze: split out "dump" verb

3 years agoanalyze: split out "syscall-filter" verb
Lennart Poettering [Mon, 21 Feb 2022 09:30:53 +0000 (10:30 +0100)] 
analyze: split out "syscall-filter" verb

3 years agoanalyze: split out "filesystems" verb into its own .c/.h file pair
Lennart Poettering [Mon, 21 Feb 2022 09:25:36 +0000 (10:25 +0100)] 
analyze: split out "filesystems" verb into its own .c/.h file pair

3 years agoanalyze: split out calendar verb into own .c/.h file
Lennart Poettering [Mon, 21 Feb 2022 09:18:57 +0000 (10:18 +0100)] 
analyze: split out calendar verb into own .c/.h file

3 years agoanalyze: split out "timestamp" verb into its own .c/.h files
Lennart Poettering [Mon, 21 Feb 2022 09:14:57 +0000 (10:14 +0100)] 
analyze: split out "timestamp" verb into its own .c/.h files

3 years agoanalyze: split out "timespan" verb into its own .c/.h file
Lennart Poettering [Mon, 21 Feb 2022 09:09:06 +0000 (10:09 +0100)] 
analyze: split out "timespan" verb into its own .c/.h file

3 years agoMerge pull request #22573 from mrc0mmand/epoch-timestamp
Lennart Poettering [Mon, 21 Feb 2022 15:13:47 +0000 (16:13 +0100)] 
Merge pull request #22573 from mrc0mmand/epoch-timestamp

time-util: introduce TIMESTAMP_UNIX

3 years agosystemctl,man: update docs for `--timestamp=` 22573/head
Frantisek Sumsal [Mon, 21 Feb 2022 12:14:18 +0000 (13:14 +0100)] 
systemctl,man: update docs for `--timestamp=`

3 years agotime-util: introduce TIMESTAMP_UNIX
Frantisek Sumsal [Mon, 21 Feb 2022 12:08:20 +0000 (13:08 +0100)] 
time-util: introduce TIMESTAMP_UNIX

Allow formatting timestamps as number of seconds since the Epoch for easier
machine parsing.

Fixes: #22567
```
$ systemctl show systemd-journald | grep Timestamp
WatchdogTimestampMonotonic=0
ExecMainStartTimestamp=Sat 2021-12-11 15:25:57 CET
ExecMainStartTimestampMonotonic=13030408
ExecMainExitTimestampMonotonic=0
StateChangeTimestamp=Sat 2021-12-11 15:25:57 CET
StateChangeTimestampMonotonic=13049273
InactiveExitTimestamp=Sat 2021-12-11 15:25:57 CET
InactiveExitTimestampMonotonic=13030430
ActiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET
ActiveEnterTimestampMonotonic=13049273
ActiveExitTimestamp=Sat 2021-12-11 15:25:57 CET
ActiveExitTimestampMonotonic=12997236
InactiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET
InactiveEnterTimestampMonotonic=13028890
ConditionTimestamp=Sat 2021-12-11 15:25:57 CET
ConditionTimestampMonotonic=13029539
AssertTimestamp=Sat 2021-12-11 15:25:57 CET
AssertTimestampMonotonic=13029540

$ systemctl show --timestamp=unix systemd-journald | grep Timestamp
WatchdogTimestampMonotonic=0
ExecMainStartTimestamp=@1639232757
ExecMainStartTimestampMonotonic=13030408
ExecMainExitTimestampMonotonic=0
StateChangeTimestamp=@1639232757
StateChangeTimestampMonotonic=13049273
InactiveExitTimestamp=@1639232757
InactiveExitTimestampMonotonic=13030430
ActiveEnterTimestamp=@1639232757
ActiveEnterTimestampMonotonic=13049273
ActiveExitTimestamp=@1639232757
ActiveExitTimestampMonotonic=12997236
InactiveEnterTimestamp=@1639232757
InactiveEnterTimestampMonotonic=13028890
ConditionTimestamp=@1639232757
ConditionTimestampMonotonic=13029539
AssertTimestamp=@1639232757
AssertTimestampMonotonic=13029540
```

3 years agoMerge pull request #22579 from ml-/fix-discoverable-partitions-table
Zbigniew Jędrzejewski-Szmek [Mon, 21 Feb 2022 08:02:05 +0000 (09:02 +0100)] 
Merge pull request #22579 from ml-/fix-discoverable-partitions-table

docs: fix discoverable partitions table

3 years agodocs: swap Name and Partition Type UUID in header 22579/head
Matthias Lisin [Mon, 21 Feb 2022 01:46:57 +0000 (02:46 +0100)] 
docs: swap Name and Partition Type UUID in header

3 years agotools: adjust re.match to recent gpt.h additions
Matthias Lisin [Mon, 21 Feb 2022 01:32:25 +0000 (02:32 +0100)] 
tools: adjust re.match to recent gpt.h additions

with addition of SD_ID128_MAKE_UUID_STR entries to src/shared/gpt.h the tool
failed halfway due to falsly matching the new entries

3 years agoenv-util: replace unsetenv_erase() by new getenv_steal_erase() helper
Lennart Poettering [Fri, 18 Feb 2022 23:08:39 +0000 (00:08 +0100)] 
env-util: replace unsetenv_erase() by new getenv_steal_erase() helper

The new helper combines a bunch of steps every invocation of
unsetenv_erase() did so far: getenv() + strdup() + unsetenv_erase().
Let's unify this into one helper that is harder to use incorrectly. It's
in inspired by TAKE_PTR() in a way: get the env var out and invalidate
where it was before.

3 years agoNEWS: fix typo
Yu Watanabe [Sun, 20 Feb 2022 02:10:44 +0000 (11:10 +0900)] 
NEWS: fix typo

3 years agomkosi CI: mask isc-dhcp-server units
Luca Boccassi [Fri, 18 Feb 2022 22:56:56 +0000 (22:56 +0000)] 
mkosi CI: mask isc-dhcp-server units

The packages are installed to provide the dhcpd binary, used by
test/test-network/systemd-networkd-tests.py, but we don't need the units
to run, and in fact in some cases the image fails to boot because of
them:

Spawning container image on /home/runner/work/systemd/systemd/image.raw.
Press ^] three times within 1s to kill container.
● isc-dhcp-server.service  loaded failed failed ISC DHCP IPv4 server
● isc-dhcp-server6.service loaded failed failed ISC DHCP IPv6 server
Container image failed with error code 1.
Error: Process completed with exit code 1.

Mask the units with an --extra-tree.

3 years agosystemctl: make `--timestamp=` affect the `show` verb as well
Frantisek Sumsal [Fri, 18 Feb 2022 22:09:18 +0000 (23:09 +0100)] 
systemctl: make `--timestamp=` affect the `show` verb as well

Currently the `--timestamp=` option has no effect on timestamps shown by
`systemctl show`, let's fix that.

Spotted in #22567.

Before:
```
$ systemctl show --timestamp=us+utc systemd-journald | grep Timestamp=
ExecMainStartTimestamp=Sat 2021-12-11 15:25:57 CET
StateChangeTimestamp=Sat 2021-12-11 15:25:57 CET
InactiveExitTimestamp=Sat 2021-12-11 15:25:57 CET
ActiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET
ActiveExitTimestamp=Sat 2021-12-11 15:25:57 CET
InactiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET
ConditionTimestamp=Sat 2021-12-11 15:25:57 CET
AssertTimestamp=Sat 2021-12-11 15:25:57 CET
```

After:
```
$ systemctl show --timestamp=us+utc systemd-journald | grep Timestamp=
ExecMainStartTimestamp=Sat 2021-12-11 14:25:57.177848 UTC
StateChangeTimestamp=Sat 2021-12-11 14:25:57.196714 UTC
InactiveExitTimestamp=Sat 2021-12-11 14:25:57.177871 UTC
ActiveEnterTimestamp=Sat 2021-12-11 14:25:57.196714 UTC
ActiveExitTimestamp=Sat 2021-12-11 14:25:57.144677 UTC
InactiveEnterTimestamp=Sat 2021-12-11 14:25:57.176331 UTC
ConditionTimestamp=Sat 2021-12-11 14:25:57.176980 UTC
AssertTimestamp=Sat 2021-12-11 14:25:57.176980 UTC

```

3 years agogenerator: Rename password arg
Jan Janssen [Fri, 18 Feb 2022 18:38:09 +0000 (19:38 +0100)] 
generator: Rename password arg

This function does not expect a password, but a key file path. The
cryptsetup helper binary even calls it that.

No Code changes.

Follow up on: 6e41f4dd916293f35d7d35cea7eed1807d7ea771
Fixes: https://github.com/systemd/systemd/security/code-scanning/81