]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
22 months agotest: install correct kpartx udev rules on Debian
Frantisek Sumsal [Wed, 3 Jan 2024 16:24:03 +0000 (17:24 +0100)] 
test: install correct kpartx udev rules on Debian

Resolves: #30703

22 months agoMerge pull request #30532 from yuwata/udev-extend-timeout-kill-worker
Yu Watanabe [Wed, 3 Jan 2024 20:21:50 +0000 (05:21 +0900)] 
Merge pull request #30532 from yuwata/udev-extend-timeout-kill-worker

udev: extend timeout to prevent kill worker

22 months agoMerge pull request #28836 from msekletar/aux-scope
Yu Watanabe [Wed, 3 Jan 2024 19:52:39 +0000 (04:52 +0900)] 
Merge pull request #28836 from msekletar/aux-scope

core/manager: add dbus API to create auxiliary scope from running service

22 months agoFix KeepCarrier tun/tap device option
Dmitry Konishchev [Sat, 16 Dec 2023 16:41:57 +0000 (19:41 +0300)] 
Fix KeepCarrier tun/tap device option

When KeepCarrier is set, networkd doesn't close tun/tap file descriptor
preserving the active interface state, but doesn't disable its queue
which makes kernel to think that it's still active and send packets to
it.

This patch disables the created queue right after tun/tap interface
creation.

Here is the steps to reproduce the bug:

Having:

systemd/network/10-tun-test.netdev:

    [NetDev]
    Name=tun-test
    Kind=tun

    [Tun]
    MultiQueue=yes
    KeepCarrier=yes

systemd/network/10-tun-test.network:

    [Match]
    Name=tun-test

    [Network]
    DHCP=no
    IPv6AcceptRA=false

    LLMNR=false
    MulticastDNS=false

    Address=172.31.0.1/24

app.c:

    #include <fcntl.h>
    #include <stdio.h>
    #include <string.h>
    #include <unistd.h>
    #include <linux/if.h>
    #include <sys/ioctl.h>
    #include <linux/if_tun.h>

    int main() {
        int fd;
        struct ifreq ifr;

        memset(&ifr, 0, sizeof ifr);
        strcpy(ifr.ifr_name, "tun-test");
        ifr.ifr_flags = IFF_TUN | IFF_NO_PI | IFF_MULTI_QUEUE;

        if((fd = open("/dev/net/tun", O_RDWR)) < 0) {
            perror("Open error");
            return 1;
        }

        if(ioctl(fd, TUNSETIFF, &ifr)) {
            perror("Configure error");
            return 1;
        }

        puts("Ready.");

        char buf[1500];

        while(1) {
            int size = read(fd, buf, sizeof buf);
            if(size < 0) {
                perror("Read error");
                return 1;
            }
            printf("Read %d bytes.\n", size);
        }

        return 0;
    }

Run:
* gcc -o app app.c && ./app
* ping -I tun-test 172.31.0.2

Before the patch the app shows no pings, but after it works properly.

22 months agoMerge pull request #29940 from poettering/stub-confext-pickup
Lennart Poettering [Wed, 3 Jan 2024 16:40:36 +0000 (17:40 +0100)] 
Merge pull request #29940 from poettering/stub-confext-pickup

stub/sysext: pick up confexts from ESP, too

22 months agoMerge pull request #30194 from poettering/tpm-target
Lennart Poettering [Wed, 3 Jan 2024 16:40:17 +0000 (17:40 +0100)] 
Merge pull request #30194 from poettering/tpm-target

units: add a tpm2.target synchronization point and small generator that pulls in

22 months agolabeler: add matches for login and logind
Mike Yuan [Wed, 3 Jan 2024 14:09:52 +0000 (22:09 +0800)] 
labeler: add matches for login and logind

22 months agoMerge pull request #30704 from yuwata/sd-dhcp-server-lease
Lennart Poettering [Wed, 3 Jan 2024 12:58:30 +0000 (13:58 +0100)] 
Merge pull request #30704 from yuwata/sd-dhcp-server-lease

dhcp-server: use sd_dhcp_client_id and split out lease handling to sd-dhcp-server-lease.[ch]

22 months agoMerge pull request #30697 from yuwata/network-address-remove-and-cancel
Lennart Poettering [Wed, 3 Jan 2024 12:55:26 +0000 (13:55 +0100)] 
Merge pull request #30697 from yuwata/network-address-remove-and-cancel

network/address: several cleanups for address removal

22 months agotpm2-util: handle TPMs gracefully that do not support ECC and return TPM2_RC_VALUES
Lennart Poettering [Tue, 2 Jan 2024 17:33:37 +0000 (18:33 +0100)] 
tpm2-util: handle TPMs gracefully that do not support ECC and return TPM2_RC_VALUES

