]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 months agosd-lldp: fix assignment of capabilities in JSON output
Yu Watanabe [Sat, 2 Mar 2024 02:08:18 +0000 (11:08 +0900)] 
sd-lldp: fix assignment of capabilities in JSON output

Follow-up for 329146a9ac73ac3f91b80f318e3037041488087c.

3 months agoman: fix typo
Yu Watanabe [Sat, 2 Mar 2024 02:57:36 +0000 (11:57 +0900)] 
man: fix typo

Follow-up for 419b25ddcac39cf967555c7a2eaa274fbf1ad03c.

3 months agohashmap: reorder fields to pack structure better
Lennart Poettering [Fri, 1 Mar 2024 20:43:21 +0000 (21:43 +0100)] 
hashmap: reorder fields to pack structure better

When building with ENABLE_DEBUG_HASHMAP we can pack the hashmap iterator
structure a bit better.

Fixes: #31558
3 months agoMerge pull request #31507 from poettering/import-modernize
Lennart Poettering [Fri, 1 Mar 2024 22:42:32 +0000 (23:42 +0100)] 
Merge pull request #31507 from poettering/import-modernize

importd: various modernizations

3 months agoMerge pull request #31571 from poettering/hostnamed-show-more
Lennart Poettering [Fri, 1 Mar 2024 22:42:10 +0000 (23:42 +0100)] 
Merge pull request #31571 from poettering/hostnamed-show-more

hostnamectl: show product uuid/hardware serial in regular output, plus various fixes

3 months agoMerge pull request #31274 from bluca/measure_engine
Lennart Poettering [Fri, 1 Mar 2024 22:41:25 +0000 (23:41 +0100)] 
Merge pull request #31274 from bluca/measure_engine

repart/measure/ukify: add support for OpenSSL engines/providers

3 months agoresolve: skip IP_UNICAST_IF for local sockets
Ronan Pigott [Fri, 1 Mar 2024 04:42:43 +0000 (21:42 -0700)] 
resolve: skip IP_UNICAST_IF for local sockets

SO_BINDTODEVICE was used during connect() to fix an issue where
IP_UNICAST_IF was improperly ignored for route lookups made by connect
in linux. This has since been resolved upstream [1][2], but as a result
we must apply the local socket excpetion to IP_UNICAST_IF as well.

The SO_BINDTODEVICE is no longer necessary, but left in place for 5.x
kernels.

[1] https://lore.kernel.org/all/20220829111554.GA1771@debian/
[2] https://lore.kernel.org/all/20221208145437.GA75680@debian/

3 months agoMerge pull request #31567 from YHNdnzj/service-unused-param
Lennart Poettering [Fri, 1 Mar 2024 21:39:27 +0000 (22:39 +0100)] 
Merge pull request #31567 from YHNdnzj/service-unused-param

core/service: remove unused function param and minor cleanup

3 months agoMerge pull request #31565 from YHNdnzj/safe_dlclose
Lennart Poettering [Fri, 1 Mar 2024 21:39:11 +0000 (22:39 +0100)] 
Merge pull request #31565 from YHNdnzj/safe_dlclose

dlfcn-util: use safe_dlclose for dlclosep

3 months agohostnamectl: display product uuid + hardware serial in regular status output 31571/head
Lennart Poettering [Fri, 1 Mar 2024 13:43:20 +0000 (14:43 +0100)] 
hostnamectl: display product uuid + hardware serial in regular status output

hostnamed provides this, hence hostnamectl should show it

3 months agohostnamed: add explicit BUS_ERROR_NO_HARDWARE_SERIAL error
Lennart Poettering [Fri, 1 Mar 2024 13:46:27 +0000 (14:46 +0100)] 
hostnamed: add explicit BUS_ERROR_NO_HARDWARE_SERIAL error

For the very similar case of the product UUID we have its own error
BUS_ERROR_NO_PRODUCT_UUID if we have no UUID. Let's mirror this for the
hardware serial, and expose the same, to keep things nicely symmteric.

3 months agohostnamed: do some validation of the hw serial before we return it
Lennart Poettering [Fri, 1 Mar 2024 13:46:00 +0000 (14:46 +0100)] 
hostnamed: do some validation of the hw serial before we return it

