1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-16 03:24:49 +03:00

58710 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
17021368fc generators: accept one or three args, do not write to /tmp
Since the general generator logic was established in the rewrite in
07719a21b6425d378b36bb8d7f47ad5ec5296d28, generators would always write to /tmp
by default. I think this not a good default at all, because generators write a
bunch of files and would create a mess in /tmp. And for debugging, one
generally needs to remove all the files in the output directory, because
generators will complain in the output paths are already present. Thus the
approach of disabling console logging and writing many files to /tmp when
invoked with no arguments is not nice, so let's disallow operation with no
args.

But when debugging, one generally does not care about the separate output dirs
(most generators use only one). Thus the general pattern I use is something
like:
  rm -rf /tmp/x && mkdir /tmp/x && build/some-generator /tmp/{x,x,x}
This commit allows only one directory to be specified and simplifies this to:
  rm -rf /tmp/x && mkdir /tmp/x && build/some-generator /tmp/x
2022-07-15 13:10:39 +02:00
Zbigniew Jędrzejewski-Szmek
b711a9ee18 bless-boot-generator: use DEFINE_MAIN_GENERATOR_FUNCTION()
DEFINE_MAIN_GENERATOR_FUNCTION() always sets dest*, so there should be no
change in behaviour.
2022-07-15 13:10:34 +02:00
Zbigniew Jędrzejewski-Szmek
b8110a3eb8 hibernate-resume-generator: use DEFINE_MAIN_GENERATOR_FUNCTION()
DEFINE_MAIN_GENERATOR_FUNCTION() always sets dest*, so there should be no
change in behaviour.
2022-07-15 13:09:38 +02:00
Zbigniew Jędrzejewski-Szmek
78f8ce6d90 environment-d-generator: use DEFINE_MAIN_FUNCTION() 2022-07-14 19:25:15 +02:00
Zbigniew Jędrzejewski-Szmek
9cfc294fe0 man: fix formatting of "BARRIER=1"
Whitespace inside of the <varname> field was propagated to the displayed form,
causing strange indentation.
2022-07-14 19:25:15 +02:00
Zbigniew Jędrzejewski-Szmek
8f41e6b636 core: wrap long comments and capitalize sentences 2022-07-14 19:25:15 +02:00
Lennart Poettering
93cbc9ca12 base-filesystem: pick more conservative access mode for /root/
Let's not allow anyone to look into /root/ if we create it via the
base-filesystem logic. i.e. change 0755 → 0750 as default access mode
for /root/, in case we create it if it happens to be missing.
2022-07-14 18:18:34 +02:00
Lennart Poettering
6ecc6c4536
Merge pull request #24008 from poettering/tmpfiles-is-dir-fix
tmpfiles: fix wrong is_dir_fd() call
2022-07-14 18:16:07 +02:00
undef
e9a28b8ccd growfs: Expand FS even if underlying block expansion fails
This allows growfs to expand the filesystem even when the underlying
block device cannot be expanded. This has been useful for example on
LUKS devices that have already been expanded using systemd-repart.

This works around the following error:
```
root@mobian:/home/mobian# /usr/lib/systemd/systemd-growfs /
crypt_resize() of /dev/block/179:2 failed: Operation not permitted
```
2022-07-14 18:13:23 +02:00
Lennart Poettering
0541980587
Merge pull request #24015 from poettering/growfs-fd-tweaks
growfs fd handling tweaks
2022-07-14 18:09:18 +02:00
Lennart Poettering
bbe29ca29b update TODO 2022-07-14 17:11:43 +02:00
Zbigniew Jędrzejewski-Szmek
b33c2757d8 kernel-install: add helper for logging 2022-07-14 22:20:49 +09:00
Lennart Poettering
1ab8cd794c import-ceds: use the right error variables at four places 2022-07-14 21:52:11 +09:00
Lennart Poettering
0fde330d66 update TODO 2022-07-14 14:45:56 +02:00
Lennart Poettering
1aad75efdf update TODO 2022-07-14 14:41:43 +02:00
undef
d26c0f7243 growfs: don't actually resize on dry-run
This causes systemd-growfs to exit before resizing the partition when
`--dry-run` is passed. Resizing during a dry run of a change breaks the
users expectations.
2022-07-14 21:23:11 +09:00
Lennart Poettering
8c77652334 update TODO 2022-07-14 14:04:36 +02:00
Luca Boccassi
f1298cd6a8
Merge pull request #24002 from yuwata/network-hw-addr
network: fix hardware address handling
2022-07-14 11:22:55 +01:00
Lennart Poettering
a39cc90d2b growfs: don't reopen fds unnecessarily
Instead, just open the mount fd once, and then operate on fds only.
2022-07-14 11:34:18 +02:00
Lennart Poettering
12810f3abb growfs: ensure that we operate on a block device before issuing a block ioctl
Similar to the previous commit: let's add extra safety so that we don't
issue ioctls on the wrong type of inode.
2022-07-14 11:31:50 +02:00
Lennart Poettering
2e7dd6682b growfs: insist we open a directory when opening fs mount point
This is a simple safety check, since we shouldn't invoke ioctls on fds
without being reasonably sure they are of the right type since ioctls
are overloaded, and we might be tricked hence to execute an operation on
an fd which means something different than what we expect.
2022-07-14 11:30:27 +02:00
Lennart Poettering
f95db4d6fa update TODO 2022-07-14 10:24:08 +02:00
Lennart Poettering
92631578ff tmpfiles: check the directory we were supposed to create, not its parent
This current code checks the wrong directory. This was broken in
4c39d899ff00e90b7290e4985696f321d7f2726f which converted the previous
code incorrectly.
2022-07-14 10:12:37 +02:00
Lennart Poettering
a586dc791c stat-util: replace is_dir() + is_dir_fd() by single is_dir_full() call
This new call can execute both of the old operations, but also do
generic fstatat() like behaviour.
2022-07-14 10:11:50 +02:00
Yu Watanabe
3f0dbb0f0c sd-bus: do not pass NULL when received message with invalid type
Fixes #24003.
2022-07-14 10:08:27 +02:00
Yu Watanabe
68870a46b3 sd-dhcp6-client: fix off-by-one error in parsing dhcp6 options
This fixes error in parsing message when the rapid commit option is
located at the end of the message.