If a TPM doesn't do ECC it could either return zero curves when asked
for it, or it could simply fail with TPM2_RC_VALUES because it doesn't
recognize the capability at all.

Handle both cases the same way.

Fixes: #30679
22 months agotests: add test for StartAuxiliaryScope() 28836/head
Michal Sekletar [Mon, 30 Oct 2023 11:12:28 +0000 (12:12 +0100)] 
tests: add test for StartAuxiliaryScope()

22 months agocore/manager: add dbus API to create auxiliary scope from running service
Michal Sekletar [Mon, 30 Oct 2023 11:08:59 +0000 (12:08 +0100)] 
core/manager: add dbus API to create auxiliary scope from running service

This commit introduces new D-Bus API, StartAuxiliaryScope(). It may be
used by services as part of the restart procedure. Service sends an
array of PID file descriptors corresponding to processes that are part
of the service and must continue running also after service restarts,
i.e. they haven't finished the job why they were spawned in the first
place (e.g. long running video transcoding job). Systemd creates new
scope unit for these processes and migrates them into it. Cgroup
properties of scope are copied from the service so it retains same
cgroup settings and limits as service had.

22 months agoupdate TODO 30194/head
Lennart Poettering [Fri, 24 Nov 2023 17:05:16 +0000 (18:05 +0100)] 
update TODO

22 months agounits: add a tpm2.target synchronization point and small generator that pulls in
Lennart Poettering [Fri, 24 Nov 2023 17:01:56 +0000 (18:01 +0100)] 
units: add a tpm2.target synchronization point and small generator that pulls in

Distributions apparently only compile a subset of TPM2 drivers into the
kernel. For those not compiled it but provided as kmod we need a
synchronization point: we must wait before the first TPM2 interaction
until the driver is available and accessible.

This adds a tpm2.target unit as such a synchronization point. It's
ordered after /dev/tpmrm0, and is pulled in by a generator whenever we
detect that the kernel reported a TPM2 to exist but we have no device
for it yet.

This should solve the issue, but might create problems: if there are TPM
devices supported by firmware that we don't have Linux drivers for we'll
hang for a bit. Hence let's add a kernel cmdline switch to disable (or
alternatively force) this logic.

Fixes: #30164
22 months agotest-64: only look at plugged devices, not all of them
Lennart Poettering [Wed, 29 Nov 2023 21:34:34 +0000 (22:34 +0100)] 
test-64: only look at plugged devices, not all of them

22 months agoresolve/mdns: do not append goodby packet entries to known answers section
Yu Watanabe [Tue, 2 Jan 2024 19:36:47 +0000 (04:36 +0900)] 
resolve/mdns: do not append goodby packet entries to known answers section

When we receive a goodby packet about a host, and we have a cache entry about
the host, we do not immediately remove the cache entry, but update it with TTL 1.
See RFC 6762 section 10.1 and 3755027c2cada70345c96787a9b5569994dd23ed.

If we receive a request soon after the goodby packet, previously the
entry was included in the known answers section of the reply. But such
information should not be appended.

Follow-up for 3755027c2cada70345c96787a9b5569994dd23ed.

22 months agoMerge pull request #30694 from yuwata/sd-netlink-move-macro-and-introduce-tos-getter
Mike Yuan [Wed, 3 Jan 2024 10:47:12 +0000 (18:47 +0800)] 
Merge pull request #30694 from yuwata/sd-netlink-move-macro-and-introduce-tos-getter

sd-netlink: two cleanups

22 months agoMerge pull request #30686 from poettering/uki-measured-check-imply-tpm2
Mike Yuan [Wed, 3 Jan 2024 10:39:22 +0000 (18:39 +0800)] 
Merge pull request #30686 from poettering/uki-measured-check-imply-tpm2

efi-loader: when detecting if we are booted in UKI measured boot mode, imply a check for TPM2

22 months agoconfext: make sure we pick up configuration extensions passed to us from the stub 29940/head
Lennart Poettering [Wed, 8 Nov 2023 18:10:44 +0000 (19:10 +0100)] 
confext: make sure we pick up configuration extensions passed to us from the stub

With fixes from Maanya Goenka.

22 months agostub: pick up confexts from the ESP as well
Lennart Poettering [Wed, 8 Nov 2023 18:02:03 +0000 (19:02 +0100)] 
stub: pick up confexts from the ESP as well

This does what we do for system extension also for configuration
extension.

