]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agomanager: add taint flag "support-ended" 23962/head
Zbigniew Jędrzejewski-Szmek [Sat, 9 Jul 2022 16:00:33 +0000 (18:00 +0200)] 
manager: add taint flag "support-ended"

In the welcome line, use NAME= as the fallback for PRETTY_NAME=.
PRETTY_NAME= doesn't have to be set, but NAME= should.

Example output:
---
Welcome to Fedora Linux 37 (Rawhide Prerelease)!

[  !!  ] This OS version (Fedora Linux 37 (Rawhide Prerelease)) is past its end-of-support date (1999-01-01)
Queued start job for default target graphical.target.
[  OK  ] Created slice system-getty.slice.
---

3 years agoman: update the description of taint flags
Zbigniew Jędrzejewski-Szmek [Sat, 9 Jul 2022 15:42:07 +0000 (17:42 +0200)] 
man: update the description of taint flags

We had a description in README, and an outdated list in the man page.
I think we should keep a reference-style list in the man page. The description
in README is more free-form.

3 years agoman: redefine SUPPORT_END= to mean one day earlier
Zbigniew Jędrzejewski-Szmek [Sat, 9 Jul 2022 15:50:36 +0000 (17:50 +0200)] 
man: redefine SUPPORT_END= to mean one day earlier

I thought it would be nice to specify the last day of support, because I
thought it'd seem more natural. But in practice this doesn't work well, because
such a truncated timestamp is usually taken to mean midnight that starts the
given date. I.e. 2011-12-13 is a shorthand for 2011-12-13 00:00:00 and not
2011-12-13 23:59:59.999999999999. Let's instead specify that the given date is
the first unsupported day, which is meaningful for humans, and let the computer
treat it as midnight, which gives consistent interpratation.

3 years agoMerge pull request #23959 from yuwata/test-network
Frantisek Sumsal [Sat, 9 Jul 2022 08:21:32 +0000 (08:21 +0000)] 
Merge pull request #23959 from yuwata/test-network

test-network: several performance improvements

3 years agotest-network: use wait_operstate() at one more place 23959/head
Yu Watanabe [Sat, 9 Jul 2022 03:20:11 +0000 (12:20 +0900)] 
test-network: use wait_operstate() at one more place

3 years agotest-network: suppress periodic output in wait_operstate()
Yu Watanabe [Sat, 9 Jul 2022 03:19:52 +0000 (12:19 +0900)] 
test-network: suppress periodic output in wait_operstate()

3 years agotest-network: disable debugging logs from networkctl, resolvectl, and so on
Yu Watanabe [Sat, 9 Jul 2022 02:59:38 +0000 (11:59 +0900)] 
test-network: disable debugging logs from networkctl, resolvectl, and so on

3 years agotest-network: merge two DHCPv6 client tests
Yu Watanabe [Sat, 9 Jul 2022 01:13:33 +0000 (10:13 +0900)] 
test-network: merge two DHCPv6 client tests

3 years agotest-network: replace sleep with wait_address() and wait_address_dropped()
Yu Watanabe [Sat, 9 Jul 2022 01:07:17 +0000 (10:07 +0900)] 
test-network: replace sleep with wait_address() and wait_address_dropped()

3 years agotest-network: merge two more tests with test_dhcp_client_ipv4_only
Yu Watanabe [Sat, 9 Jul 2022 01:01:51 +0000 (10:01 +0900)] 
test-network: merge two more tests with test_dhcp_client_ipv4_only

3 years agotest-network: merge tests for UseDNS=
Yu Watanabe [Sat, 9 Jul 2022 00:49:20 +0000 (09:49 +0900)] 
test-network: merge tests for UseDNS=

3 years agotest-network: merge two IPv4LL tests
Yu Watanabe [Fri, 8 Jul 2022 23:58:48 +0000 (08:58 +0900)] 
test-network: merge two IPv4LL tests

3 years agotest-network: drop test_dhcp_client_ipv4_ipv6
Yu Watanabe [Fri, 8 Jul 2022 23:10:08 +0000 (08:10 +0900)] 
test-network: drop test_dhcp_client_ipv4_ipv6

As the test is covered by test_dhcp_client_reuse_address_as_static.

3 years agosd-dhcp-client: fix log message
Yu Watanabe [Fri, 8 Jul 2022 22:52:11 +0000 (07:52 +0900)] 
sd-dhcp-client: fix log message

