1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-22 22:03:43 +03:00

62345 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
b7a8a33a03
Merge pull request #26292 from yuwata/locale-fix-enoent-handling
locale: fix ENOENT handling for vconsole.conf or xorg.conf
2023-02-02 11:01:56 +01:00
Yu Watanabe
ff6db56a01 test-time-util: skip test for TIMESTAMP_DATE if the timestamp is too old
Follow-up for 64f3419ec1f56a93b6dd48137ca40c945fc06c59.

If the input timestamp is too old (say, 1min since 1970-01-01), then
parse_timestamp() may fail on a timezone with positive shift e.g.
JST (UTC+9). Moreover, even if parse_timestamp() succeeds, its result
'y' and 'usec_sub_unsigned(x, 2 * USEC_PER_DAY)' are both zero, and
the assertion will be triggered.

Fixes #26172.
2023-02-02 10:59:59 +01:00
Yu Watanabe
cf74e2e16f udev: make get_virtfn_info() provide physical PCI device
Fixes a bug introduced by 78463c6c4fdcb703bc0dc694c3ea77df3c5624e0.

Fixes #25545.
2023-02-01 23:41:48 +00:00
Luca Boccassi
5b5aaf9a91
Merge pull request #26180 from ddstreet/tpm2_cleanup
Add struct tpm2_handle and use _cleanup_ instead of goto
2023-02-01 23:40:52 +00:00
Luca Boccassi
9a101c5d4c
Merge pull request #26269 from keszybz/sysusers-empty-etc-and-improved-messages
sysusers: improve messages and autocreate /etc
2023-02-01 23:14:59 +00:00
Luca Boccassi
8310229a04 man: add page for systemd-ac-power
It is now a supported executable, so add manpage.

Fixes https://github.com/systemd/systemd/issues/26289
2023-02-01 21:56:28 +00:00
Luca Boccassi
e5cf396181
Merge pull request #26287 from medhefgo/mkosi-auto-enroll
ci: Test with secure boot enabled under mkosi
2023-02-01 21:51:04 +00:00
Frantisek Sumsal
cc3826155d
Merge pull request #26285 from yuwata/test-lvextend
test: add a testcase for lvextend
2023-02-01 20:59:04 +00:00
wouter bolsterlee
3d3e51eff2 docs: tweak rsync flags for moving existing home dir to systemd-homed
The documentation on moving an existing homedir into a systemd-homed managed
one suggests using rsync(1) with a bunch of flags to preserve as much metadata
as possible: permissions, xattrs, timestamps, etc. The previously suggested
flags were:

    rsync -aHAXv --remove-source-files …

… which does include mtimes, but not ctimes and atimes, because -a does not
include those:

    --archive, -a            archive mode is -rlptgoD (no -A,-X,-U,-N,-H)

This change adds the -N and -U flags to preserve even more file timestamps,
turning the command into:

    rsync -aHANUXv --remove-source-files …

The new flags are:

    --crtimes, -N            preserve create times (newness)
    --atimes, -U             preserve access (use) times
2023-02-01 20:47:56 +00:00
Yu Watanabe
c4abc55890 locale: drop context_clear_x11()
It is used at only place, and mostly trivial.
No functional change, just refactoring.
2023-02-02 03:59:21 +09:00
Yu Watanabe
181ba13b23 locale: fix ENOENT handling for vconsole.conf or xorg.conf 2023-02-02 03:59:21 +09:00
Dan Streetman
16e16b8c7b tpm2: add Tpm2Handle with automatic cleanup
This allows using _cleanup_ with the handles, which then allows removing the
use of goto in all functions that use the handles.
2023-02-01 12:52:08 -05:00
Dan Streetman
23e9ccc24a tpm2: use Tpm2Context* instead of ESYS_CONTEXT*
This is needed for later patches that use Tpm2Handle, which requires access
to the Tpm2Context.
2023-02-01 12:51:17 -05:00
Dan Streetman
68d084cee5 tpm2: use ref counter for Tpm2Context
This will be used by Tpm2Handle instances, which is added in later patches.