This is complicated by the fact that we previously looked for
<uki-binary>.d/*.raw for system extensions. We want to measure sysexts
and confexts to different PCRs (13 vs. 12) hence we must distinguish
them, but *.raw would match both kinds.

This commit solves this via the following mechanism: we'll load confexts
from *.confext.raw and sysexts from *.raw but will then enclude
*.confext.raw from the latter. This preserves compatibility but allows
us to somewhat reasonable distinguish both types of images.

The documentation is updated not going into this detail though, and
instead now claims that sysexts shall be *.sysext.raw and confexts
*.confext.raw even though we actually are more lenient than this. This
is simply to push people towards using the longer, more descriptive
suffixes.

I added an XML comment (<!-- … -->) about this to the docs, so that
whenever somebody notices the difference between code and docs
understands why and leaves it that way.

22 months agosd-dhcp-server: rename DHCPLease -> sd_dhcp_server_lease 30704/head
Yu Watanabe [Tue, 2 Jan 2024 21:06:45 +0000 (06:06 +0900)] 
sd-dhcp-server: rename DHCPLease -> sd_dhcp_server_lease

Then, move basic functions for the object to sd-dhcp-server-lease.[ch].

No effective funcional changes.

22 months agosd-dhcp-server: use sd_dhcp_client_id
Yu Watanabe [Tue, 2 Jan 2024 21:06:42 +0000 (06:06 +0900)] 
sd-dhcp-server: use sd_dhcp_client_id

22 months agofundamental: prefer byte swap builtins over byte swapping manually
Rose [Tue, 2 Jan 2024 20:24:58 +0000 (15:24 -0500)] 
fundamental: prefer byte swap builtins over byte swapping manually

This builtin reduces complexity and GCC/Clang have supported these builtins for a long time.

22 months agoMerge pull request #30702 from yuwata/sd-dhcp-client-id
Yu Watanabe [Wed, 3 Jan 2024 06:10:46 +0000 (15:10 +0900)] 
Merge pull request #30702 from yuwata/sd-dhcp-client-id

dhcp: introduce sd_dhcp_client_id and relevant functions

22 months agobacklight: supprt ID_LEDS_CLAMP udev property for leds subsystem devices
Yu Watanabe [Tue, 2 Jan 2024 19:22:27 +0000 (04:22 +0900)] 
backlight: supprt ID_LEDS_CLAMP udev property for leds subsystem devices

Closes #30507.

22 months agoudev/dmi-memory-id: update table with latest SMBIOS specification
Yu Watanabe [Tue, 2 Jan 2024 20:54:12 +0000 (05:54 +0900)] 
udev/dmi-memory-id: update table with latest SMBIOS specification

Closes #30699.

22 months agoMerge pull request #30700 from yuwata/storagetm-fixlets
Yu Watanabe [Tue, 2 Jan 2024 23:42:58 +0000 (08:42 +0900)] 
Merge pull request #30700 from yuwata/storagetm-fixlets

storagetm: several trivial fixlets

22 months agonetwork/route: drop TTL propagate support for MPLS routes
Yu Watanabe [Sun, 31 Dec 2023 22:06:58 +0000 (07:06 +0900)] 
network/route: drop TTL propagate support for MPLS routes

This effectively reverts 9b88f20aba6a78baf18d89e99ff31d5ee40856b8.

We do not support MPLS routes, only IPv4 or IPv6 routes are supported.

22 months agonetwork/queue: fix potential double-free on oom
Yu Watanabe [Tue, 2 Jan 2024 19:19:33 +0000 (04:19 +0900)] 
network/queue: fix potential double-free on oom

Currently, link_queue_request_safe(), which is a wrapper of
request_new(), is called with a free function at
- link_request_stacked_netdev() at netdev/netdev.c,
- link_request_address() at networkd-address.c,
- link_request_nexthop() at networkd-nexthop.c,
- link_request_neighbor() at networkd-networkd.c.

For the netdev case, the reference counter of the passed object is increased
only when the function returns 1. So, on failure (with -ENOMEM)
previously we unexpectedly dropped the reference of the NetDev object.
Similarly, for Address and friends, the ownership of the object is moved to the
Request object only when the function returns 1. And on failure, previously
the object was freed twice.

Also, netdev_queue_request(), which is another wrapper of request_new()
potentially leaks memory when the same NetDev object is queued twice.
Fortunately, that should not happen as the function is called only once
per object.

This fixes the above issue, and now the ownership or the reference
counter of the object is changed only when it is succeeded with 1.

22 months agoMerge pull request #30691 from yuwata/resolve-ipv6
Yu Watanabe [Tue, 2 Jan 2024 23:41:14 +0000 (08:41 +0900)] 
Merge pull request #30691 from yuwata/resolve-ipv6

resolve: do not listen to IPv6 when disabled by sysctl

22 months agotest: rewrite test-exec-deserialization.py
Frantisek Sumsal [Tue, 2 Jan 2024 17:27:45 +0000 (18:27 +0100)] 
test: rewrite test-exec-deserialization.py

Rewrite the test in bash and make it part of our integration test suite,
so it's actually executed in all our upstream CI environments.

The original test is flaky in environments where daemon-reload might
occur during the test runtime (e.g. when running the test in parallel
with the systemd-networkd test suite). Also, it was run only in CentOS
CI in limited way (i.e. without sanitizers), since it tests the host's
systemd, instead of the just built one.

Resolves: #29943

22 months agovarious: unexport a few internal structs
Mike Yuan [Tue, 2 Jan 2024 12:27:02 +0000 (20:27 +0800)] 
various: unexport a few internal structs

We don't expose destructors for these internal structs already.
Let's make the struct itself implementation detail too.

22 months agosd-dhcp-lease: use sd_dhcp_client_id 30702/head
Yu Watanabe [Tue, 2 Jan 2024 21:06:38 +0000 (06:06 +0900)] 
sd-dhcp-lease: use sd_dhcp_client_id

22 months agodhcp: move sd_dhcp_client_id_to_string() to sd-dhcp-client-id.[ch]
Yu Watanabe [Tue, 2 Jan 2024 21:06:36 +0000 (06:06 +0900)] 
dhcp: move sd_dhcp_client_id_to_string() to sd-dhcp-client-id.[ch]

Then, this makes it take sd_dhcp_client_id object, and introduce
sd_dhcp_client_id_to_string_from_raw().

22 months agodhcp: introduce sd_dhcp_client_id and relevant functions
Yu Watanabe [Tue, 2 Jan 2024 21:06:34 +0000 (06:06 +0900)] 
dhcp: introduce sd_dhcp_client_id and relevant functions

This splits out client ID handling from sd-dhcp-client.c to
sd-dhcp-client-id.[ch]. This will be used later in other places.

22 months agostoragetm: ensure we pass dev_t* to sd_device_get_devnum
Mike Gilbert [Fri, 29 Dec 2023 18:45:26 +0000 (13:45 -0500)] 
storagetm: ensure we pass dev_t* to sd_device_get_devnum

On MIPS32 OABI, st_rdev is unsigned long, not dev_t. Use a temporary
variable to avoid an incompatible pointer.

Bug: https://bugs.gentoo.org/920576
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21278
Fixes: https://github.com/systemd/systemd/issues/30626
22 months agostoragetm: fix use of wrong stat element 30700/head
Yu Watanabe [Tue, 2 Jan 2024 20:19:00 +0000 (05:19 +0900)] 
storagetm: fix use of wrong stat element

22 months agostoragetm: always hash stat.st_mode
Yu Watanabe [Tue, 2 Jan 2024 20:07:40 +0000 (05:07 +0900)] 
storagetm: always hash stat.st_mode

To make the hash function consistent with the compare function.

22 months agonetwork/address: introduce address_remove_and_cancel() 30697/head
Yu Watanabe [Tue, 2 Jan 2024 19:40:29 +0000 (04:40 +0900)] 
network/address: introduce address_remove_and_cancel()

Then, replace address_remove_and_drop() with it.

If an address is requested, and the request is already called,
we may not received its reply and notification from the kernel, and
the corresponding address object may not be remmbered. Even in such
case, we need to remove the address, otherwise the address will come
later after the function called.

22 months agonetwork/address: not necessary to remmber address before remove
Yu Watanabe [Tue, 2 Jan 2024 19:40:24 +0000 (04:40 +0900)] 
network/address: not necessary to remmber address before remove

22 months agonetwork/address: make address_remove() take Link object that the address assigned to
Yu Watanabe [Tue, 2 Jan 2024 19:40:08 +0000 (04:40 +0900)] 
network/address: make address_remove() take Link object that the address assigned to

No functional change. Preparation for later commits.

22 months agotest: update test case for failed udev event 30532/head
Yu Watanabe [Tue, 2 Jan 2024 19:23:26 +0000 (04:23 +0900)] 
test: update test case for failed udev event

22 months agoudev: wait for an extra time before the manager kills workers
Yu Watanabe [Tue, 2 Jan 2024 19:23:22 +0000 (04:23 +0900)] 
udev: wait for an extra time before the manager kills workers

Otherwise, udev workers cannot detect slow programs invoked by
IMPORT{program}=, PROGRAM=, or RUN=, and whole worker process may be
killed.

Fixes #30436.

Co-authored-by: sushmbha <sushmita.bhattacharya@oracle.com>
22 months agoudev-spawn: skip executing RUN= if exec_delay= is too long
Yu Watanabe [Tue, 2 Jan 2024 19:23:18 +0000 (04:23 +0900)] 
udev-spawn: skip executing RUN= if exec_delay= is too long

To prevent the worker process killed by the manager.

22 months agoudev-spawn: refuse to spawn commands if the event already takes too long
Yu Watanabe [Tue, 2 Jan 2024 19:23:12 +0000 (04:23 +0900)] 
udev-spawn: refuse to spawn commands if the event already takes too long

Also, calculate the timeout for warning based on the remaining time for
the timeout of the event, rather than the timeout itself.

Currently, udev manager kills the worker if the timeout exceeds. So,
this does not change anything except for the timing of the warning.

Just refactoring and preparation for later commits.

22 months agosd-netlink: introduce sd_rtnl_message_route_set_tos() 30694/head
Yu Watanabe [Tue, 2 Jan 2024 19:21:51 +0000 (04:21 +0900)] 
sd-netlink: introduce sd_rtnl_message_route_set_tos()

We already have the getter for the parameter, but forgot to introduce the setter.

22 months agosd-netlink: move definitions of RTA_TYPE() and RTA_FLAGS() to netlink-util.h
Yu Watanabe [Tue, 2 Jan 2024 19:21:28 +0000 (04:21 +0900)] 
sd-netlink: move definitions of RTA_TYPE() and RTA_FLAGS() to netlink-util.h

22 months agounit: order systemd-resolved after systemd-sysctl 30691/head
Yu Watanabe [Tue, 2 Jan 2024 19:07:11 +0000 (04:07 +0900)] 
unit: order systemd-resolved after systemd-sysctl

Otherwise, IPv6 enable/disable setting may be changed after resolved is
started.

22 months agoresolve: do not listen to IPv6 when disabled by sysctl
Yu Watanabe [Tue, 2 Jan 2024 19:03:25 +0000 (04:03 +0900)] 
resolve: do not listen to IPv6 when disabled by sysctl

Fixes #30669.

22 months agoMerge pull request #30689 from mrc0mmand/even-more-cocci-tweaks
Yu Watanabe [Tue, 2 Jan 2024 18:25:30 +0000 (03:25 +0900)] 
Merge pull request #30689 from mrc0mmand/even-more-cocci-tweaks

coccinelle: drop a couple of FIXMEs

22 months agococcinelle: add a rule for in_addr_hash_func() 30689/head
Frantisek Sumsal [Thu, 28 Dec 2023 17:02:26 +0000 (18:02 +0100)] 
coccinelle: add a rule for in_addr_hash_func()

Follow-up for c01a5c0.

22 months agococcinelle: drop a couple of FIXMEs
Frantisek Sumsal [Thu, 28 Dec 2023 16:12:24 +0000 (17:12 +0100)] 
coccinelle: drop a couple of FIXMEs

Turns out Coccinelle can handle compound literals just fine, the parsing
errors were caused by incorrectly parsed macros in code before the
literals, so let's just provide simplified versions for such macros.

The parsing error in `Type *foo[ELEMENTSOF(bar)] = {};` is actually
harmless; it occurs only when creating an array of pointers for a type
that's in an external header and it occurs only on the first parser's
pass, subsequent passes resolve the type correctly.

Also, unset ENABLE_DEBUG_HASHMAP, so Coccinelle doesn't expand the
hashmap debug macros.

As for the remaining FIXMEs, I opened a couple of issues in the
Coccinelle upstream to see if they can be fixed there (or at least
properly analyzed).

22 months agoRevert "units: add ConditionSecurity=tpm2 to systemd-tpm2-setup units" 30686/head
Lennart Poettering [Tue, 2 Jan 2024 16:40:55 +0000 (17:40 +0100)] 
Revert "units: add ConditionSecurity=tpm2 to systemd-tpm2-setup units"

Now that the ConditionSecurity=uki-measured check is tighter we can drop
the explicit TPM2 check again.

This reverts commit aa735b02196cf6f947fd1e4b2ec46b544ec7c3e1.

22 months agoefi-loader: when detecting if we are booted in UKI measured boot mode, imply a check...
Lennart Poettering [Tue, 2 Jan 2024 16:44:53 +0000 (17:44 +0100)] 
efi-loader: when detecting if we are booted in UKI measured boot mode, imply a check for TPM2

We simply don't carry any userspace support for TPM1.2 in our tree, and
we shouldn't given it's too weak by today's standards. Hence, if we
check if we are booted in UKI measured boot mode, don't just check if we
are booted in EFI, but also check that we have a TPM2 chip (as opposed
to none or only a TPM1.2 chip).

This is an alternative to #30652 but more comprehensive (and simpler),
since it covers all invocations of efi_measured_uki().

Fixes: #30650
Replaces: #30652

22 months agoMerge pull request #30684 from systemd/update-labeler-configuration
Luca Boccassi [Tue, 2 Jan 2024 12:24:48 +0000 (13:24 +0100)] 
Merge pull request #30684 from systemd/update-labeler-configuration

ci: migrate labeler configuration to the new format

22 months agoci: allow testing changes made to labeler configuration 30684/head
Frantisek Sumsal [Tue, 2 Jan 2024 11:38:09 +0000 (12:38 +0100)] 
ci: allow testing changes made to labeler configuration

22 months agoci: use a boolean value for the boolean field
Frantisek Sumsal [Tue, 2 Jan 2024 11:18:52 +0000 (12:18 +0100)] 
ci: use a boolean value for the boolean field

The issue[0] behind this workaround has been resolved[1], so we can set it
to a proper boolean field.

[0] https://github.com/systemd/systemd/issues/18671
[1] https://github.com/actions/labeler/pull/480

22 months agoci: migrate labeler configuration to the new format
Frantisek Sumsal [Tue, 2 Jan 2024 11:14:41 +0000 (12:14 +0100)] 
ci: migrate labeler configuration to the new format

Turns out updating the labeler action is a bit annoying[0], so the
breaking change wasn't detected in the version bump PR.

[0] https://github.com/actions/labeler/#notes-regarding-pull_request_target-event

Follow-up to f88c9b0728.

22 months agosd-journal: introduce cleanup function and hash ops for Directory
Yu Watanabe [Fri, 8 Dec 2023 07:01:06 +0000 (16:01 +0900)] 
sd-journal: introduce cleanup function and hash ops for Directory

This makes the folloing:
- Each Directory object now has a reference to sd-journal.
- Hence, directory_free(), which is renamed from remove_directory(), can
  be called without sd-journal as an argument.
- Introduces hash ops for Directory, so the finalization becomes
  slightly simpler.
- Allocate hashmaps that store Directory objects when necessary.
- Split out add_directory_impl().

No functional changes, just refactoring.

22 months agoMerge pull request #30591 from yuwata/device-util
Luca Boccassi [Mon, 1 Jan 2024 18:26:39 +0000 (19:26 +0100)] 
Merge pull request #30591 from yuwata/device-util

device-util: introduce device_in_subsystem() and device_is_devtype() helper functions

22 months agoMerge pull request #30593 from yuwata/sd-dhcp-duid
Luca Boccassi [Mon, 1 Jan 2024 18:24:31 +0000 (19:24 +0100)] 
Merge pull request #30593 from yuwata/sd-dhcp-duid

dhcp: introduce sd_dhcp_duid and relevant functions

22 months agoMerge pull request #30614 from yuwata/udev-event-take-worker
Luca Boccassi [Mon, 1 Jan 2024 18:18:07 +0000 (19:18 +0100)] 
Merge pull request #30614 from yuwata/udev-event-take-worker

udev: make UdevEvent take UdevWorker object

22 months agoutmp-wtmp: check actual value of bool instead of pointer
Mike Yuan [Mon, 1 Jan 2024 12:41:18 +0000 (20:41 +0800)] 
utmp-wtmp: check actual value of bool instead of pointer

22 months agologind: use handle_action_to_string where appropriate
Mike Yuan [Mon, 1 Jan 2024 12:08:11 +0000 (20:08 +0800)] 
logind: use handle_action_to_string where appropriate

Since 138224fc807091d31f19a3b22f066d6044626001, HandleActionData
records the corresponding HandleAction. Let's use it instead of
relying on inhibit_what when mapping to string.

22 months agoMerge pull request #30674 from YHNdnzj/bus-wait-for-cleanup
Luca Boccassi [Mon, 1 Jan 2024 18:11:46 +0000 (19:11 +0100)] 
Merge pull request #30674 from YHNdnzj/bus-wait-for-cleanup

bus-wait-for-{jobs,units}: some cleanups/modernizations

22 months agobuild(deps): bump github/codeql-action from 2.22.8 to 3.22.12
dependabot[bot] [Mon, 1 Jan 2024 09:40:32 +0000 (09:40 +0000)] 
build(deps): bump github/codeql-action from 2.22.8 to 3.22.12

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.22.8 to 3.22.12.
- [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/407ffafae6a767df3e0230c3df91b6443ae8df75...012739e5082ff0c22ca6d6ab32e07c36df03c4a4)

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

Signed-off-by: dependabot[bot] <support@github.com>
22 months agobuild(deps): bump actions/labeler from 4.3.0 to 5.0.0
dependabot[bot] [Mon, 1 Jan 2024 09:40:40 +0000 (09:40 +0000)] 
build(deps): bump actions/labeler from 4.3.0 to 5.0.0

Bumps [actions/labeler](https://github.com/actions/labeler) from 4.3.0 to 5.0.0.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/ac9175f8a1f3625fd0d4fb234536d26811351594...8558fd74291d67161a8a78ce36a881fa63b766a9)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
22 months agobuild(deps): bump actions/upload-artifact from 3.1.2 to 4.0.0
dependabot[bot] [Mon, 1 Jan 2024 09:40:19 +0000 (09:40 +0000)] 
build(deps): bump actions/upload-artifact from 3.1.2 to 4.0.0

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.2 to 4.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/0b7f8abb1508181956e8e162db84b466c27e18ce...c7d193f32edcb7bfad88892161225aeda64e9392)

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

Signed-off-by: dependabot[bot] <support@github.com>
22 months agobuild(deps): bump meson from 1.3.0 to 1.3.1 in /.github/workflows
dependabot[bot] [Mon, 1 Jan 2024 09:14:26 +0000 (09:14 +0000)] 
build(deps): bump meson from 1.3.0 to 1.3.1 in /.github/workflows

Bumps [meson](https://github.com/mesonbuild/meson) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.3.0...1.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
22 months agobus-wait-for-units: rearrange function 30674/head
Mike Yuan [Mon, 1 Jan 2024 09:52:35 +0000 (17:52 +0800)] 
bus-wait-for-units: rearrange function

22 months agobus-wait-for-units: correctly report state if disconnected from bus
Mike Yuan [Mon, 1 Jan 2024 09:19:35 +0000 (17:19 +0800)] 
bus-wait-for-units: correctly report state if disconnected from bus

22 months agobus-wait-for-units: rephrase error message
Mike Yuan [Mon, 1 Jan 2024 09:16:11 +0000 (17:16 +0800)] 
bus-wait-for-units: rephrase error message

22 months agobus-wait-for-units: use hashmap_remove_value where appropriate
Mike Yuan [Mon, 1 Jan 2024 09:15:23 +0000 (17:15 +0800)] 
bus-wait-for-units: use hashmap_remove_value where appropriate

22 months agobus-wait-for-jobs: remove unneeded strna and refactor code a bit
Mike Yuan [Mon, 1 Jan 2024 10:32:01 +0000 (18:32 +0800)] 
bus-wait-for-jobs: remove unneeded strna and refactor code a bit

22 months agobus-wait-for-jobs: a few modernizations
Mike Yuan [Mon, 1 Jan 2024 08:07:46 +0000 (16:07 +0800)] 
bus-wait-for-jobs: a few modernizations

22 months agobus-wait-for-jobs: rephrase error message
Mike Yuan [Mon, 1 Jan 2024 07:58:52 +0000 (15:58 +0800)] 
bus-wait-for-jobs: rephrase error message

22 months agobus-wait-for-jobs: reorganize functions
Mike Yuan [Mon, 1 Jan 2024 07:57:55 +0000 (15:57 +0800)] 
bus-wait-for-jobs: reorganize functions

22 months agobus-wait-for-jobs: sort includes
Mike Yuan [Mon, 1 Jan 2024 07:45:05 +0000 (15:45 +0800)] 
bus-wait-for-jobs: sort includes

22 months agoMerge pull request #30656 from mrc0mmand/dfuzzer-shenanigans
Yu Watanabe [Sat, 30 Dec 2023 19:52:15 +0000 (04:52 +0900)] 
Merge pull request #30656 from mrc0mmand/dfuzzer-shenanigans

test: avoid starting/stopping unwanted units during fuzzing

22 months agoresolve: DnsTransaction.scope may be NULL when dns_transaction_close_connection(...
Yu Watanabe [Fri, 29 Dec 2023 20:35:32 +0000 (05:35 +0900)] 
resolve: DnsTransaction.scope may be NULL when dns_transaction_close_connection() is called

Follow-up for ac1b7b9e1933c14bc7bf36d4f32a888afb3f2f4d.

Fixes CID#1533020.

22 months agoresolve: add several comments for DNS type table
Yu Watanabe [Fri, 29 Dec 2023 21:05:32 +0000 (06:05 +0900)] 
resolve: add several comments for DNS type table

Also update compile time checks.

Follow-up for 818bb6f4825b57c2cd2783fbffe2b2ef82a31573.

22 months agoMerge pull request #30658 from jnohlgard/udevadm-lock-return-code
Yu Watanabe [Sat, 30 Dec 2023 19:51:09 +0000 (04:51 +0900)] 
Merge pull request #30658 from jnohlgard/udevadm-lock-return-code

udevadm: Propagate return code from verb result

22 months agotest: add simple coverage tests for 'udevadm lock' 30658/head
Yu Watanabe [Fri, 29 Dec 2023 17:51:50 +0000 (02:51 +0900)] 
test: add simple coverage tests for 'udevadm lock'

22 months agoudevadm: Propagate return code from verb result
Joakim Nohlgård [Fri, 29 Dec 2023 14:06:50 +0000 (15:06 +0100)] 
udevadm: Propagate return code from verb result

udevadm lock did not propagate the return code from the child process
because all positive values were treated as success.

v2:
Now 'udevadm test-builtin' ignores all positive return values from the
builtin commands. Otherwise, as the hwdb builtin returns an positive value
when a matching entry found, 'udevadm test-builtin hwdb' will fail.

v3:
Initialize partition table before calling 'sfdisk --delete'.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
22 months agotest: show journal entries matching the test's syslog identifier as well 30656/head
Frantisek Sumsal [Fri, 29 Dec 2023 12:28:05 +0000 (13:28 +0100)] 
test: show journal entries matching the test's syslog identifier as well

22 months agotest: avoid starting/stopping unwanted units during fuzzing
Frantisek Sumsal [Thu, 28 Dec 2023 22:42:47 +0000 (23:42 +0100)] 
test: avoid starting/stopping unwanted units during fuzzing

Skip calling start and stop methods on unit objects, as doing that is
not only time consuming, but it also starts/stops units that interfere
with the machine state. The actual code paths should be covered (to some
degree) by the respective method counterparts on the manager object.

22 months agofd-util: don't eat up errors in fd_cloexec_many
Mike Yuan [Fri, 29 Dec 2023 09:57:59 +0000 (17:57 +0800)] 
fd-util: don't eat up errors in fd_cloexec_many

Follow-up for ed18c22c989495aab36512f03449222cfcf79aa7

Before this commit, a successful fd_cloexec() call would
discard all previously gathered errors.

22 months agotest: wrap adding a suppression in a method
Frantisek Sumsal [Thu, 28 Dec 2023 22:15:42 +0000 (23:15 +0100)] 
test: wrap adding a suppression in a method

22 months agosd-journal: check sd-event state before setting up post change timer
Yu Watanabe [Thu, 28 Dec 2023 19:31:21 +0000 (04:31 +0900)] 
sd-journal: check sd-event state before setting up post change timer

The similar check already exists in schedule_post_change().

The function is currently called at two places.
- journal_file_open() in sd-journal:
  In this case, if the timer is not set up, then journal_file_post_change()
  will be called at the end of journal_file_append_entry(). So, the necessary
  task will be done sequentially when an journal entry is stored to the opened
  journal file. That is desired when the function is called at outside of the
  event loop.
- server_open_journal() in journald:
  This is not called after we exit the event loop.

So, we can safely do nothing in the function if the event loop is being
finished or already finished.

Fixes #30644.

22 months agococcinelle: re-indent comments
Yu Watanabe [Thu, 28 Dec 2023 19:14:55 +0000 (04:14 +0900)] 
coccinelle: re-indent comments

22 months agococcinelle: fix typo
Yu Watanabe [Thu, 28 Dec 2023 19:13:42 +0000 (04:13 +0900)] 
coccinelle: fix typo

Follow-up for b25d3b36a21cd7a68039b85f887cc849ff7664a1.

22 months agodns: update record type enum to match iana
Ronan Pigott [Thu, 28 Dec 2023 01:27:00 +0000 (18:27 -0700)] 
dns: update record type enum to match iana

Adds some new dns record types. Also, some types were inserted into the
middle of the enum — this corrects an error where the enum constants for
some of the record types previously held an incorrect value.

22 months agoMerge pull request #30649 from YHNdnzj/close-nointr-unnecessary
Yu Watanabe [Thu, 28 Dec 2023 19:03:15 +0000 (04:03 +0900)] 
Merge pull request #30649 from YHNdnzj/close-nointr-unnecessary

Some modernization/cleanup for fd-util

22 months agounits: add ConditionSecurity=tpm2 to systemd-tpm2-setup units
Luca Boccassi [Thu, 28 Dec 2023 16:32:06 +0000 (17:32 +0100)] 
units: add ConditionSecurity=tpm2 to systemd-tpm2-setup units

ConditionSecurity=measured-uki can be true even with TPM 1.2 which we
don't support, so add an explicit check for TPM 2.0.

Fixes https://github.com/systemd/systemd/issues/30650

Follow-up for 2e64cb71b9c0160c3

22 months agopo: Translated using Weblate (Punjabi)
A S Alam [Thu, 28 Dec 2023 15:36:26 +0000 (16:36 +0100)] 
po: Translated using Weblate (Punjabi)

Currently translated at 26.4% (60 of 227 strings)

Co-authored-by: A S Alam <aalam@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pa/
Translation: systemd/main

22 months agovarious: don't use close_nointr if retval is not checked anyway 30649/head
Mike Yuan [Thu, 28 Dec 2023 10:13:37 +0000 (18:13 +0800)] 
various: don't use close_nointr if retval is not checked anyway

22 months agologind-session-device: use _cleanup_close_
Mike Yuan [Thu, 28 Dec 2023 12:43:12 +0000 (20:43 +0800)] 
logind-session-device: use _cleanup_close_

22 months agoshared/async: use safe_close where appropriate
Mike Yuan [Thu, 28 Dec 2023 10:05:33 +0000 (18:05 +0800)] 
shared/async: use safe_close where appropriate

22 months agofdset: use FOREACH_ARRAY at one more place
Mike Yuan [Thu, 28 Dec 2023 10:07:12 +0000 (18:07 +0800)] 
fdset: use FOREACH_ARRAY at one more place

22 months agofd-util: modernization
Mike Yuan [Thu, 28 Dec 2023 10:17:52 +0000 (18:17 +0800)] 
fd-util: modernization