3 years agotest-network: check DHCPv4 address in more detail
Yu Watanabe [Fri, 8 Jul 2022 22:40:06 +0000 (07:40 +0900)] 
test-network: check DHCPv4 address in more detail

Also, this drops redundant address check through networkctl.

3 years agotest-network: drop 25-dhcp-v4-server-veth-peer.network
Yu Watanabe [Fri, 8 Jul 2022 22:15:37 +0000 (07:15 +0900)] 
test-network: drop 25-dhcp-v4-server-veth-peer.network

3 years agotest-network: drop meaningless test
Yu Watanabe [Fri, 8 Jul 2022 22:03:31 +0000 (07:03 +0900)] 
test-network: drop meaningless test

On DHCPv6 lease renew, the kernel do not drop static routes, and hence
we do not try to reassign them. Hence, the test is mostly meaningless.

3 years agotest-network: introduce read_dnsmasq_log_file() helper function
Yu Watanabe [Fri, 8 Jul 2022 21:34:20 +0000 (06:34 +0900)] 
test-network: introduce read_dnsmasq_log_file() helper function

This reduces the number of times that the log file is read.
Also, dropped unnecessary dump of the log file.

3 years agotest-network: shorten sleep time a bit
Yu Watanabe [Fri, 8 Jul 2022 21:22:39 +0000 (06:22 +0900)] 
test-network: shorten sleep time a bit

Network interfaces will be ready after lease is acquired.
Hence, it is not necessary to wait more than lease time.

3 years agotest-network: introduce read_link_state_file() helper function
Yu Watanabe [Fri, 8 Jul 2022 21:17:46 +0000 (06:17 +0900)] 
test-network: introduce read_link_state_file() helper function

3 years agonetwork: drop redundant warning
Yu Watanabe [Fri, 10 Jun 2022 00:12:55 +0000 (09:12 +0900)] 
network: drop redundant warning

If file is world readable, then `read_full_file_full()` will warn
about that.

3 years agoMerge pull request #23940 from yuwata/core-extract-first-word
Luca Boccassi [Sat, 9 Jul 2022 00:09:06 +0000 (01:09 +0100)] 
Merge pull request #23940 from yuwata/core-extract-first-word

core: fix error value in log_syntax()

3 years agoMerge pull request #23731 from bluca/bootctl_image
Luca Boccassi [Fri, 8 Jul 2022 20:59:16 +0000 (21:59 +0100)] 
Merge pull request #23731 from bluca/bootctl_image

bootctl: add --root and --image

3 years agoMerge pull request #23954 from yuwata/resolve-overflow
Evgeny Vereshchagin [Fri, 8 Jul 2022 20:39:31 +0000 (23:39 +0300)] 
Merge pull request #23954 from yuwata/resolve-overflow

resolve: fix heap-buffer-overflow

3 years agocore/cgroup: drop unnecessary else 23940/head
Yu Watanabe [Thu, 7 Jul 2022 21:22:59 +0000 (06:22 +0900)] 
core/cgroup: drop unnecessary else

3 years agocore: shorten code a bit
Yu Watanabe [Thu, 7 Jul 2022 21:20:03 +0000 (06:20 +0900)] 
core: shorten code a bit

3 years agocore/load-fragment: fix error value in log_syntax()
Yu Watanabe [Thu, 7 Jul 2022 21:10:36 +0000 (06:10 +0900)] 
core/load-fragment: fix error value in log_syntax()

`extract_first_word()` may return positive value on success.

3 years agotest: start test user session before idle action setting is changed
Yu Watanabe [Fri, 8 Jul 2022 11:22:40 +0000 (20:22 +0900)] 
test: start test user session before idle action setting is changed

Otherwise, idle action may be triggered before starting the test user
session.

This also introduce create_session() and cleanup_session() helper
functions.

Fixes #23952.

3 years agoUpdate TODO 23731/head
Luca Boccassi [Sun, 12 Jun 2022 23:22:46 +0000 (00:22 +0100)] 
Update TODO

3 years agobootctl: add --install-source=auto|image|host
Luca Boccassi [Sun, 12 Jun 2022 23:21:41 +0000 (00:21 +0100)] 
bootctl: add --install-source=auto|image|host