The refcounting allows the context to be retained until all Tpm2Handles have
been cleaned up, and the initial ref is released, before cleaning the context.
2023-02-01 12:51:17 -05:00
Dan Streetman
bd860983a6 tpm2: rename struct tpm2_context to Tpm2Context
This aligns with systemd coding guidelines for struct naming
2023-02-01 12:51:17 -05:00
Dan Streetman
7bfe0a48d9 tpm2: rename tpm2 alg id<->string functions
The 'pcr_bank' functions operate on hash algs, and are not specific to the PCR
banks, while the 'primary_alg' functions operate on asymmetric algs, and are
not specific to primary keys.
2023-02-01 18:13:48 +01:00
Zbigniew Jędrzejewski-Szmek
92fc007902
Merge pull request #26219 from yuwata/localed-follow-ups
locale: check conversion before polkit
2023-02-01 17:18:35 +01:00
Jan Janssen
2de6cc18f9 ci: Test with secure boot enabled under mkosi
This gives us some nice test coverage for secure boot enrolling and the
stub secure boot workound. The authenticated EFI variables are already
created by mkosi, all we need to do is request secure boot to be used.
2023-02-01 17:16:03 +01:00
Zbigniew Jędrzejewski-Szmek
70c0d11f41
Merge pull request #26286 from keszybz/two-doc-updates
Two doc updates
2023-02-01 17:03:46 +01:00
Jan Janssen
c2aed1d16c git: Ignore mkosi secure boot keys 2023-02-01 16:52:28 +01:00
Jan Janssen
1e8e7f4463 boot: Add if-safe mode for secure boot enrollment 2023-02-01 16:52:28 +01:00
Jan Janssen
6ba14371c7 man: Use sbsigntools for secure boot key generation example
This way, people do not need efitools installed to generate these as
sbsigntools has everything needed to produce signed EFI variables.
2023-02-01 16:52:28 +01:00
Yu Watanabe
d60e348261 test: add a testcase for lvextend
For RHBZ#2158628 (https://bugzilla.redhat.com/show_bug.cgi?id=2158628)
2023-02-02 00:40:57 +09:00
Zbigniew Jędrzejewski-Szmek
2bd88a2944 man: strengthen language about generator output
Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=2165433.
2023-02-01 15:34:38 +01:00
Zbigniew Jędrzejewski-Szmek
0c8b320ab1 NEWS: extend entry for systemd-journald-audit.socket
I knew about the change but forgot to update the packaging scriptlets…
Let's add this to make it easier for other distros to notice.
2023-02-01 15:26:02 +01:00
Lennart Poettering
951174e4fe test-journal-flush: minor modernizations
let's automatically destroy test dirs, instead of manually.
2023-02-01 15:25:44 +01:00
Lennart Poettering
74e795ee55 id128: introduce ERRNO_IS_MACHINE_ID_UNSET() helper macro 2023-02-01 15:25:30 +01:00
Yu Watanabe
5479d0f83a test: make helper_check_device_units() log unit name 2023-02-01 23:04:13 +09:00
Robin Humble
19cfda9fc3
pid1: fix segv triggered by status query (#26279)
If any query makes it to the end of install_info_follow() then I think symlink_target is set to NULL.
If that is followed by -EXDEV from unit_file_load_or_readlink(), then that causes basename(NULL)
which segfaults pid 1.

This is triggered by eg. "systemctl status crond" in RHEL9 if

/etc/systemd/system/crond.service
  -> /ram/etc/systemd/system/crond.service
  -> /usr/lib/systemd/system/.crond.service.blah.blah
  -> /usr/lib/systemd/system/crond.service
2023-02-01 21:36:48 +09:00
Zbigniew Jędrzejewski-Szmek
e4c7b5f517 core: split system/user job timeouts and make them configurable
Config options are -Ddefault-timeout-sec= and -Ddefault-user-timeout-sec=.
Existing -Dupdate-helper-user-timeout= is renamed to -Dupdate-helper-user-timeout-sec=
for consistency. All three options take an integer value in seconds. The
renaming and type-change of the option is a small compat break, but it's just
at compile time and result in a clear error message. I also doubt that anyone was
actually using the option.

This commit separates the user manager timeouts, but keeps them unchanged at 90 s.
The timeout for the user manager is set to 4/3*user-timeout, which means that it
is still 120 s.

Fedora wants to experiment with lower timeouts, but doing this via a patch would
be annoying and more work than necessary. Let's make this easy to configure.
2023-02-01 11:52:29 +00:00
Zbigniew Jędrzejewski-Szmek
3e74e6a15b test-sysusers: check that sysusers creates /etc when missing 2023-02-01 11:38:35 +01:00
Zbigniew Jędrzejewski-Szmek
d173d5564f basic/user-util: create /etc from take_etc_passwd_lock
This allows sysusers to operate with --root that is an empty directory.
It may be useful to, for example, populate the user database before installing
anything else.

firstboot was already doing this, so drop the duplicated call there.
2023-02-01 11:38:35 +01:00
Zbigniew Jędrzejewski-Szmek
e5b30f7232 basic/user-util: convert prefix_roota→path_join and use _cleanup_ more 2023-02-01 11:38:35 +01:00
Zbigniew Jędrzejewski-Szmek
fddb524d8a basic: reword some comments
Without commas, the sentences can be hard to parse.
2023-02-01 11:38:35 +01:00
Zbigniew Jędrzejewski-Szmek
7519b880e7 sysusers: when comparing items, log debug the difference 2023-02-01 11:31:29 +01:00
Zbigniew Jędrzejewski-Szmek
9a87bdd7ed sysusers: add helper to create new Item 2023-02-01 11:30:26 +01:00
dependabot[bot]
15796f28ea build(deps): bump systemd/mkosi
Bumps [systemd/mkosi](https://github.com/systemd/mkosi) from f36983f552a197faf9e36361cc68a297e68bee73 to 500f93a36cc3d5bf1d06848a0a8870bf1424625f.
- [Release notes](https://github.com/systemd/mkosi/releases)
- [Changelog](https://github.com/systemd/mkosi/blob/main/NEWS.md)
- [Commits](f36983f552...500f93a36c)

---
updated-dependencies:
- dependency-name: systemd/mkosi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 09:48:30 +00:00
dependabot[bot]
b8565f93e9 build(deps): bump actions/github-script from 6.3.3 to 6.4.0
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.3.3 to 6.4.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](d556feaca3...98814c53be)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 09:15:44 +00:00
dependabot[bot]
b0126d1e8e build(deps): bump redhat-plumbers-in-action/advanced-issue-labeler
Bumps [redhat-plumbers-in-action/advanced-issue-labeler](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler) from 2.0.1 to 2.0.4.
- [Release notes](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/releases)
- [Commits](88209aef58...25a1e41826)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/advanced-issue-labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 09:14:38 +00:00
Zbigniew Jędrzejewski-Szmek
2584e16cb7
Merge pull request #26236 from medhefgo/meson-fixes
meson: Fixes
2023-02-01 10:05:36 +01:00
Lennart Poettering
0e8330262e journald: some minor modernizations 2023-02-01 09:25:57 +01:00
Lennart Poettering
2308cf7c9c journal: generate a clean message when we try to write to a journal file from a different host 2023-02-01 09:23:18 +01:00
Lennart Poettering
75bf2627b0 journal-file: refuse writing to journal files where the header size is different then expected
We keep adding fields to the header, and it's fine reading files with
different header sizes, as we check via the size if the fields we need
are included. However, let's be stricter when writing journal files than
when reading, and insist that the header structure in the file actually
matches our expectations. Refuse otherwise, so that a new file is
created after rotation that then matches our expectations.

This makes sure that mismatch in header size is treated exactly as
unknown "compatible" flags, which is our other mechanism to allow
extending the journal file format in a non-breaking way.
2023-02-01 09:20:18 +01:00
Rudi Heitbaum
1bb6ba08b1 glibc: Conditionally #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
2023-02-01 00:02:41 +00:00
Zbigniew Jędrzejewski-Szmek
49bb7fe5f8 sysusers: insist that root group is 0
In https://bugzilla.redhat.com/show_bug.cgi?id=2156900 sysusers was reporting a
conflict between the following lines:
  u root 0:0 "Super User" /root /bin/bash
  u root    0     "Super User" /root

The problem is that those configurations are indeed not equivalent. If group 0
exists with a different name, the first line would just create the user, but the
second line would create a 'root' group with a different GID. The second
behaviour seems definitely wrong. (Or at least more confusing in practice than
the first one. The system is in a strange shape, but the second approach takes
an additional step than is worse than doing nothing.)

When this line was initially added, we didn't have the uid:gid functionality for
'u', so we didn't think about this too much. But now we do, so we should use it.

$ build/systemd-sysusers --root=/var/tmp/inst7 --inline 'g foobar 0'
Creating group 'foobar' with GID 0.

$ build/systemd-sysusers --root=/var/tmp/inst7 --inline 'u root 0 "Zuper zuper"'
src/sysusers/sysusers.c:1365: Creating group 'root' with GID 999.
src/sysusers/sysusers.c:1115: Suggested user ID 0 for root already used.
src/sysusers/sysusers.c:1183: Creating user 'root' (Zuper zuper) with UID 999 and GID 999.

vs.

$ build/systemd-sysusers --root=/var/tmp/inst7 --inline 'u root 0:0 "Zuper zuper"'
src/sysusers/sysusers.c:1183: Creating user 'root' (Zuper zuper) with UID 0 and GID 0.
2023-02-01 00:02:09 +00:00
Zbigniew Jędrzejewski-Szmek
a0d613ec43 meson: fail build on implicit int warnings 2023-02-01 00:01:03 +00:00
Yu Watanabe
2cb1cabb41 network: dhcp-server: do not create DHCPServer object when the DHCP server is running in relaying mode
Follow-up for c95df5879eeb2cec8bc8eec2cfa7e741e1d9469f.

Fixes #26196.
2023-02-01 00:00:19 +00:00
Tuetuopay
1d84a3c779 network/dhcp4: accept local subnet routes from DHCP
RFC3442 specifies option 121 (Classless Static Routes) that allow a DHCP
server to push arbitrary routes to a client. It has a Local Subnet
Routes section expliciting the behavior of routes with a null (0.0.0.0)
gateway.

Such routes are to be installed on the interface with a Link scope, to
mark them as directly available on the link without any gateway.

Networkd currently drops those routes, which is against the RFC, as
Linux has proper support for such routes.

Fixes: 7f20627 ("network: dhcp4: ignore gateway in static routes if destination is link-local or in the same network")
2023-01-31 23:58:34 +00:00
Frantisek Sumsal
9c45bfb2ac ukify: don't install ukify man page if ukify is not enabled
Checking for gnu-efi is not enough, since ukify can be explicitly
disabled.

Resolves: #26274
2023-01-31 23:57:28 +00:00
Zbigniew Jędrzejewski-Szmek
5afdb4629a pid1,sysusers: drop unused SYNTHETIC_ERRNO
The only function of SYNTHETIC_ERRNO is to set the return value.
If we're ignoring the return value, it shouldn't be used.
2023-01-31 14:30:41 +01:00