Let's make sure the serial contains not control chars, and is UTF-8
clean. In particular the latter matters as D-Bus shouldn't kick us
from the bus.

3 months agohostnamed: in get_hardware_firmware_data() don't dup a string if we shan't return it
Lennart Poettering [Fri, 1 Mar 2024 13:45:37 +0000 (14:45 +0100)] 
hostnamed: in get_hardware_firmware_data() don't dup a string if we shan't return it

3 months agohostnamed: our base indentation is 8 spaces, not 9 spaces
Lennart Poettering [Fri, 1 Mar 2024 13:44:27 +0000 (14:44 +0100)] 
hostnamed: our base indentation is 8 spaces, not 9 spaces

No idea what was going on here...

3 months agobus-util: add generic parser for extracting id128 values from bus messages
Lennart Poettering [Fri, 1 Mar 2024 13:47:52 +0000 (14:47 +0100)] 
bus-util: add generic parser for extracting id128 values from bus messages

3 months agoupdate TODO 31507/head
Lennart Poettering [Tue, 27 Feb 2024 14:05:26 +0000 (15:05 +0100)] 
update TODO

3 months agotest: add integration test for importctl
Lennart Poettering [Fri, 23 Feb 2024 21:50:30 +0000 (22:50 +0100)] 
test: add integration test for importctl

(these are explicit tests, on top of the existing machinectl tests that
are now chainload importctl)

3 months agoman: document new importctl/importd functionality
Lennart Poettering [Tue, 27 Feb 2024 08:39:57 +0000 (09:39 +0100)] 
man: document new importctl/importd functionality

This also replaces the Fedora download example with another one from
Ubuntu, since Fedora's images these days no longer qualify as DDIs, they
have no distinctive partition type UUIDs set for multiple of their
partitions, hence the images cannot be booted. A bit sad. Let's provide
a command that just works in its place.

3 months agoimportd: add command to list downloaded images
Lennart Poettering [Tue, 27 Feb 2024 10:08:49 +0000 (11:08 +0100)] 
importd: add command to list downloaded images

It's a bit weird we allow importing/pulling/exporting images, but we
have no scheme for showing what#s already downloaded. Hence let's add
this, it's easy to add after all.

3 months agoimportd: pass log level to invoked child
Lennart Poettering [Mon, 26 Feb 2024 18:04:48 +0000 (19:04 +0100)] 
importd: pass log level to invoked child

3 months agoimport: mention explicitly which image directory we operate on
Lennart Poettering [Mon, 26 Feb 2024 14:53:35 +0000 (15:53 +0100)] 
import: mention explicitly which image directory we operate on

Also, let's move the similar message about sync() mode to more common
code.

3 months agoimport: downgrade HTTP error code log message levels
Lennart Poettering [Mon, 26 Feb 2024 14:47:40 +0000 (15:47 +0100)] 
import: downgrade HTTP error code log message levels

Let's downgrade log levels a bit on HTTP error codes. After all we
gracefully handle many of them, and we do generated an extra message for
the ones which are fatal anyway, hence there's no point in emphasizing
the HTTP erro message levels as we currently do.

3 months agoimportctl: draw a pretty progress bar while downloading
Lennart Poettering [Mon, 26 Feb 2024 14:46:50 +0000 (15:46 +0100)] 
importctl: draw a pretty progress bar while downloading

Everybody loves pretty terminal progress bar.

3 months agomachinectl: chainload importctl for relevant verbs
Lennart Poettering [Thu, 22 Feb 2024 17:54:39 +0000 (18:54 +0100)] 
machinectl: chainload importctl for relevant verbs

Now that "importctl" exists, let's chainload it from machinectl for the
relevant verbs so that we only have a single implementation of the
logic.

3 months agoimportd: log the import callout that is going to be called
Lennart Poettering [Fri, 23 Feb 2024 20:50:29 +0000 (21:50 +0100)] 
importd: log the import callout that is going to be called

3 months agoimportd: make keeping pristine copy of downloaded images optional
Lennart Poettering [Thu, 22 Feb 2024 17:50:32 +0000 (18:50 +0100)] 
importd: make keeping pristine copy of downloaded images optional