When using --root=/--image= the binaries to install/update will be
picked from the directory/image. Add an option to let the caller
choose.
By default (auto) the image is tried first, and if nothing is found
then the host. The other options allow to strictly try the image
or host and ignore the other.

3 years agobootctl: add --root and --image
Luca Boccassi [Sun, 12 Jun 2022 23:01:02 +0000 (00:01 +0100)] 
bootctl: add --root and --image

Operate on image/directory, and also take files to install from it

3 years agomac: rework labelling code to be simpler, and less racy
Lennart Poettering [Fri, 8 Jul 2022 08:05:57 +0000 (10:05 +0200)] 
mac: rework labelling code to be simpler, and less racy

This merges the various labelling calls into a single label_fix_full(),
which can operate on paths, on inode fds, and in a dirfd/fname style
(i.e. like openat()). It also systematically separates the path to look
up in the db from the path we actually use to reference the inode to
relabel.

This then ports tmpfiles over to labelling by fd. This should make the
code a bit less racy, as we'll try hard to always operate on the very
same inode, pinning it via an fd.

User-visibly the behaviour should not change.

3 years agotmpfiles: take error code from "errno" earlier
Lennart Poettering [Fri, 8 Jul 2022 08:00:20 +0000 (10:00 +0200)] 
tmpfiles: take error code from "errno" earlier

This uses RET_NERRNO to more quickly pull the error code we see into
"r" out of "errno".

This does not change anything really. The only reason to do this is
because it is harder to break this accidentally. The thing is that
"errno" is easily set as side-effect of arbitrary functions. Thus, if we
rely on it being set for long code paths, we need to make carefully sure
that no code in between calls any function that might corrupt it as
side-effect. As far as I can see we did get this right. Nonetheless, I
think we should just store the value in "r" instead, to make it easier
to maintain this in the long run, if more code is inserted one day, who
knows.

3 years agoMerge pull request #23946 from poettering/tmpfiles-extrat-dir-fn
Lennart Poettering [Fri, 8 Jul 2022 14:10:42 +0000 (16:10 +0200)] 
Merge pull request #23946 from poettering/tmpfiles-extrat-dir-fn

tmpfiles: port from basename()/dirname() → path_extract_direcory()/path_extract_filename()

3 years agomkdir-label: don't use mkdirat_errno_wrapper() without reason
Lennart Poettering [Thu, 7 Jul 2022 21:22:04 +0000 (23:22 +0200)] 
mkdir-label: don't use mkdirat_errno_wrapper() without reason

mkdirat_errno_wrapper(x,y,z) is identical to RET_NERRNO(mkdirat(x, y,
z)). Let's always use the latter when we can, because easier to read,
shorter.

The only reason to have mkdirat_errno_wrapper() at all is so that we can
pass a function pointer to it around. Otherwise, let's not use it.

3 years agotime-util: fix buffer-over-run
Yu Watanabe [Thu, 7 Jul 2022 09:27:02 +0000 (18:27 +0900)] 
time-util: fix buffer-over-run

Fixes #23928.

3 years agosmack: catch more types of 'not supported' errors
Lennart Poettering [Thu, 7 Jul 2022 22:08:22 +0000 (00:08 +0200)] 
smack: catch more types of 'not supported' errors

3 years agotmpfiles: shorten code a bit
Lennart Poettering [Fri, 8 Jul 2022 08:05:39 +0000 (10:05 +0200)] 
tmpfiles: shorten code a bit

3 years agoresolve: fix possible integer overflow 23954/head
Yu Watanabe [Fri, 8 Jul 2022 13:13:24 +0000 (22:13 +0900)] 
resolve: fix possible integer overflow

3 years agotest-network: merge DHCP client tests to improve performance
Yu Watanabe [Fri, 8 Jul 2022 07:32:38 +0000 (16:32 +0900)] 
test-network: merge DHCP client tests to improve performance

3 years agoresolve: fix heap-buffer-overflow reported by ASAN with strict_string_checks=1
Yu Watanabe [Fri, 8 Jul 2022 13:00:58 +0000 (22:00 +0900)] 
resolve: fix heap-buffer-overflow reported by ASAN with strict_string_checks=1

Fixes #23942.

