Commit Graph
71663 Commits
Author SHA1 Message Date
Lennart Poettering 663a15e7cc importctl: modernize signal handling 2024-03-01 22:25:42 +01:00
Lennart Poettering 1db33ce50b importctl: add standalone client to importd
This is pretty much a 1:1 copy of the importd specific part of
machinectl.

We turn this into a separate tool, so that we can eventually make the
tool generic to also download other DDIs, not just machine images.
2024-03-01 22:25:42 +01:00
Lennart Poettering 423bba9926 importd: modernize signal handling a bit 2024-03-01 22:25:42 +01:00
Lennart Poettering b37ec1e7ca importd: trivial modernizations 2024-03-01 22:25:42 +01:00
Lennart Poettering 09232207b1 importd: switch to pidref 2024-03-01 22:25:42 +01:00
Lennart Poettering 8bd4d506a4 curl-util: fix downloads from file:// URLs
if we try to open file:// URLs that don't exist, we'll not get IO/timer
events about it, hence it is not sufficient to check for completion in
these events. Let's add a defer event, to deal with that.

Also, curl_multi_info_read() is a queue, make sure to handle all events
that might be queued.
2024-03-01 22:25:42 +01:00
Lennart Poettering 7253eaa0fb sd-event: make return code of sd_event_get_exit_code() optional 2024-03-01 22:25:42 +01:00
Lennart Poettering 4a5aa6842d fd-util: O_DIRECTORY is fine in fd_verify_safe_flags() too 2024-03-01 22:25:42 +01:00
Lennart Poettering 120f4a4451 test74: create ssh empty dir all at the same place
A follow up for 8fddb50fd4, which mirrors
the change also in test 74.
2024-03-01 22:24:32 +01:00
Lennart Poettering 3c1053ff27 machinectl: mention -V in --help text
Follow-up for f82dcc3fc3
2024-03-01 22:24:19 +01:00
Lennart Poettering 5f76155e65 busctl: don't hit an assert if we call invalid bus method names
We should validate this explicitly and generate a clear error string,
rather then hit an assert() later in the code.
2024-03-01 22:24:01 +01:00
Lennart Poettering 9c046d93fe vmspawn: actually pass UUID down to qemu
qemu then adds this to SMBIOS product uuid, and we can actually read it
from the payload.

Followup for b0dc766852
2024-03-01 22:23:45 +01:00
Luca BoccassiandDaan De Meyer 5e39dc2f30 CI: free up diskspace before mkosi jobs
The runner has a lot of useless things installed, taking ~10GB, and
jobs have started to fail when booting images due to lack of disk
space, so delete some directories to make room.

2024-02-27T20:20:58.0998709Z ##[warning]You are running out of disk space. The runner will stop working when the machine runs out of disk space. Free space left: 0 MB

Co-authored-by: Daan De Meyer <daan.j.demeyer@gmail.com>
2024-03-01 20:04:13 +00:00
Luca Boccassi 419b25ddca ukify: add support for engine signing of PCR signatures 2024-03-01 17:32:19 +00:00
Luca Boccassi ed896a5b85 measure: add support for --certificate and --private-key-source for engine/provider signing
Allow signing with an OpenSSL engine/provider, such as PKCS11. A public key is
not enough, a full certificate is needed for PKCS11, so a new parameter is
added for that too.
2024-03-01 17:32:19 +00:00
Luca Boccassi a73144bbdf repart: add --private-key-source and drop --private-key-uri
It turns out it's mostly PKCS11 that supports the URI format,
and other engines just take files. For example the tpm2-tss-openssl
engine just takes a sealed private key file path as the key input,
and the engine needs to be specified separately.

Add --private-key-source=file|engine:foo|provider:bar to
manually specify how to use the private key parameter.

Follow-up for 0a8264080a
2024-03-01 17:32:19 +00:00
Adrian Vovk 793ceda177 user-record: Add preferredSession{Type,Launcher}
These will be used by display managers to pre-select the user's
preferred desktop environment and display server type. On homed, the
display manager will also be able to set these fields to cache the
user's last selection.
2024-03-01 16:28:10 +00:00
Lennart Poettering 9dbabd0a8b tree-wide: switch dlopen hooks over to DLSYM_PROTOTYPE()/DLSYM_FUNCTION()
We have these pretty macros, let's use them everywhere (so far we mostly
used them for newer additions only).

This PR is mostly an excercise in "perl -p -i -e", but there are some
special cases:

