1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

66972 Commits

Author SHA1 Message Date
Frantisek Sumsal
5599c84bcd test: fix debugging of nspawn tests
The pipe stuff introduced in 701e0c2660 causes nspawn to switch the
console from 'interactive' into 'read-only' which is a bit useless when
debugging. Let's set --console=interactive explicitly in such case.

Follow-up to 701e0c2660.
2023-08-29 01:08:08 +01:00
Luca Boccassi
337e8504f7
Merge pull request #28328 from yuwata/network-ndisc-limit-captive-portal
network: limit number of captive portals by RA
2023-08-28 17:45:22 +01:00
Mike Yuan
08a5bc4f48 Revert "Revert "test: add test case for systemd-update-utmp vs daemon-reexec""
This reverts commit 837773add465bd0a0d1f598203d297cf0129468b.

The original issue #27287 is fixed by #28123. Let's
reintroduce the test for systemd-update-utmp.
2023-08-28 17:43:57 +01:00
Luca Boccassi
cd4ed8579b
Merge pull request #28948 from poettering/tpm2-duplicate-pcr-names
tpm2: unify tpm2 PCR symbolic identifiers
2023-08-28 17:43:10 +01:00
Luca Boccassi
f154440980
Merge pull request #28916 from ddstreet/tpm2_pcr_value_post_merge
Tpm2 pcr value post merge
2023-08-28 17:42:48 +01:00
msizanoen
99d4ad71b7 login: Properly handle -EIO in session_leave_vt
session_leave_vt may be called after the VT device was hung up, which
will cause vt_release to fail with -EIO. This is known to cause an issue
with GNOME 44 on Fedora where gdm-session-worker sometimes freezes when
trying to switch to VT 1 after a `loginctl terminate-user` operation.

Fix this by reopening the VT in session_leave_vt if we get an -EIO.
2023-08-28 17:35:24 +03:00
Susant Sahani
1a6b1214af sd-radv: fix memory leak 2023-08-28 14:07:16 +01:00
Zbigniew Jędrzejewski-Szmek
56a0b9065e meson: restore specifications of dependency on version_h
This partially reverts 3c1eee5beda642707037b189481c3c30d1668da7.
I thought that it is not necessary, but
https://mesonbuild.com/Reference-manual_functions.html#vcs_tag says:

> This method returns a custom_tgt should be used to signal dependencies if
> other targets use the file outputted by this.
>
> For example, if you generate a header with this and want to use that in a
> build target, you must add the return value to the sources of that build
> target. Without that, Meson will not know the order in which to build the
> targets.

We can use version_h directly, since we already have it.

Hopefully fixes https://github.com/systemd/systemd/issues/28994.
2023-08-28 14:06:23 +01:00
Luca Boccassi
1686c884bf test-dhcp-client: add temporary workaround for assertion failure
Workaround for https://github.com/systemd/systemd/issues/28990

Introduced by https://github.com/systemd/systemd/pull/28932 but CI was
green there. Add a workaround to get the CI back in shape while it is
being investigated.
2023-08-28 12:29:10 +01:00
Lennart Poettering
73f0eedf9b boot: don't pass kernel cmdline option to UKIs which have the very same line built-in
There's really no point in first extracting a command line from an UKI
to just pass it unmodified to the UKI. In particular as this is
systematically ignored in SecureBoot is enabled.

Let's drop this, so that unless the user actually edits the cmdline we
pass nothing to the invoked kernel.

Note that this low-key is a compat break, since the passed cmdline gets
measured. However, in the interest of minimized the difference between
systems with and without sd-boot to behave the same i think we should
suppress the command line anyway.
2023-08-28 11:24:53 +01:00
Chris Patterson
23cbe90d7d 99-systemd.rules.in: tag PTP devices with systemd
Chronyd and similar time services, when using PTP devices, may need
the BindsTo/After directives to ensure the devices are available
before starting.  Tag PTP devices with systemd to allow for wider
adoption.

Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
2023-08-28 10:42:27 +01:00
Yu Watanabe
b2851e8d62 sd-dhcp-client: make client initially in stopped state
Previously, DHCP_STATE_STOPPED and DHCP_STATE_INIT are both handled as
not-running. Moreover, previously after sd_dhcp_client_start() is
called, the client still in INIT state (and thus handled as not-running)
even if its internal timer event sources are initialized.

Let's make only STOPPED state handled as not-running, and make the
client initially in STOPPED state.

Prompted by #28896.
2023-08-28 10:25:14 +01:00
Michael Vasseur
c91d636fad pkg.m4 macro needs brackets
See documentation at: https://manpages.debian.org/testing/pkgconf/pkg.m4.7.en.html