3 years agoMerge pull request #23943 from poettering/tmpfiles-errno-fix
Zbigniew Jędrzejewski-Szmek [Fri, 8 Jul 2022 12:50:18 +0000 (14:50 +0200)] 
Merge pull request #23943 from poettering/tmpfiles-errno-fix

two errno variable fixes

3 years agotmpfiles: port from dirname/basename to path_extract_directory/filename() 23946/head
Lennart Poettering [Thu, 7 Jul 2022 22:15:09 +0000 (00:15 +0200)] 
tmpfiles: port from dirname/basename to path_extract_directory/filename()

let's use our better, newer internal APIs for these purposes. This gets us
two things: safer handling when the root dir is specified, and better
handling of paths with trailing slashes, as we can refuse them whenever
a directory is not acceptable.

3 years agopath-util: NULL strings are definitely not valid paths
Lennart Poettering [Thu, 7 Jul 2022 21:19:12 +0000 (23:19 +0200)] 
path-util: NULL strings are definitely not valid paths

Let's make this functions that check validity of paths a bit more
friendly towards one specific kind of invalid path: a NULL pointer.

This follows similar logic in path_is_valid(), path_is_normalized() and
so on.

3 years agoupdate TODO
Lennart Poettering [Thu, 7 Jul 2022 21:18:38 +0000 (23:18 +0200)] 
update TODO

3 years agotmpfiles: correct error variable to use 23943/head
Lennart Poettering [Fri, 8 Jul 2022 07:59:57 +0000 (09:59 +0200)] 
tmpfiles: correct error variable to use

3 years agonamespace: fix propagated error number
Lennart Poettering [Thu, 7 Jul 2022 21:20:31 +0000 (23:20 +0200)] 
namespace: fix propagated error number

3 years agoMerge pull request #23941 from yuwata/test-60-improve-performance
Frantisek Sumsal [Fri, 8 Jul 2022 07:24:52 +0000 (07:24 +0000)] 
Merge pull request #23941 from yuwata/test-60-improve-performance

test: performance improvement for TEST-60

3 years agotest: use timeout command to improve performance 23941/head
Yu Watanabe [Thu, 7 Jul 2022 22:00:42 +0000 (07:00 +0900)] 
test: use timeout command to improve performance

c.f. #23723.

3 years agotest: remove /failed and /testok before running test script
Yu Watanabe [Thu, 7 Jul 2022 22:00:02 +0000 (07:00 +0900)] 
test: remove /failed and /testok before running test script

3 years agoMerge pull request #23937 from mrc0mmand/test-tweaks
Yu Watanabe [Thu, 7 Jul 2022 21:25:57 +0000 (06:25 +0900)] 
Merge pull request #23937 from mrc0mmand/test-tweaks

Several ASan-related test suite tweaks

3 years agoMerge pull request #23939 from mrc0mmand/TEST-70-fix-cleanup
Yu Watanabe [Thu, 7 Jul 2022 20:44:12 +0000 (05:44 +0900)] 
Merge pull request #23939 from mrc0mmand/TEST-70-fix-cleanup

Fix cleanup in TEST-70-TPM2

3 years agotest: use PBKDF2 with capped iterations instead of Argon2 23937/head
Frantisek Sumsal [Thu, 7 Jul 2022 15:16:31 +0000 (17:16 +0200)] 
test: use PBKDF2 with capped iterations instead of Argon2

to reduce the amount of resources the test needs (similarly to TEST-24
where we do the same thing).

3 years agotest: make TEST-64 a bit more ASan friendly
Frantisek Sumsal [Thu, 7 Jul 2022 14:56:42 +0000 (16:56 +0200)] 
test: make TEST-64 a bit more ASan friendly

Reduce the number of iterations in some of the test cases, since they
generate a huge amount of uevents and basically DoS udev (which can't
keep up while being slowed down by ASan). To avoid this, let's reduce
the number of iterations and bump the timeout when running under ASan,
since we're not interested in performance in such cases.

3 years agotest: avoid overriding an already existing EXIT handler 23939/head
Frantisek Sumsal [Thu, 7 Jul 2022 18:02:06 +0000 (20:02 +0200)] 
test: avoid overriding an already existing EXIT handler

TEST-70 specified its own EXIT handler, which replaced the
`cleanup_loopdev` handler, so the loop device was always hanging around
once this test was run. Let's use the new `add_at_exit_handler()` stuff
to mitigate this.

