Franck Bui [Thu, 7 Jul 2022 10:02:04 +0000 (12:02 +0200)]
logind: don't delay login for root even if systemd-user-sessions.service is not activated yet
If for any reason something goes wrong during the boot process (most likely due
to a network issue), system admins should be allowed to log in to the system to
debug the problem. However due to the login session barrier enforced by
systemd-user-sessions.service for all users, logins for root will be delayed
until a (dbus) timeout expires. Beside being confusing, it's not a nice user
experience to wait for an indefinite period of time (no message is shown) this
and also suggests that something went wrong in the background.
The reason of this delay is due to the fact that all units involved in the
creation of a user session are ordered after systemd-user-sessions.service,
which is subject to network issues. If root needs to log in at that time,
logind is requested to create a new session (via pam_systemd), which ultimately
ends up waiting for systemd-user-session.service to be activated. This has the
bad side effect to block login for root until the dbus call done by pam_systemd
times out and the PAM stack proceeds anyways.
To solve this problem, this patch orders the session scope units and the user
instances only after systemd-user-sessions.service for unprivileged users only.
Łukasz Stelmach [Wed, 6 Jul 2022 11:09:51 +0000 (13:09 +0200)]
smack: Add DefaultSmackProcessLabel to user.conf and system.conf
DefaultSmackProcessLabel tells systemd what label to assign to its child
process in case SmackProcessLabel is not set in the service file. By
default, when DefaultSmackProcessLabel is not set child processes inherit
label from systemd.
If DefaultSmackProcessLabel is set to "/" (which is an invalid character
for a SMACK label) the DEFAULT_SMACK_PROCESS_LABEL set during compilation
is ignored and systemd act as if the option was unset.
Luca Boccassi [Tue, 12 Jul 2022 21:43:14 +0000 (22:43 +0100)]
Merge pull request #23982 from medhefgo/boot-misc
boot: Misc cleanups
Luca Boccassi [Tue, 12 Jul 2022 21:41:10 +0000 (22:41 +0100)]
Merge pull request #23979 from DaanDeMeyer/nspawn-relative-paths
nspawn: Support relative paths for --bind and --overlay
Daan De Meyer [Mon, 11 Jul 2022 19:45:08 +0000 (21:45 +0200)]
nspawn: Support relative source paths for --bind and --overlay
Jan Janssen [Tue, 12 Jul 2022 08:01:03 +0000 (10:01 +0200)]
bcd: Clean up includes
Also, now that bcd.h does not depend on efi.h anymore we can now
properly include it in the test instead.
Jan Janssen [Tue, 12 Jul 2022 07:52:29 +0000 (09:52 +0200)]
bcd: Use std alignof
Jan Janssen [Tue, 12 Jul 2022 07:48:38 +0000 (09:48 +0200)]
boot: Remove _cleanup_freepool_
Jan Janssen [Tue, 12 Jul 2022 07:46:44 +0000 (09:46 +0200)]
boot: Use int instead of INTN
Jan Janssen [Tue, 12 Jul 2022 07:43:13 +0000 (09:43 +0200)]
boot: Use uintptr_t when converting EFI_PHYSICAL_ADDRESS
uintptr_t is the more appropriate type when casting to/from pointers.
Yu Watanabe [Mon, 11 Jul 2022 23:27:36 +0000 (01:27 +0200)]
Merge pull request #23980 from yuwata/test-network
test-network: tiny output improvements
Yu Watanabe [Mon, 11 Jul 2022 20:44:56 +0000 (22:44 +0200)]
Merge pull request #23972 from yuwata/sd-device
sd-device: do not return -ENOENT by sd_device_get_is_initialized()
Michal Stanke [Mon, 11 Jul 2022 12:11:12 +0000 (14:11 +0200)]
Fix automatic screen rotation for Asus Transformer T100TAM
Yu Watanabe [Mon, 11 Jul 2022 20:43:45 +0000 (22:43 +0200)]
Merge pull request #23974 from yuwata/align-tables
basic: align tables
Yu Watanabe [Mon, 11 Jul 2022 20:32:10 +0000 (22:32 +0200)]
test-network: support to remove routing policy rules with l3mdev flag
Yu Watanabe [Mon, 11 Jul 2022 20:31:12 +0000 (22:31 +0200)]
test-network: merge stdout and stderr of invoked command by call()
Otherwise, the logs may be messed up.
Lennart Poettering [Mon, 11 Jul 2022 13:12:24 +0000 (15:12 +0200)]
man: explain why pam_systemd_home wants to be in all four stacks
Suggested here:
https://bugzilla.redhat.com/show_bug.cgi?id=
2085485#c5
Frantisek Sumsal [Mon, 11 Jul 2022 20:03:04 +0000 (20:03 +0000)]
Merge pull request #23969 from yuwata/test-network
test-network: fixlets and performance improvements
Daan De Meyer [Mon, 11 Jul 2022 19:43:41 +0000 (21:43 +0200)]
nspawn: Rewrap --overlay docs
Daan De Meyer [Mon, 11 Jul 2022 19:38:26 +0000 (21:38 +0200)]
nspawn: Drop unnecessary intermediate variable
Topi Miettinen [Sun, 10 Jul 2022 09:17:32 +0000 (12:17 +0300)]
sd-netlink: add sizes for some IP and Ethernet addresses
Add sizes for some uses of NETLINK_TYPE_IN_ADDR and NETLINK_TYPE_ETHER_ADDR
types.
Yu Watanabe [Sat, 9 Jul 2022 11:05:23 +0000 (20:05 +0900)]
test-network: various cleanups
- introduce several helper functions
- do not list unit files, but remove the runtime unit directory in
tearDown().
- do not list used interfaces, but remove all interfaces previously not
exists in tearDown().
- save routes and routing policy rules before running tests, and flush
unnecessary routes and rules in each tearDown() calls.
- drop many time.sleep() calls.
- call tearDown() after each sub tests.
- shorten code.
- several coding style fixes.
- etc, etc...
Hopefully, this improves performance of the test.
Lennart Poettering [Mon, 11 Jul 2022 15:37:41 +0000 (17:37 +0200)]
update TODO
Yu Watanabe [Sun, 10 Jul 2022 21:54:40 +0000 (23:54 +0200)]
test-network: extend timeout for DHCP lease to be expired
Fixes #23964.
Yu Watanabe [Mon, 11 Jul 2022 10:02:31 +0000 (12:02 +0200)]
sd-device: shorten code a bit
Lennart Poettering [Mon, 11 Jul 2022 13:10:38 +0000 (15:10 +0200)]
tree-wide: trivial tweaks
Lennart Poettering [Fri, 8 Jul 2022 16:05:12 +0000 (18:05 +0200)]
update TODO
Luca Boccassi [Mon, 11 Jul 2022 10:08:14 +0000 (11:08 +0100)]
mkosi: update to latest main
Fix build failure on SUSE Tumbleweed due to config changes
Yu Watanabe [Mon, 11 Jul 2022 12:19:59 +0000 (14:19 +0200)]
unit-def: align string tables
Yu Watanabe [Mon, 11 Jul 2022 12:13:33 +0000 (14:13 +0200)]
virt: align tables
Yu Watanabe [Mon, 11 Jul 2022 10:02:04 +0000 (12:02 +0200)]
sd-device: make sd_device_get_is_initialized() not return -ENOENT
Luca Boccassi [Sun, 10 Jul 2022 21:42:56 +0000 (22:42 +0100)]
Merge pull request #23962 from keszybz/taint-flag-support-ended
Taint flag "support-ended"
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.
---
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.
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.
Yu Watanabe [Sat, 9 Jul 2022 06:56:50 +0000 (15:56 +0900)]
resolve: introduce FORMAT_DNS_RCODE() macro
Fixes #23958.
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
Yu Watanabe [Sat, 9 Jul 2022 03:20:11 +0000 (12:20 +0900)]
test-network: use wait_operstate() at one more place
Yu Watanabe [Sat, 9 Jul 2022 03:19:52 +0000 (12:19 +0900)]
test-network: suppress periodic output in wait_operstate()
Yu Watanabe [Sat, 9 Jul 2022 02:59:38 +0000 (11:59 +0900)]
test-network: disable debugging logs from networkctl, resolvectl, and so on
Yu Watanabe [Sat, 9 Jul 2022 01:13:33 +0000 (10:13 +0900)]
test-network: merge two DHCPv6 client tests
Yu Watanabe [Sat, 9 Jul 2022 01:07:17 +0000 (10:07 +0900)]
test-network: replace sleep with wait_address() and wait_address_dropped()
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
Yu Watanabe [Sat, 9 Jul 2022 00:49:20 +0000 (09:49 +0900)]
test-network: merge tests for UseDNS=
Yu Watanabe [Fri, 8 Jul 2022 23:58:48 +0000 (08:58 +0900)]
test-network: merge two IPv4LL tests
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.
Yu Watanabe [Fri, 8 Jul 2022 22:52:11 +0000 (07:52 +0900)]
sd-dhcp-client: fix log message
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.
Yu Watanabe [Fri, 8 Jul 2022 22:15:37 +0000 (07:15 +0900)]
test-network: drop 25-dhcp-v4-server-veth-peer.network
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.
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.
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.
Yu Watanabe [Fri, 8 Jul 2022 21:17:46 +0000 (06:17 +0900)]
test-network: introduce read_link_state_file() helper function
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.
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()
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
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
Yu Watanabe [Thu, 7 Jul 2022 21:22:59 +0000 (06:22 +0900)]
core/cgroup: drop unnecessary else
Yu Watanabe [Thu, 7 Jul 2022 21:20:03 +0000 (06:20 +0900)]
core: shorten code a bit
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.
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.
Luca Boccassi [Sun, 12 Jun 2022 23:22:46 +0000 (00:22 +0100)]
Update TODO
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.
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
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.
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.
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()
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.
Yu Watanabe [Thu, 7 Jul 2022 09:27:02 +0000 (18:27 +0900)]
time-util: fix buffer-over-run
Fixes #23928.
Lennart Poettering [Thu, 7 Jul 2022 22:08:22 +0000 (00:08 +0200)]
smack: catch more types of 'not supported' errors
Lennart Poettering [Fri, 8 Jul 2022 08:05:39 +0000 (10:05 +0200)]
tmpfiles: shorten code a bit
Yu Watanabe [Fri, 8 Jul 2022 13:13:24 +0000 (22:13 +0900)]
resolve: fix possible integer overflow
Yu Watanabe [Fri, 8 Jul 2022 07:32:38 +0000 (16:32 +0900)]
test-network: merge DHCP client tests to improve performance
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.
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
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.
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.
Lennart Poettering [Thu, 7 Jul 2022 21:18:38 +0000 (23:18 +0200)]
update TODO
Lennart Poettering [Fri, 8 Jul 2022 07:59:57 +0000 (09:59 +0200)]
tmpfiles: correct error variable to use
Lennart Poettering [Thu, 7 Jul 2022 21:20:31 +0000 (23:20 +0200)]
namespace: fix propagated error number
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
Yu Watanabe [Thu, 7 Jul 2022 22:00:42 +0000 (07:00 +0900)]
test: use timeout command to improve performance
c.f. #23723.
Yu Watanabe [Thu, 7 Jul 2022 22:00:02 +0000 (07:00 +0900)]
test: remove /failed and /testok before running test script
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
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
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).
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.
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.
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.
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.
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
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
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
Frank Dana [Thu, 7 Jul 2022 10:56:04 +0000 (06:56 -0400)]
resolvectl man page: Word correction
Yu Watanabe [Thu, 7 Jul 2022 10:59:05 +0000 (19:59 +0900)]
Merge pull request #23932 from medhefgo/boot-misc
boot: Miscellaneous cleanups
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.
Jan Janssen [Thu, 7 Jul 2022 08:16:26 +0000 (10:16 +0200)]
boot: Use typedef for PE structs
Jan Janssen [Mon, 20 Jun 2022 11:43:47 +0000 (13:43 +0200)]
boot: Constify PE sections type
Jan Janssen [Mon, 20 Jun 2022 11:10:41 +0000 (13:10 +0200)]
boot: Use void for base pointer
Jan Janssen [Tue, 5 Jul 2022 08:28:30 +0000 (10:28 +0200)]
boot: Use open_volume when creating cpio