Previously, when downloading an image, importd would first download them
into one image which it would then consider immutable (named after the
originating URL/etag), and then immediately make a copy of it (named
after the client chosen name).

This makes some sense in VM/container cases where the images are
typically mutable, and thus the original downloaded copy is of some
value.

For sysexts/confexts/portable this doesn't make much sense though, as
they are typically immutable. Hence make the concept optional.

This adds --keep-download=yes/no as a new option that controls the
above. Moreover it disables the behaviour for all image classes but
"machine". The behaviour remains enabled for "machine", for compat.

3 months agoimportd: validate local image names with the right helper
Lennart Poettering [Thu, 22 Feb 2024 11:31:03 +0000 (12:31 +0100)] 
importd: validate local image names with the right helper

A while back we introduced image_name_is_valid() for validating image
file names. It's more liberal than hostname_is_valid() in many ways (and
allows version suffixes and such). Since importd deals in offline images
(as opposed to machined otherwise which deals in running machines),
let's hence use the right helper to validate the identifiers.

3 months agoimportlisttransfersxclient
Lennart Poettering [Fri, 1 Mar 2024 15:13:59 +0000 (16:13 +0100)] 
importlisttransfersxclient

3 months agoimportctl: add support for selecting image class to download
Lennart Poettering [Thu, 22 Feb 2024 09:16:43 +0000 (10:16 +0100)] 
importctl: add support for selecting image class to download

3 months agoimportd: tighten checks in fds passed to us
Lennart Poettering [Thu, 22 Feb 2024 10:47:34 +0000 (11:47 +0100)] 
importd: tighten checks in fds passed to us

3 months agoimportd: add support for downloading sysext/confext/portable images too
Lennart Poettering [Thu, 22 Feb 2024 08:43:01 +0000 (09:43 +0100)] 
importd: add support for downloading sysext/confext/portable images too

This adds "Ex" versions of all bus calls import implements, that make
two changes:

1. A "class" parameter is added that allows choosing between
   machine/sysext/confext/portable images to download. Depending on the
   chose class the target directory is selected differently (i.e. not
   just /var/lib/machines/, but alternatively /var/lib/portables/,
   /var/lib/extensions/, /var/lib/confexts/.

2. The boolean flags are replaced by a 64bit flags parameter.

3 months agoimport: merge PullFlags enum into ImportFlags
Lennart Poettering [Thu, 22 Feb 2024 12:32:35 +0000 (13:32 +0100)] 
import: merge PullFlags enum into ImportFlags

The two enums are mostly the same, the former is just an extension of
the latter. Let's merge them, to simplify things. This is particularly
useful as we then can reuse this systematically as D-Bus method call
flags too, in a generic fashion that works for both imports and pulls
the same.

Pretty much just renaming of flags.

3 months agoimportctl: port tabular output for format-table.h APIs
Lennart Poettering [Wed, 21 Feb 2024 15:42:40 +0000 (16:42 +0100)] 
importctl: port tabular output for format-table.h APIs

3 months agoimportctl: modernize signal handling
Lennart Poettering [Fri, 16 Feb 2024 17:55:21 +0000 (18:55 +0100)] 
importctl: modernize signal handling

3 months agoimportctl: add standalone client to importd
Lennart Poettering [Fri, 16 Feb 2024 17:40:47 +0000 (18:40 +0100)] 
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.

3 months agoimportd: modernize signal handling a bit
Lennart Poettering [Fri, 16 Feb 2024 17:20:51 +0000 (18:20 +0100)] 
importd: modernize signal handling a bit

3 months agoimportd: trivial modernizations
Lennart Poettering [Fri, 16 Feb 2024 17:20:36 +0000 (18:20 +0100)] 
importd: trivial modernizations

3 months agoimportd: switch to pidref
Lennart Poettering [Fri, 16 Feb 2024 17:20:24 +0000 (18:20 +0100)] 
importd: switch to pidref

3 months agocurl-util: fix downloads from file:// URLs
Lennart Poettering [Fri, 23 Feb 2024 17:22:40 +0000 (18:22 +0100)] 
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.

3 months agosd-event: make return code of sd_event_get_exit_code() optional
Lennart Poettering [Fri, 23 Feb 2024 20:51:02 +0000 (21:51 +0100)] 
sd-event: make return code of sd_event_get_exit_code() optional

3 months agofd-util: O_DIRECTORY is fine in fd_verify_safe_flags() too
Lennart Poettering [Fri, 23 Feb 2024 21:46:04 +0000 (22:46 +0100)] 
fd-util: O_DIRECTORY is fine in fd_verify_safe_flags() too

3 months agotest74: create ssh empty dir all at the same place
Lennart Poettering [Fri, 1 Mar 2024 14:10:56 +0000 (15:10 +0100)] 
test74: create ssh empty dir all at the same place

A follow up for 8fddb50fd4de43993c4906baf19dae89ff8a021b, which mirrors
the change also in test 74.

3 months agomachinectl: mention -V in --help text
Lennart Poettering [Fri, 1 Mar 2024 14:22:13 +0000 (15:22 +0100)] 
machinectl: mention -V in --help text

Follow-up for f82dcc3fc35883a73c8a03ad82d35abffc458676

3 months agobusctl: don't hit an assert if we call invalid bus method names
Lennart Poettering [Fri, 1 Mar 2024 13:42:34 +0000 (14:42 +0100)] 
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.

3 months agovmspawn: actually pass UUID down to qemu
Lennart Poettering [Fri, 1 Mar 2024 13:47:57 +0000 (14:47 +0100)] 
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 b0dc766852b2022080f123ac52aa90f2692c12e2

3 months agoCI: free up diskspace before mkosi jobs
Luca Boccassi [Fri, 1 Mar 2024 16:53:50 +0000 (16:53 +0000)] 
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>
3 months agoukify: add support for engine signing of PCR signatures 31274/head
Luca Boccassi [Sun, 11 Feb 2024 00:34:19 +0000 (00:34 +0000)] 
ukify: add support for engine signing of PCR signatures

3 months agomeasure: add support for --certificate and --private-key-source for engine/provider...
Luca Boccassi [Sat, 10 Feb 2024 23:51:57 +0000 (23:51 +0000)] 
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.

3 months agorepart: add --private-key-source and drop --private-key-uri
Luca Boccassi [Sun, 11 Feb 2024 20:15:51 +0000 (20:15 +0000)] 
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 0a8264080a5d4b5e13e65eed80ac98a476f7fe43

3 months agouser-record: Add preferredSession{Type,Launcher}
Adrian Vovk [Mon, 5 Feb 2024 00:21:29 +0000 (19:21 -0500)] 
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.

3 months agotree-wide: switch dlopen hooks over to DLSYM_PROTOTYPE()/DLSYM_FUNCTION()
Lennart Poettering [Fri, 1 Mar 2024 09:12:48 +0000 (10:12 +0100)] 
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.

3 months agocore/service: remove unused function param and minor cleanup 31567/head
Mike Yuan [Fri, 1 Mar 2024 13:48:23 +0000 (21:48 +0800)] 
core/service: remove unused function param and minor cleanup

3 months agouki: Support zboot efistub kernel
Xiaotian Wu [Thu, 16 Nov 2023 12:01:50 +0000 (20:01 +0800)] 
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

3 months agocore/service: rearrange variables, use ASSERT_PTR
Mike Yuan [Fri, 1 Mar 2024 13:43:12 +0000 (21:43 +0800)] 
core/service: rearrange variables, use ASSERT_PTR

3 months agocore/service: reorder two functions
Mike Yuan [Fri, 1 Mar 2024 13:45:32 +0000 (21:45 +0800)] 
core/service: reorder two functions

3 months agobuild(deps): bump meson from 1.3.1 to 1.3.2 in /.github/workflows
dependabot[bot] [Fri, 1 Mar 2024 09:59:59 +0000 (09:59 +0000)] 
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>
3 months agodlfcn-util: use safe_dlclose for dlclosep 31565/head
Mike Yuan [Fri, 1 Mar 2024 10:57:13 +0000 (18:57 +0800)] 
dlfcn-util: use safe_dlclose for dlclosep

3 months agoshared/userdb: remove unneeded cast for dlsym
Mike Yuan [Fri, 1 Mar 2024 10:48:39 +0000 (18:48 +0800)] 
shared/userdb: remove unneeded cast for dlsym

3 months agobuild(deps): bump actions/upload-artifact from 4.3.0 to 4.3.1
dependabot[bot] [Fri, 1 Mar 2024 09:18:57 +0000 (09:18 +0000)] 
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>
3 months agotest: enable PAM debug logs in TEST-46-HOMED
Luca Boccassi [Thu, 29 Feb 2024 20:47:46 +0000 (20:47 +0000)] 
test: enable PAM debug logs in TEST-46-HOMED

3 months agobuild(deps): bump github/codeql-action from 3.22.12 to 3.24.6
dependabot[bot] [Fri, 1 Mar 2024 09:19:02 +0000 (09:19 +0000)] 
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>
3 months agobuild(deps): bump redhat-plumbers-in-action/differential-shellcheck
dependabot[bot] [Fri, 1 Mar 2024 09:19:11 +0000 (09:19 +0000)] 
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>
3 months agoMerge pull request #31498 from ssahani/bond
Yu Watanabe [Fri, 1 Mar 2024 03:45:52 +0000 (12:45 +0900)] 
Merge pull request #31498 from ssahani/bond

netdev: bond - add support for peer_notif_delay

3 months agoMerge pull request #31502 from yuwata/network-lldp-json
Yu Watanabe [Fri, 1 Mar 2024 03:18:53 +0000 (12:18 +0900)] 
Merge pull request #31502 from yuwata/network-lldp-json

network: support to dump LLDP neighbors in JSON format

3 months agoMerge pull request #31555 from yuwata/sd-ndisc-trivial-cleanups
Yu Watanabe [Fri, 1 Mar 2024 03:18:19 +0000 (12:18 +0900)] 
Merge pull request #31555 from yuwata/sd-ndisc-trivial-cleanups

sd-ndisc: trivial cleanups

3 months agosd-ndisc: drop unused sd_ndisc_router_get_raw() 31555/head
Yu Watanabe [Thu, 29 Feb 2024 03:37:26 +0000 (12:37 +0900)] 
sd-ndisc: drop unused sd_ndisc_router_get_raw()

3 months agosd-ndisc: use _packed_ attribute
Yu Watanabe [Thu, 29 Feb 2024 03:46:48 +0000 (12:46 +0900)] 
sd-ndisc: use _packed_ attribute

3 months agoMerge pull request #31551 from keszybz/rpm-macro-kernel-install
Luca Boccassi [Fri, 1 Mar 2024 00:44:52 +0000 (00:44 +0000)] 
Merge pull request #31551 from keszybz/rpm-macro-kernel-install

New rpm macro %_kernel_install_dir

3 months agoicmp6-packet: check the alignment of struct nd_opt_hdr for safety
Yu Watanabe [Fri, 1 Mar 2024 00:21:55 +0000 (09:21 +0900)] 
icmp6-packet: check the alignment of struct nd_opt_hdr for safety

Addresses https://github.com/systemd/systemd/pull/31492#discussion_r1507481748.

3 months agotest-network: add more test cases for LLDP 31502/head
Yu Watanabe [Mon, 26 Feb 2024 02:46:55 +0000 (11:46 +0900)] 
test-network: add more test cases for LLDP

3 months agosd-lldp-rx: drop unused functions
Yu Watanabe [Mon, 26 Feb 2024 06:48:49 +0000 (15:48 +0900)] 
sd-lldp-rx: drop unused functions

These are not used anymore.

3 months agonetwork/lldp: do not save LLDP neighbors under /run/systemd
Yu Watanabe [Mon, 26 Feb 2024 06:47:46 +0000 (15:47 +0900)] 
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.

3 months agonetworkctl: use varlink method to dump LLDP neighbors
Yu Watanabe [Sun, 25 Feb 2024 06:31:23 +0000 (15:31 +0900)] 
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>
3 months agonetworkctl: rename check_netns_match() -> varlink_connect_networkd()
Yu Watanabe [Mon, 26 Feb 2024 01:32:51 +0000 (10:32 +0900)] 
networkctl: rename check_netns_match() -> varlink_connect_networkd()

Then optionally return the varlink connection to the caller.

3 months agonetwork/varlink: add varlink method to get LLDP neighbors
Yu Watanabe [Sun, 25 Feb 2024 05:16:47 +0000 (14:16 +0900)] 
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>
3 months agosd-lldp-rx: serialize LLDP neighbors to JSON format
Tomáš Pecka [Thu, 7 Oct 2021 09:16:57 +0000 (11:16 +0200)] 
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.

3 months agoMerge pull request #31492 from yuwata/icmp6-packet
Yu Watanabe [Fri, 1 Mar 2024 00:18:52 +0000 (09:18 +0900)] 
Merge pull request #31492 from yuwata/icmp6-packet

sd-ndisc: introduce ICMP6Packet and relevant functions, and use them

3 months agofix the value of default shells to use /bin and not /usr/bin
Eli Schwartz [Wed, 21 Feb 2024 02:59:13 +0000 (21:59 -0500)] 
fix the value of default shells to use /bin and not /usr/bin

Partially reverts commit b0d3095fd6cc1791a38f57a1982116b4475244ba.

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>
3 months agossh-generator: don't do AF_VSOCK stuff if we run in a container
Lennart Poettering [Thu, 29 Feb 2024 17:19:07 +0000 (18:19 +0100)] 
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

3 months agorpm/macros: add %_kernel_install_dir 31551/head
Zbigniew Jędrzejewski-Szmek [Thu, 29 Feb 2024 20:38:03 +0000 (21:38 +0100)] 
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.

3 months agorpm/macros: drop compat define with a typo
Zbigniew Jędrzejewski-Szmek [Thu, 29 Feb 2024 20:32:10 +0000 (21:32 +0100)] 
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.

3 months agoMerge pull request #31544 from mrc0mmand/more-test-tweaks
Luca Boccassi [Thu, 29 Feb 2024 20:29:24 +0000 (20:29 +0000)] 
Merge pull request #31544 from mrc0mmand/more-test-tweaks

A couple of fixlets for TEST-46-HOMED's ssh tests

3 months agossh-generator: handle gracefully if AF_VSOCK works, but /dev/vsock doesn't
Lennart Poettering [Thu, 29 Feb 2024 14:56:24 +0000 (15:56 +0100)] 
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

3 months agoRevert "options" rename in json bootctl output
Ludwig Nussel [Tue, 20 Feb 2024 13:25:12 +0000 (14:25 +0100)] 
Revert "options" rename in json bootctl output

Revert the rename from "options" to "finalCmdline" in 122650b4a0
while the bigger https://github.com/systemd/systemd/pull/31339 is still
under review.

3 months agotest: create sshd's runtime directory (Debian variant) 31544/head
Frantisek Sumsal [Thu, 29 Feb 2024 12:06:28 +0000 (13:06 +0100)] 
test: create sshd's runtime directory (Debian variant)

sshd.service on Debian uses RuntimeDirectory=sshd, without which sshd
complains:

[ 4065.834904] sshd[711]: Missing privilege separation directory: /run/sshd
[ 4065.835785] systemd[1]: mysshserver@0-127.0.0.1:4711-127.0.0.1:58232.service: Deactivated successfully.
[ 4065.836433] testsuite-46.sh[708]: kex_exchange_identification: read: Connection reset by peer
[ 4065.836433] testsuite-46.sh[708]: Connection reset by 127.0.0.1 port 4711

Resolves: #31518

3 months agotest: avoid SIGPIPE from ssh | tail -n 1
Frantisek Sumsal [Thu, 29 Feb 2024 10:57:04 +0000 (11:57 +0100)] 
test: avoid SIGPIPE from ssh | tail -n 1

Addresses: https://github.com/systemd/systemd/issues/31518#issuecomment-1968295678

3 months agotest: use ECDSA keys for ssh-related tests
Frantisek Sumsal [Thu, 29 Feb 2024 10:43:57 +0000 (11:43 +0100)] 
test: use ECDSA keys for ssh-related tests

This should make the test faster, especially on machines without
acceleration.

3 months agotest: shell & cleanup cleanup
Frantisek Sumsal [Thu, 29 Feb 2024 10:37:29 +0000 (11:37 +0100)] 
test: shell & cleanup cleanup

3 months agoMerge pull request #31430 from CodethinkLabs/vmspawn/machinectl_vmspawn_support
Luca Boccassi [Thu, 29 Feb 2024 11:27:02 +0000 (11:27 +0000)] 
Merge pull request #31430 from CodethinkLabs/vmspawn/machinectl_vmspawn_support

machinectl: initial vmspawn support

3 months agoDrop build-api support
Michael Biebl [Wed, 28 Feb 2024 15:11:14 +0000 (16:11 +0100)] 
Drop build-api support

It appears the build-api effort at
https://github.com/cgwalters/build-api hasn't really caught on.
systemd appears one of the very few projects actually supporting it.

It does confuse certain tools though. E.g. debhelper by finding a
configure script wrongly assumes this is an autoconf project and thus
needs to be told explicitly that this is in fact a Meson project [1].

Given that Meson is an established build system by now, it appears ok to
drop this compat layer, which will never be fully complete anyway.

[1] https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/rules?ref_type=heads#L281

3 months agosemaphore: speed up build
Luca Boccassi [Wed, 28 Feb 2024 23:46:15 +0000 (23:46 +0000)] 
semaphore: speed up build

- avoid stripping debug symbols and creating dbgsym packages
- avoid LTO, slows down build a lot
- avoid compressing packages, they are thrown out immediately after use
- avoid building udeb packages, not needed

3 months agodissect-image: fix build
Lennart Poettering [Wed, 28 Feb 2024 21:49:29 +0000 (22:49 +0100)] 
dissect-image: fix build

PRs #31531 and #31524 were merged in quick succession. They are fine
both on their own. But in combination they break the build. Fix it.

3 months agovmspawn: only add to cmdline if tpm was started
Sam Leonard [Wed, 28 Feb 2024 17:39:05 +0000 (17:39 +0000)] 
vmspawn: only add to cmdline if tpm was started

3 months agoMerge pull request #31531 from poettering/verity-userspace-optional
Lennart Poettering [Wed, 28 Feb 2024 21:04:58 +0000 (22:04 +0100)] 
Merge pull request #31531 from poettering/verity-userspace-optional

dissect: make use of userspace verity keyring optional

3 months agoMerge pull request #31524 from poettering/secure-getenv-naming-fix
Luca Boccassi [Wed, 28 Feb 2024 18:01:52 +0000 (18:01 +0000)] 
Merge pull request #31524 from poettering/secure-getenv-naming-fix

change naming order getenv_xyz_secure() → secure_getenv_xyz() to match glibc

3 months agoMerge pull request #31526 from poettering/proc-cmdline-underscorify
Luca Boccassi [Wed, 28 Feb 2024 17:59:46 +0000 (17:59 +0000)] 
Merge pull request #31526 from poettering/proc-cmdline-underscorify

make sure we use underscores for kernel cmdline option names, not dashes

3 months agomachinectl: support vmspawn as a backend 31430/head
Sam Leonard [Tue, 20 Feb 2024 13:14:52 +0000 (13:14 +0000)] 
machinectl: support vmspawn as a backend

3 months agovmspawn: support machined registration
Sam Leonard [Tue, 20 Feb 2024 13:13:16 +0000 (13:13 +0000)] 
vmspawn: support machined registration

3 months agoMerge pull request #31514 from CodethinkLabs/ptyfwd_issues
Lennart Poettering [Wed, 28 Feb 2024 17:36:50 +0000 (18:36 +0100)] 
Merge pull request #31514 from CodethinkLabs/ptyfwd_issues

ptyfwd/terminal-util: improve edge case handling

3 months agodissect: condition usespace verity keyring via kernel cmdline option + env var 31531/head
Lennart Poettering [Wed, 28 Feb 2024 15:16:30 +0000 (16:16 +0100)] 
dissect: condition usespace verity keyring via kernel cmdline option + env var