3 years agotest: allow multiple handlers for the EXIT signal
Frantisek Sumsal [Thu, 7 Jul 2022 18:00:46 +0000 (20:00 +0200)] 
test: allow multiple handlers for the EXIT signal

Bash allows only one handler per signal, so let's overcome this
limitation by having one dedicated EXIT signal which runs all registered
handlers from all over the place.

3 years agotest: bump the data partition size if we don't strip binaries
Frantisek Sumsal [Thu, 7 Jul 2022 12:13:32 +0000 (14:13 +0200)] 
test: bump the data partition size if we don't strip binaries

so we can run TEST-24 under sanitizers as well.

Also, when at it, use the 'named-fields' sfdisk format to make the code
a bit more descriptive without needing a manual.

3 years agotest: create an ASan wrapper for `getent` and `su`
Frantisek Sumsal [Thu, 7 Jul 2022 12:12:38 +0000 (14:12 +0200)] 
test: create an ASan wrapper for `getent` and `su`

since they "suffer" from the same issue as `login` and other binaries
that load PAM stuff

3 years agoMerge pull request #23931 from yuwata/systemctl-color-log
Frantisek Sumsal [Thu, 7 Jul 2022 13:15:59 +0000 (13:15 +0000)] 
Merge pull request #23931 from yuwata/systemctl-color-log

systemctl: colorize logs

3 years agotest: several cleanups for TEST-35-LOGIN
Yu Watanabe [Thu, 7 Jul 2022 01:10:05 +0000 (10:10 +0900)] 
test: several cleanups for TEST-35-LOGIN

- use test_append_files() to install additional commands
- drop use of expect
- include assert.sh and use assertions at several places
- use timeout command at several places
- always use logind-test-user
- etc

3 years agoresolvectl man page: Word correction
Frank Dana [Thu, 7 Jul 2022 10:56:04 +0000 (06:56 -0400)] 
resolvectl man page: Word correction

3 years agoMerge pull request #23932 from medhefgo/boot-misc
Yu Watanabe [Thu, 7 Jul 2022 10:59:05 +0000 (19:59 +0900)] 
Merge pull request #23932 from medhefgo/boot-misc

boot: Miscellaneous cleanups

3 years agoboot: Use UEFI protocol struct names 23932/head
Jan Janssen [Thu, 7 Jul 2022 08:24:14 +0000 (10:24 +0200)] 
boot: Use UEFI protocol struct names

These are somewhat pointless gnu-efi typedefs. Using the names from the
UEFI spec makes things clearer.

The one exception left is EFI_FILE as we use it a lot and
EFI_FILE_PROTOCOL is quite a handful.

3 years agoboot: Use typedef for PE structs
Jan Janssen [Thu, 7 Jul 2022 08:16:26 +0000 (10:16 +0200)] 
boot: Use typedef for PE structs

3 years agoboot: Constify PE sections type
Jan Janssen [Mon, 20 Jun 2022 11:43:47 +0000 (13:43 +0200)] 
boot: Constify PE sections type

3 years agoboot: Use void for base pointer
Jan Janssen [Mon, 20 Jun 2022 11:10:41 +0000 (13:10 +0200)] 
boot: Use void for base pointer

3 years agoboot: Use open_volume when creating cpio
Jan Janssen [Tue, 5 Jul 2022 08:28:30 +0000 (10:28 +0200)] 
boot: Use open_volume when creating cpio

3 years agosystemctl: drop color settings in log message 23931/head
Yu Watanabe [Thu, 7 Jul 2022 07:31:58 +0000 (16:31 +0900)] 
systemctl: drop color settings in log message

`log_warning()` colorize the message gracefully.

3 years agosystemctl: enable colorized logging by default
Yu Watanabe [Thu, 7 Jul 2022 07:38:54 +0000 (16:38 +0900)] 
systemctl: enable colorized logging by default

3 years agoMerge pull request #23569 from msekletar/pam-systemd-no-user-systemd
Yu Watanabe [Thu, 7 Jul 2022 01:33:21 +0000 (10:33 +0900)] 
Merge pull request #23569 from msekletar/pam-systemd-no-user-systemd

Don't spawn systemd --user instance for background (i.e. cron) sessions

