1
0
mirror of https://github.com/systemd/systemd synced 2024-07-08 20:15:55 +00:00
Commit Graph

39021 Commits

Author SHA1 Message Date
Franck Bui
278e815bfa 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.
2022-07-12 22:54:39 +01:00
Łukasz Stelmach
aa5ae9711e 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.
2022-07-12 22:47:32 +01:00
Luca Boccassi
8880c3be82
Merge pull request #23982 from medhefgo/boot-misc
boot: Misc cleanups
2022-07-12 22:43:14 +01:00
Luca Boccassi
768456e8e6
Merge pull request #23979 from DaanDeMeyer/nspawn-relative-paths
nspawn: Support relative paths for --bind and --overlay
2022-07-12 22:41:10 +01:00
Daan De Meyer
448f737730 nspawn: Support relative source paths for --bind and --overlay 2022-07-12 13:14:11 +02:00
Jan Janssen
0692f533f2 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.
2022-07-12 11:29:59 +02:00
Jan Janssen
427ba45b13 bcd: Use std alignof 2022-07-12 11:29:18 +02:00
Jan Janssen
93521e55e5 boot: Remove _cleanup_freepool_ 2022-07-12 11:24:49 +02:00
Jan Janssen
1f6a5d9a65 boot: Use int instead of INTN 2022-07-12 11:24:49 +02:00
Jan Janssen
34938db5b3 boot: Use uintptr_t when converting EFI_PHYSICAL_ADDRESS
uintptr_t is the more appropriate type when casting to/from pointers.
2022-07-12 11:24:19 +02:00
Yu Watanabe
12799947e2
Merge pull request #23972 from yuwata/sd-device
sd-device: do not return -ENOENT by sd_device_get_is_initialized()
2022-07-11 22:44:56 +02:00
Yu Watanabe
64d847b886
Merge pull request #23974 from yuwata/align-tables
basic: align tables
2022-07-11 22:43:45 +02:00
Daan De Meyer
a50947c56b nspawn: Drop unnecessary intermediate variable 2022-07-11 21:38:26 +02:00
Topi Miettinen
3295d0d896 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.
2022-07-11 18:37:38 +00:00
Yu Watanabe
4eb5f1db44 sd-device: shorten code a bit 2022-07-11 15:27:21 +02:00
Lennart Poettering
39e419a2b5 tree-wide: trivial tweaks 2022-07-11 15:11:58 +02:00
Yu Watanabe
ef674d0ea3 unit-def: align string tables 2022-07-11 14:19:59 +02:00
Yu Watanabe
5c86cec1f3 virt: align tables 2022-07-11 14:13:33 +02:00
Yu Watanabe
591c186f2f sd-device: make sd_device_get_is_initialized() not return -ENOENT 2022-07-11 14:08:52 +02:00
Luca Boccassi
8924cbf34a
Merge pull request #23962 from keszybz/taint-flag-support-ended
Taint flag "support-ended"
2022-07-10 22:42:56 +01:00
Zbigniew Jędrzejewski-Szmek
4bd035153b 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.
---
2022-07-10 14:33:52 +02:00
Yu Watanabe
0d609349ba resolve: introduce FORMAT_DNS_RCODE() macro
Fixes #23958.
2022-07-09 19:51:23 +09:00
Yu Watanabe
3857d367f0 sd-dhcp-client: fix log message 2022-07-09 11:44:25 +09:00
Yu Watanabe
d5ad2ec1d4 network: drop redundant warning
If file is world readable, then `read_full_file_full()` will warn
about that.
2022-07-09 01:09:23 +01:00
Luca Boccassi
b2e8f2d853
Merge pull request #23940 from yuwata/core-extract-first-word
core: fix error value in log_syntax()
2022-07-09 01:09:06 +01:00
Luca Boccassi
89f119b654
Merge pull request #23731 from bluca/bootctl_image
bootctl: add --root and --image
2022-07-08 21:59:16 +01:00
Evgeny Vereshchagin
686a0d387d
Merge pull request #23954 from yuwata/resolve-overflow
resolve: fix heap-buffer-overflow
2022-07-08 23:39:31 +03:00
Yu Watanabe
d38655d792 core/cgroup: drop unnecessary else 2022-07-09 03:37:43 +09:00
Yu Watanabe
fe1ed553b3 core: shorten code a bit 2022-07-09 03:37:43 +09:00
Yu Watanabe
6a35d52d78 core/load-fragment: fix error value in log_syntax()
`extract_first_word()` may return positive value on success.
2022-07-09 03:36:58 +09:00
Luca Boccassi
02d06ba180 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.
2022-07-08 16:58:51 +01:00
Luca Boccassi
80a2381d5c bootctl: add --root and --image
Operate on image/directory, and also take files to install from it
2022-07-08 16:58:15 +01:00
Lennart Poettering
03bc11d1c4 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.
2022-07-08 17:43:49 +02:00
Lennart Poettering
05c4affe04 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.
2022-07-08 16:11:20 +02:00
Lennart Poettering
979055ba73
Merge pull request #23946 from poettering/tmpfiles-extrat-dir-fn
tmpfiles: port from basename()/dirname() → path_extract_direcory()/path_extract_filename()
2022-07-08 16:10:42 +02:00
Lennart Poettering
ebbbf44ab9 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.
2022-07-08 16:10:26 +02:00
Yu Watanabe
9102c625a6 time-util: fix buffer-over-run
Fixes #23928.
2022-07-08 16:09:46 +02:00
Lennart Poettering
ef8304de53 smack: catch more types of 'not supported' errors 2022-07-08 16:09:27 +02:00
Lennart Poettering
2f3745dd26 tmpfiles: shorten code a bit 2022-07-08 16:09:06 +02:00
Yu Watanabe
370999c05b resolve: fix possible integer overflow 2022-07-08 22:13:24 +09:00
Yu Watanabe
beeab352de resolve: fix heap-buffer-overflow reported by ASAN with strict_string_checks=1
Fixes #23942.
2022-07-08 22:01:02 +09:00
Lennart Poettering
4609d3bb07 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.
2022-07-08 11:35:13 +02:00
Lennart Poettering
70980a39b8 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.
2022-07-08 11:35:00 +02:00
Lennart Poettering
149e0ca6c7 tmpfiles: correct error variable to use 2022-07-08 10:41:19 +02:00
Lennart Poettering
1ce268c789 namespace: fix propagated error number 2022-07-08 10:40:40 +02:00
Frantisek Sumsal
db835e5d0e
Merge pull request #23931 from yuwata/systemctl-color-log
systemctl: colorize logs
2022-07-07 13:15:59 +00:00
Jan Janssen
b30a43dfd7 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.
2022-07-07 10:43:49 +02:00
Jan Janssen
04f316f0ee boot: Use typedef for PE structs 2022-07-07 10:16:26 +02:00
Jan Janssen
6028dd6d8e boot: Constify PE sections type 2022-07-07 10:08:51 +02:00
Jan Janssen
008f47f139 boot: Use void for base pointer 2022-07-07 10:08:18 +02:00