* idn-util.c exposes a function whose prototype in the official library
  headers is marked with the "const" attribute, and this apparently does
  not propagate along typeof() correctly and then
  __builtin_types_compatible_p() fails later because it detects that
  prototype and original function don't match in prototype.

* libbpf removed some symbols in newer versions, hence we need to define
  some prototypes manually to still be able to build.

* libcryptsetup marked a symbol as deprecated we want to use (knowing it
  is deprecated). By using the macros this is detected by the compiler.
  We work around it via the usual warning off macros.

Note by using these macros we assume that all symbols are known during
build time. Which might not be the case. We might need to revert this
commit for some symbols if this trips up builds on older distros.
2024-03-01 15:51:24 +00:00
Mike Yuan f8d6694783 core/service: remove unused function param and minor cleanup 2024-03-01 21:56:43 +08:00
Xiaotian Wu 96069e57a0 uki: Support zboot efistub kernel
Generic EFI zboot added since kernel 6.1
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/efi/libstub/Makefile.zboot?h=v6.1
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/efi/libstub/zboot-header.S?h=v6.1
2024-03-01 14:51:37 +01:00
Mike Yuan b7a22068ae core/service: rearrange variables, use ASSERT_PTR 2024-03-01 21:49:08 +08:00
Mike Yuan 3a45fdfce0 core/service: reorder two functions 2024-03-01 21:49:08 +08:00
dependabot[bot] 5346a81024 build(deps): bump meson from 1.3.1 to 1.3.2 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.3.1...1.3.2)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 12:08:07 +01:00
Mike Yuan cf76caf871 dlfcn-util: use safe_dlclose for dlclosep 2024-03-01 18:59:50 +08:00
Mike Yuan d4d3e48601 shared/userdb: remove unneeded cast for dlsym 2024-03-01 18:59:50 +08:00
dependabot[bot] 99e59d24f3 build(deps): bump actions/upload-artifact from 4.3.0 to 4.3.1
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/26f96dfa697d77e81fd5907df203aa23a56210a8...5d5d22a31266ced268874388b861e4b58bb5c2f3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 11:57:31 +01:00
Luca Boccassi 0abe0cd402 test: enable PAM debug logs in TEST-46-HOMED 2024-03-01 10:07:27 +00:00
dependabot[bot] ba959322a4 build(deps): bump github/codeql-action from 3.22.12 to 3.24.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.22.12 to 3.24.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/012739e5082ff0c22ca6d6ab32e07c36df03c4a4...8a470fddafa5cbb6266ee11b37ef4d8aae19c571)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 11:06:02 +01:00
dependabot[bot] 04dd8258b4 build(deps): bump redhat-plumbers-in-action/differential-shellcheck
Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.0.2 to 5.1.0.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/redhat-plumbers-in-action/differential-shellcheck/compare/91e2582e40236f831458392d905578d680baa138...b9df2a9417f69c056e0aeaf870abd9a2065a403e)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 10:57:00 +01:00
Yu Watanabe d5e6df24bd Merge pull request #31498 from ssahani/bond
netdev: bond - add support for peer_notif_delay
2024-03-01 12:45:52 +09:00
Yu Watanabe 3807936cc5 Merge pull request #31502 from yuwata/network-lldp-json
network: support to dump LLDP neighbors in JSON format
2024-03-01 12:18:53 +09:00
Yu Watanabe 6a5134e83a Merge pull request #31555 from yuwata/sd-ndisc-trivial-cleanups
sd-ndisc: trivial cleanups
2024-03-01 12:18:19 +09:00
Yu Watanabe ccb1ace77f sd-ndisc: drop unused sd_ndisc_router_get_raw() 2024-03-01 09:44:58 +09:00
Yu Watanabe f169c56447 sd-ndisc: use _packed_ attribute 2024-03-01 09:44:58 +09:00
Luca Boccassi 7a2ba85aee Merge pull request #31551 from keszybz/rpm-macro-kernel-install
New rpm macro %_kernel_install_dir
2024-03-01 00:44:52 +00:00
Yu Watanabe bbb2a0fb41 icmp6-packet: check the alignment of struct nd_opt_hdr for safety
Addresses https://github.com/systemd/systemd/pull/31492#discussion_r1507481748.
2024-03-01 09:44:45 +09:00
Yu Watanabe d6360819a7 test-network: add more test cases for LLDP 2024-03-01 09:40:26 +09:00
Yu Watanabe ac23c5596e sd-lldp-rx: drop unused functions
These are not used anymore.
2024-03-01 09:40:26 +09:00
Yu Watanabe 5a0f6adbb2 network/lldp: do not save LLDP neighbors under /run/systemd
Now LLDP neighbors are exposed through varlink. Hence, it is not
necessary to save to a file.
2024-03-01 09:40:26 +09:00
Yu WatanabeandTomáš Pecka 14a5c07afa networkctl: use varlink method to dump LLDP neighbors
`networkctl lldp` and `networkctl status INTERFACE` now use varlink
call to the networkd to query LLDP neighbors.