3 years agoNEWS: mention change in default behavior of background sessions 23569/head
Michal Sekletar [Mon, 30 May 2022 13:13:13 +0000 (15:13 +0200)] 
NEWS: mention change in default behavior of background sessions

3 years agotests: add test for handling of background sessions
Michal Sekletar [Tue, 21 Jun 2022 16:41:46 +0000 (18:41 +0200)] 
tests: add test for handling of background sessions

3 years agologind: don't start user@UID.service instance for background sessions
Michal Sekletar [Fri, 27 May 2022 19:11:37 +0000 (21:11 +0200)] 
logind: don't start user@UID.service instance for background sessions

We have had background session class for a long time (since commit
e2acb67baa), but so far the only difference in handling of background
sessions was logging, i.e. we log some messages with LOG_DEBUG for such
sessions.

Previously there were complains [1] about excessive logging for each
time cron session is started. We used to advise user to enable lingering
for users if they want to avoid these log messages. However, on servers
with a lot of users the extra processes that result from lingering just
adds too much overhead. Hence I think that our current handling of
background sessions is not ideal and we should make better use of this
attribute.

This commit introduces a change in default behavior of logind. Logind is
now not going to start user instance of systemd when background session
is created and that should address excessive logging problem for cron
where background class is used by default. When the same user actually
logs in normally then user instance will be started as previously.

Also note that PAM_TTY variable is now always set to some value for PAM
sessions started via PAMName= option. Otherwise we would categorize such
sessions as "background" and user manager won't be started.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1825942

3 years agotest: fix typo
Yu Watanabe [Thu, 7 Jul 2022 00:33:11 +0000 (09:33 +0900)] 
test: fix typo

3 years agoTODO: fix typo
Yu Watanabe [Thu, 7 Jul 2022 00:31:43 +0000 (09:31 +0900)] 
TODO: fix typo

3 years agoMerge pull request #23396 from msekletar/fix-idle-action-lock
Yu Watanabe [Wed, 6 Jul 2022 22:42:51 +0000 (07:42 +0900)] 
Merge pull request #23396 from msekletar/fix-idle-action-lock

logind: remember our idle state and use it to detect idle level transitions

3 years agoos-release: define SUPPORT_END=
Zbigniew Jędrzejewski-Szmek [Wed, 6 Jul 2022 15:19:27 +0000 (17:19 +0200)] 
os-release: define SUPPORT_END=

Fixes #21764.

I think is very simple, but flexible. The date may be set early, for distros
that have a fixed schedule, but it doesn't have to. So for example Debian could
push out an update that sets a few months before the release goes EOL. And
various tools, in particular graphical desktops, can start nagging people to
upgrade a few weeks before the date.

As discussed in the bug, we don't need granularity higher than a day. And this
means that we can use a simple human- and machine-readable format.
I was considering other names, e.g. something with "EOL", but I think that
"SUPPORT_END" is better because it doesn't imply that the machine will somehow
stop working. This is supposed to be an advisory, nothing more.

3 years agoMerge pull request #23918 from yuwata/dissect
Luca Boccassi [Wed, 6 Jul 2022 20:31:04 +0000 (21:31 +0100)] 
Merge pull request #23918 from yuwata/dissect

Revert "dissect: ID from os-release should be non-empty, not just non-NULL"

3 years agofundamental: adjust #if conditional for _fallthrough_ for clang
Thomas Haller [Wed, 6 Jul 2022 12:50:50 +0000 (14:50 +0200)] 
fundamental: adjust #if conditional for _fallthrough_ for clang

NetworkManager takes systemd sources. It gets compiler warnings
related to _fallthrough_. They probably can also affect systemd
itself.

A) on RHEL-7, gcc 4.8.5-44.el7 we get:

    ../src/libnm-systemd-shared/src/fundamental/macro-fundamental.h:45:22: error: "__clang__" is not defined [-Werror=undef]
     #if __GNUC__ >= 7 || __clang__
                          ^

   Presumably gcc older than 7 is supported, so fix this.

B) on Ubuntu 18.04, clang 1:6.0-41~exp5~ubuntu1 we get:

    ../src/libnm-systemd-core/src/libsystemd-network/sd-dhcp6-client.c:746:17: error: declaration does not declare anything [-Werror,-Wmissing-declarations]
                    _fallthrough_;
                    ^
    ../src/libnm-systemd-shared/src/fundamental/macro-fundamental.h:46:25: note: expanded from macro '_fallthrough_'
    #  define _fallthrough_ __attribute__((__fallthrough__))
                            ^

   Granted, README comments that clang >= 10 is required. However,
   parts of systemd build just fine with older clang. It seems unnecessary
   to break this and the fix helps NetworkManager.