Without this the macro was not always correctly resolved so the correct command was not used in the rest of the snippet.
2023-08-28 10:07:26 +01:00
Luca Boccassi
4c427929e0
Merge pull request #28977 from keszybz/drop-versiondep
meson: simplify handling of the version tag
2023-08-28 10:02:01 +01:00
Zbigniew Jędrzejewski-Szmek
7abb0eef8f man/gpt-auto-generator: avoid saying "negative" for boolean
Fixes #28928.
2023-08-28 09:46:54 +01:00
Zbigniew Jędrzejewski-Szmek
6f420b5f75
Merge pull request #28968 from DaanDeMeyer/rlimit
Limit rlim_max in rlimit_nofile_safe() to nr_open
2023-08-27 16:06:58 +02:00
Alvin Alvarado
c766e05f29 man: Fix typo in config file example for ukify
or else it would output 'Unknown config setting [UKI] SecureBootCerificate=' or just an error outright if not overrode.
2023-08-27 15:03:49 +08:00
Zbigniew Jędrzejewski-Szmek
3c1eee5bed meson: drop "versiondep" object
It was added to make sure that the version tag was built early
enough. Now that we use vcs_tag, meson should take care of building
it early enough.
2023-08-26 17:16:59 +02:00
Zbigniew Jędrzejewski-Szmek
1671799bee meson: simplify version_tag handling
Let's also use vcs_tag() when we're doing a non-git build. In those scenarios,
the build would normally be done just once in a given copy, so doing an extra
call does not matter. We can save a few lines of meson config.

The special path was added in 064b8e2c99ceb348c515353cc5c7d7bd05c49fcb, with
the justifaction that vcs_tag() is slow and -Dversion-tag=foo can be used to
fix the version tag and speed up partial rebuilds. I think the justification
for this is weak: having an accurate version tag is particularly useful when
developing the code. Shaving of a fraction of a second at the cost of having to
manually update the version seems iffy.

Secondly, with vcs_tag() we can be pretty sure that meson will build the
version file first and that it'll be available to all build steps. Because we
didn't use version tag, we had to manually specify the dependency on version.h
in various places. It seems nicer to use vcs_tag() and not have to deal with
this problem at all.

Finally, the savings in time seem much smaller than back when
064b8e2c99ceb348c515353cc5c7d7bd05c49fcb was made. It reported a change
from 94 ms to 521 ms. But now the difference seems to be about 50 ms:

Before this patch:
$ time ninja -C build
ninja: Entering directory `build'
ninja: no work to do.
ninja -C build  0.04s user 0.02s system 97% cpu 0.057 total
ninja -C build  0.03s user 0.01s system 97% cpu 0.049 total
ninja -C build  0.03s user 0.02s system 96% cpu 0.051 total
ninja -C build  0.03s user 0.01s system 96% cpu 0.049 total
ninja -C build  0.03s user 0.01s system 97% cpu 0.046 total

With the two patches in this PR:
systemd-stable [drop-versiondep] time ninja -C build
ninja: Entering directory `build'
[1/669] Generating version.h with a custom command
ninja -C build  0.08s user 0.03s system 98% cpu 0.106 total
ninja -C build  0.08s user 0.03s system 98% cpu 0.104 total
ninja -C build  0.09s user 0.02s system 98% cpu 0.116 total
ninja -C build  0.08s user 0.02s system 97% cpu 0.108 total