Then, this allows to dump LLDP neighbors in JSON format.

Co-authored-by: Tomáš Pecka <tomas.pecka@cesnet.cz>
2024-03-01 09:40:26 +09:00
Yu Watanabe 1dbd2cc72a networkctl: rename check_netns_match() -> varlink_connect_networkd()
Then optionally return the varlink connection to the caller.
2024-03-01 09:40:26 +09:00
Yu WatanabeandTomáš Pecka c48ca17aa8 network/varlink: add varlink method to get LLDP neighbors
The method provides the list of LLDP neighbors.

Co-authored-by: Tomáš Pecka <tomas.pecka@cesnet.cz>
2024-03-01 09:40:26 +09:00
Tomáš Pecka 329146a9ac sd-lldp-rx: serialize LLDP neighbors to JSON format
Add functions serializing LLDP neighbors to JSON (JsonVariant).

The entry contains a chassis id, system name and port id of the remote
neighbor. Also it possibly contains an integer coding the enabled system
capabilities and port description.
2024-03-01 09:40:26 +09:00
Yu Watanabe 1e18e1aa11 Merge pull request #31492 from yuwata/icmp6-packet
sd-ndisc: introduce ICMP6Packet and relevant functions, and use them
2024-03-01 09:18:52 +09:00
Eli Schwartz 5656c593ce fix the value of default shells to use /bin and not /usr/bin
Partially reverts commit b0d3095fd6.

While it is generally worthwhile for systemd to drop split-usr support,
these options are NOT about split-usr support. The universal location of
POSIX sh is always /bin/sh. Bash is pretty reasonably standardized there
too.

This happens irrespective of /bin being a symlink to /usr/bin.
Ramifications of this change include things like:

- portably running shell scripts that might run very nearly anywhere
- /etc/shells support

For standardization and compatibility reasons, these commands with these
paths need to be consistently found on any system, and thus distros make
sure this works, although even on split-usr systems /usr/bin/bash may be
a symlink to /bin/bash.

Embedding the *access path* of bash as /usr/bin/bash in systemd, for
example in libnss_systemd.so, means that login shells must agree with
systemd on how they invoke the shell. End result: users fail to login
because of access violations.

This cannot be fixed by "fixing PAM" because PAM does not follow
symlinks by design: one example is that it needs to treat rbash as
different from bash.

Fixes: https://bugs.gentoo.org/919749
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-02-29 21:51:03 +01:00
Lennart Poettering d52320337e ssh-generator: don't do AF_VSOCK stuff if we run in a container
Tighten our VM check: whether we run in a VM is not enough to do
AF_VSOCK. We also need to check if we are run in a container, because if
we run in a container inside a VM then we should *not* do the AF_VSOCK
stuff, but leave the port free for the VM itself.

As discussed here:

https://github.com/systemd/systemd/pull/31544#issuecomment-1971455401
2024-02-29 20:43:12 +00:00
Zbigniew Jędrzejewski-Szmek 5248a0c5b3 rpm/macros: add %_kernel_install_dir
This makes it easier for people packaging kernel-install plugins
to get the path right.

E.g. https://src.fedoraproject.org/rpms/python-virt-firmware/pull-request/3
fixes an issue where %{_libdir}/kernel/install.d was used,
which gives incorrect results on 64-bit architectures.
%_kernel_install_dir will make this even easier.
2024-02-29 21:38:03 +01:00
Zbigniew Jędrzejewski-Szmek 1578622bfd rpm/macros: drop compat define with a typo
Search on sourcegraph.com doesn't yield any users. And each
use would emit a warning, so I think it's safe to assume that
it has no users.
2024-02-29 21:32:10 +01:00
Luca Boccassi d74d989c25 Merge pull request #31544 from mrc0mmand/more-test-tweaks
A couple of fixlets for TEST-46-HOMED's ssh tests
2024-02-29 20:29:24 +00:00
Lennart Poettering f557129ecb ssh-generator: handle gracefully if AF_VSOCK works, but /dev/vsock doesn't
Apparently this case exists, let's handle it gracefully.

Prompted by: https://github.com/systemd/systemd/pull/31544#issuecomment-1971241397
2024-02-29 18:28:01 +01:00