Fixes: c0f5d58c9ab7 ('meson: Document why -Wimplicit-fallthrough is not used with clang')
3 years agoMerge pull request #15205 from jlebon/pr/preset-all-firstboot
Zbigniew Jędrzejewski-Szmek [Wed, 6 Jul 2022 17:11:01 +0000 (19:11 +0200)] 
Merge pull request #15205 from jlebon/pr/preset-all-firstboot

manager: optionally, do a full preset on first boot

3 years agomkosi: Update to latest release
Daan De Meyer [Wed, 6 Jul 2022 11:08:13 +0000 (13:08 +0200)] 
mkosi: Update to latest release

This fixes the mkosi github action to unbreak the mkosi CI

3 years agoman: "enabled commands are started at boot" is rubbish
Lennart Poettering [Wed, 6 Jul 2022 11:14:20 +0000 (13:14 +0200)] 
man: "enabled commands are started at boot" is rubbish

it's enabled units, and they might be started by various forms of
activation, not just "at boot".

Fix that.

3 years agoupdate TODO
Lennart Poettering [Wed, 6 Jul 2022 11:13:03 +0000 (13:13 +0200)] 
update TODO

3 years agodissect: refuse empty release ID 23918/head
Yu Watanabe [Wed, 6 Jul 2022 10:16:24 +0000 (19:16 +0900)] 
dissect: refuse empty release ID

3 years agoRevert "dissect: ID from os-release should be non-empty, not just non-NULL"
Yu Watanabe [Wed, 6 Jul 2022 05:38:23 +0000 (14:38 +0900)] 
Revert "dissect: ID from os-release should be non-empty, not just non-NULL"

This reverts commit a2cf73f0b602a93a32107cfc066a5e307263c577.

This is not necessary after 78ab2b5064a0f87579ce5430f9cb83bba0db069a.

Addresses https://github.com/systemd/systemd/pull/23454#discussion_r913611798.

3 years agoMerge pull request #23916 from keszybz/assorted-patches
Yu Watanabe [Wed, 6 Jul 2022 05:15:50 +0000 (14:15 +0900)] 
Merge pull request #23916 from keszybz/assorted-patches

Assorted patches

3 years agojson: actually use numeric C locale we just allocated
Lennart Poettering [Tue, 5 Jul 2022 14:27:09 +0000 (16:27 +0200)] 
json: actually use numeric C locale we just allocated

This fixes formatting of JSON real values, and uses C locale for them.
It's kinda interesting that this wasn't noticed before: the C locale
object we allocated was not used, hence doing the dance had zero effect.

This makes "test-varlink" pass again on systems with non-C locale.

(My guess: noone noticed this because "long double" was used before by
the JSON code and that had no locale supporting printer or so?)

3 years agojournal: Make sd_journal_previous/next() return 0 at HEAD/TAIL
Daan De Meyer [Tue, 5 Jul 2022 13:22:01 +0000 (15:22 +0200)] 
journal: Make sd_journal_previous/next() return 0 at HEAD/TAIL

Currently, both these functions don't return 0 if we're at HEAD/TAIL
and move in the corresponding direction. Let's fix that.

Replaces #23480

3 years agodocs: normalize uppercasing of titles of network doc
Lennart Poettering [Tue, 5 Jul 2022 12:14:23 +0000 (14:14 +0200)] 
docs: normalize uppercasing of titles of network doc

3 years agotree-wide: drop duplicated semicolons 23916/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 Jul 2022 19:48:55 +0000 (21:48 +0200)] 
tree-wide: drop duplicated semicolons

3 years agoman: fix link to glob(3)
Zbigniew Jędrzejewski-Szmek [Mon, 4 Jul 2022 17:59:06 +0000 (19:59 +0200)] 
man: fix link to glob(3)

3 years agofuzz: rename samples to avoid long test names
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 15:43:29 +0000 (17:43 +0200)] 
fuzz: rename samples to avoid long test names