Overall, I think the tiny time savings are not worth the complexity.
2023-08-26 17:09:10 +02:00
Juno Computers
8a76d3cc70
Update 60-sensor.hwdb (#28804)
Updated T11/Juno Tab 2.
2023-08-26 22:35:57 +09:00
Jan Janssen
c78b611e48 meson: Bring back use of vcs_tag
The use of vcs_tag was dropped in #28567, which results in builds having
stale version information once new commit are made.

This also fixes a case where CI builds would have no version information
because they are checked out without any tags for git-describe to use.

Additionally, use `--git-dir` now, as that particular issues seems to
have been fixed by now.
2023-08-26 13:53:42 +09:00
Mike Yuan
82007efa44 mount/mount-tool: return correct errno
Follow-up for 9269296df05a724c6b121bcbb0b420c8b4088f2f
2023-08-26 09:27:23 +09:00
Zbigniew Jędrzejewski-Szmek
3b9b33a143
Merge pull request #28913 from keszybz/tmpfs-top-level-dir-mode
systemd-mount: do not create tmpfs mounts with sticky permission bit
2023-08-25 18:36:30 +02:00
Susant Sahani
1925f829ab network: sd-radv - Introduce pref64 support (RFC8781)
Implements: https://datatracker.ietf.org/doc/html/rfc8781

```

[IPv6PREF64Prefix]
Prefix=2003:da8:1:0::/64
ValidLifetimeSec=30m

Frame 16: 126 bytes on wire (1008 bits), 126 bytes captured (1008 bits) on interface veth99, id 0
Ethernet II, Src: 06:c7:41:95:1d:7f (06:c7:41:95:1d:7f), Dst: IPv6mcast_01 (33:33:00:00:00:01)
Internet Protocol Version 6, Src: fe80::4c7:41ff:fe95:1d7f, Dst: ff02::1
Internet Control Message Protocol v6
    Type: Router Advertisement (134)
    Code: 0
    Checksum: 0x0ca0 [correct]
    [Checksum Status: Good]
    Cur hop limit: 0
    Flags: 0x00, Prf (Default Router Preference): Medium
    Router lifetime (s): 1800
    Reachable time (ms): 0
    Retrans timer (ms): 0
    ICMPv6 Option (Source link-layer address : 06:c7:41:95:1d:7f)
    ICMPv6 Option (Prefix information : 2002:da8:1::/64)
    ICMPv6 Option (PREF64 Option)
        Type: PREF64 Option (38)
        Length: 2 (16 bytes)
        0000 0111 0000 1... = Scaled Lifetime: 225
        .... .... .... .001 = PLC (Prefix Length Code): 64 bits prefix length (0x1)
        Prefix: 64:ff9b::

```
2023-08-25 15:13:06 +02:00
Daan De Meyer
f470dafddc Limit rlim_max in rlimit_nofile_safe() to nr_open
We might inherit a max rlim value that's larger than the kernel's
maximum (nr_open). This will cause setrlimit() to fail as the given
maximum is larger than the kernel's maximum. To get around this,
let's limit the max rlim we pass to rlimit() to the value of nr_open.

Should fix #28965
2023-08-25 14:26:11 +02:00
Daan De Meyer
fbc6a75571 mkfs-util: Set FORK_REOPEN_LOG
We set FORK_CLOSE_ALL_FDS, so we should also set FORK_REOPEN_LOG to
reopen the log in the child process so we don't miss any logging
messages.
2023-08-25 14:25:33 +02:00
Dan Streetman
a11a2e059c cryptenroll: change man page example to remove leading 0x and lowercase hex 2023-08-24 12:35:58 -04:00
Dan Streetman
81e3d37211 tpm2: wrap (7) in UINT32_C() 2023-08-24 12:35:58 -04:00
Dan Streetman
26d8d71fa5 tpm2: add tpm2_pcr_values_has_(any|all)_values() functions 2023-08-24 12:35:58 -04:00
Dan Streetman
70cb382d36 tpm2: remove unnecessary void* cast 2023-08-24 12:35:58 -04:00
Dan Streetman
ed35ac3155 tpm2: make logging level consistent at debug for some functions 2023-08-24 12:35:58 -04:00
Dan Streetman
3f4d5dfd65 tpm2: use switch() instead of if-else 2023-08-24 12:35:58 -04:00
Dan Streetman
6761e1355e tpm2: use table for openssl<->tpm2 ecc curve id mappings 2023-08-24 12:35:54 -04:00
Dan Streetman
b030710295 openssl: use new(char, size) instead of malloc(size) 2023-08-24 12:33:26 -04:00
Dan Streetman
65fd657e0a tpm2: use memcpy_safe() instead of memcpy() 2023-08-24 12:33:26 -04:00
Dan Streetman
ae2b38e463 tpm2: remove ret_ prefix from input/output params 2023-08-24 12:33:26 -04:00
Dan Streetman
c6e5178220 tpm2: split TPM2_PCR_VALUE_MAKE() over multiple lines 2023-08-24 12:33:26 -04:00
Dan Streetman
85b6f299b2 tpm2: use strempty() 2023-08-24 12:33:26 -04:00
Dan Streetman
8e757259c3 tpm2: check pcr value hash != 0 before looking up hash algorithm name 2023-08-24 12:33:26 -04:00
Dan Streetman
495f2bf57c tpm2: simplify call to asprintf() 2023-08-24 12:33:26 -04:00
Dan Streetman
2b2ee3f265 tpm2: put !isempty() check inside previous !isempty() check 2023-08-24 12:33:26 -04:00
Dan Streetman
7001a7daf7 tpm2: use SIZE_MAX instead of strlen() for unhexmem() 2023-08-24 12:33:26 -04:00
Dan Streetman
193fd5730e tpm2: in tpm2_pcr_values_valid() use FOREACH_ARRAY() 2023-08-24 12:32:51 -04:00
Dan Streetman
064ac95d81 tpm2: in validator functions, return false instead of assert failure 2023-08-24 12:31:00 -04:00
Dan Streetman
3cd4145f34 tpm2: move cast from lhs to rhs in uint16_t/int comparison 2023-08-24 12:31:00 -04:00
Dan Streetman
cc1a78d5c4 tpm2: lowercase TPM2_PCR_VALUE[S]_VALID functions
As these are not macros, they should be lowercase.
2023-08-24 12:31:00 -04:00
Dan Streetman
7354a7ccd4 tpm2: change *alg_to_* functions to use switch() 2023-08-24 12:31:00 -04:00
Zbigniew Jędrzejewski-Szmek
ebbc92405b
Merge pull request #28917 from yuwata/network-address-pool
undefined
2023-08-24 15:58:31 +02:00
Yu Watanabe
927e20fa49 nspawn: check validity of the internal interface name only explicitly specified
Follow-up for 2f091b1b49543aade4aad9ec3b35b3665abac3e7.

Fixes #28844.
2023-08-24 15:55:32 +02:00
Zbigniew Jędrzejewski-Szmek
6d9829e724 man/repart: use <filename> and add missing <para> 2023-08-24 15:45:24 +02:00