Fixes an issure reported in #24002.
2022-07-14 10:49:18 +09:00
Yu Watanabe
d81b5a191e sd-dhcp6-client: allow NULL option value when length is zero 2022-07-14 10:49:14 +09:00
Yu Watanabe
50309ff785 sd-dhcp6-client: add more debugging logs on parsing message 2022-07-14 09:31:04 +09:00
Yu Watanabe
a5a8714187
Merge pull request #23882 from dtardon/logind-set-display-test
Add tests for org.freedesktop.login1.Session SetType and SetDisplay
2022-07-14 07:35:23 +09:00
Yu Watanabe
3be64aa462 network: do not set invalid MAC address for non-ethernet interface 2022-07-14 06:52:07 +09:00
Yu Watanabe
56bb67180a network: NDisc does not require MAC address
This effectively revert ba4c7184b320bb8698d470530d46a6c94641cc6e.

Fixes #23546.
2022-07-14 06:52:07 +09:00
Yu Watanabe
7e2f684e1f network: dhcp4: disable DHCPv4 client on interfaces with non-supported types
Replaces f42d41cc5f9cd8cac538a1c30fda04d346b5bae2.
2022-07-14 06:52:07 +09:00
Yu Watanabe
8f4f630731 Revert "network: configure DHCP clients after MAC address is assigned"
This reverts commit f42d41cc5f9cd8cac538a1c30fda04d346b5bae2.

DHCPv6 client does not require MAC address.
DHCPv4 client will be handled in a different way in a later commit.

Partially fixes #23546.
2022-07-14 06:51:59 +09:00
Michael Biebl
b0e5bf0451 Do not fail EFI build with newer binutils
Newer binutils versions currently trigger the following warnings due to
a bug in gnu-efi

on arm64:
/usr/bin/ld.bfd: warning: src/boot/efi/systemd-bootaa64.elf has a LOAD segment with RWX permissions

on amd64:
/usr/bin/ld.bfd: warning: /usr/lib/crt0-efi-x86_64.o: missing .note.GNU-stack section implies executable stack

This results in a build failure due to --fatal-warnings.
Work around this issue by suppressing those warnings until gnu-efi has
been fixed.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1013341
2022-07-13 18:48:07 +02:00
Zbigniew Jędrzejewski-Szmek
9e6df03412 man: lift pam_systemd_homed description to Summary
Also change the title to describe the module more comprehensively.
Follow-up for 90bc309aa2c1430941f4c50f73e681ab3e488bd3. Suggested
in https://bugzilla.redhat.com/show_bug.cgi?id=2085485#c5.
2022-07-13 14:00:54 +01:00
David Tardon
d1fa6c99bb test: add test for org.freedesktop.login1.Session SetDisplay 2022-07-13 13:53:13 +02:00
David Tardon
9ac0855b61 test: add test for org.freedesktop.login1.Session SetType 2022-07-13 13:53:13 +02:00
David Tardon
bd681a7eb0 test: ensure cleanup functions return success
Otherwise the return value of the last command is propagated, which may
cause spurious test failures. E.g., pkill returns 1 if no process
matched, which may be a problem in cleanup session:

cleanup_session() {
...

    pkill -u "$(id -u logind-test-user)"
    sleep 1
    pkill -KILL -u "$(id -u logind-test-user)"
}

If there are no remaining processes when the final pkill runs, it will
return 1 and therefore cleanup_session will return 1 as well.
2022-07-13 13:53:13 +02:00
Daan De Meyer
8ce1a3033f Add coredump daemons to bug/RFE template component options 2022-07-13 12:31:01 +01:00
Zbigniew Jędrzejewski-Szmek
44571ce98e
Merge pull request #23817 from yuwata/sd-device-send-udev-database-version
sd-device: send udev database version
2022-07-13 13:10:40 +02:00
Frantisek Sumsal
d46e7c7cfd ci: limit which env variables we pass through sudo
to work around #23987.
2022-07-13 10:56:37 +00:00
Yu Watanabe
f54dce2d4f test-network: save and restore timezone
Several DHCP client tests change the system timezone.
Let's save the current timezone at the beginning, and restore it with
the saved value at the end.
2022-07-13 10:30:48 +02:00
Yu Watanabe
0925c79c9e
Merge pull request #23881 from keszybz/kernel-install-strikes-yet-again
kernel-install: fix invocation as installkernel, add tests, tweak documentation
2022-07-13 02:44:50 +02:00
Yu Watanabe
e11d0e3925 test-network: wait for L2TP tunnels being removed
Fixes #23985.
2022-07-13 02:36:14 +02:00
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