3 years agoMerge pull request #23855 from keszybz/drop-list-is-empty
Lennart Poettering [Tue, 5 Jul 2022 15:29:53 +0000 (17:29 +0200)] 
Merge pull request #23855 from keszybz/drop-list-is-empty

basic/list: drop LIST_IS_EMPTY

3 years agofirstboot: Don't skip passwd/shadow logic if only one of the files exists
Daan De Meyer [Tue, 5 Jul 2022 12:53:45 +0000 (14:53 +0200)] 
firstboot: Don't skip passwd/shadow logic if only one of the files exists

If one of the files exists but not the other one, we want to make sure
we create the other file to make sure the passwd database is in a valid
state.

3 years agoMerge pull request #23906 from poettering/isdigitisalpha
Lennart Poettering [Tue, 5 Jul 2022 14:40:39 +0000 (16:40 +0200)] 
Merge pull request #23906 from poettering/isdigitisalpha

tree-wide: add global ascii_isalpha() + ascii_isdigit() and use it everywhere

3 years agomachine: switch to BusLocator-oriented helpers
Quentin Deslandes [Tue, 5 Jul 2022 09:41:45 +0000 (02:41 -0700)] 
machine: switch to BusLocator-oriented helpers

Replace existing sd_bus_x calls with counterparts from bus-locator.h.

3 years agouser: delegate cpu controller, assign weights to user slices
Zbigniew Jędrzejewski-Szmek [Sat, 2 Jul 2022 08:33:49 +0000 (10:33 +0200)] 
user: delegate cpu controller, assign weights to user slices

So far we didn't enable the cpu controller because of overhead of the
accounting. If I'm reading things correctly, delegation was enabled for a while
for the units with user and pam context set, i.e. for user@.service too.
a931ad47a8623163a29d898224d8a8c1177ffdaf added the explicit Delegate=yes|no
switch, but it was initially set to 'yes'.
acc8059129b38d60c1b923670863137f8ec8f91a disabled delegation for user@.service
with the justication that CPU accounting is expensive, but half a year later
a88c5b8ac4df713d9831d0073a07fac82e884fb3 changed DefaultCPUAccounting=yes for
kernels >=4.15 with the justification that CPU accounting is inexpensive there.

In my (very noncomprehensive) testing, I don't see a measurable overhead if the
cpu controller is enabled for user slices. I tried some repeated compilations,
and there is was no statistical difference, but the noise level was fairly
high. Maybe better benchmarking would reveal a difference.

The goal of this change is very simple: currently all of the user session,
including services like the display server and pipewire are under user@.service.
This means that when e.g. a compilation job is started in the session's
app.slice, the processes in session.slice compete for CPU and can be starved.
In particular, audio starts to stutter, etc. With CPU controller enabled,
I can start start 'ninja -C build -j40' in a tab and this doesn't have any
noticable effect on audio.

I don't think the particular values matter too much: the CPU controller is
work-convserving, and presumably the session slice would never need more than
e.g. one 1 full CPU, i.e. half or a quarter of available CPU resources on even
the smallest of today's machines. app.slice and session.slice are assigned
equal weights, background.slice is assigned a smaller fraction. CPUWeight=100
is the default, but I wrote it explicitly to make it easier for users to see
how the split is done. So effectively this should result in session.slice
getting as much power as it needs.

If if turns out that this does have a noticable overhead, we could make it
opt-in. But I think that the benefit to usability is important enough to enable
it by default. W/o something like this the session is not really usable with
background tasks.

3 years agotree-wide: add global ascii_isdigit() + ascii_isalpha() 23906/head
Lennart Poettering [Tue, 5 Jul 2022 09:55:26 +0000 (11:55 +0200)] 
tree-wide: add global ascii_isdigit() + ascii_isalpha()

We now have a local implementation in string-util-fundamental.c, but
it's useful at a lot of other places, hence let's give it a more
expressive name and share it across the tree.

Follow-up for: 8d9156660d6958c8d63b1d44692968f1b5d33920

3 years agosd-id128: don't allow chars > f in valid id128 values
Lennart Poettering [Tue, 5 Jul 2022 12:10:33 +0000 (14:10 +0200)] 
sd-id128: don't allow chars > f in valid id128 values

3 years agoupdate TODO
Lennart Poettering [Tue, 5 Jul 2022 09:54:55 +0000 (11:54 +0200)] 
update TODO