]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoRename def.h to constants.h 25291/head
Zbigniew Jędrzejewski-Szmek [Mon, 7 Nov 2022 13:59:58 +0000 (14:59 +0100)] 
Rename def.h to constants.h

The name "def.h" originates from before the rule of "no needless abbreviations"
was established. Let's rename the file to clarify that it contains a collection
of various semi-related constants.

3 years agobasic/filesystems: fs_in_group() returns a boolean
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 17:41:48 +0000 (18:41 +0100)] 
basic/filesystems: fs_in_group() returns a boolean

is_{temporary,network}_fs() looked like they are incorrectly casting an error
to true, but actually the return type is misdeclared.

3 years agobasic: rename util.h to logarithm.h
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 15:54:32 +0000 (16:54 +0100)] 
basic: rename util.h to logarithm.h

util.h is now about logarithms only, so we can rename it. Many files included
util.h for no apparent reason… Those includes are dropped.

3 years agobasic: move a bunch of cmdline-related funcs to new argv-util.c+h
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 15:45:48 +0000 (16:45 +0100)] 
basic: move a bunch of cmdline-related funcs to new argv-util.c+h

I wanted to move saved_arg[cv] to process-util.c+h, but this causes problems:
process-util.h includes format-util.h which includes net/if.h, which conflicts
with linux/if.h. So we can't include process-util.h in some files.

But process-util.c is very long anyway, so it seems nice to create a new file.
rename_process(), invoked_as(), invoked_by_systemd(), and argv_looks_like_help()
which lived in process-util.c refer to saved_argc and saved_argv, so it seems
reasonable to move them to the new file too.

util.c is now empty, so it is removed. util.h remains.

3 years agomeson: add version.h as dependency to more targets
Zbigniew Jędrzejewski-Szmek [Tue, 8 Nov 2022 12:37:27 +0000 (13:37 +0100)] 
meson: add version.h as dependency to more targets

version.h can be generated after compilation starts, creating a race condition
between compilation of various .c files and creation of version.h. Let's add it
as a dependency to more build targets that require version.h or build.h.

So far we played whack'a'mole by adding versiondep whenever compilation failed.
In principle any target which includes compilation (i.e. any that has .c
sources directly), could require this. I don't understand why we didn't see
more failures… But it seems reasonable to just add the dependency more widely.

3 years agobasic: move version() to build.h+c
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 15:30:58 +0000 (16:30 +0100)] 
basic: move version() to build.h+c

3 years agobasic,shared: move disable_coredumps() to coredump-util.[ch]
Zbigniew Jędrzejewski-Szmek [Sat, 5 Nov 2022 16:47:06 +0000 (17:47 +0100)] 
basic,shared: move disable_coredumps() to coredump-util.[ch]

3 years agobasic: move container_get_leader() to process-util.[ch]
Zbigniew Jędrzejewski-Szmek [Sat, 5 Nov 2022 16:40:01 +0000 (17:40 +0100)] 
basic: move container_get_leader() to process-util.[ch]

basic/util.[ch] is a grab-bag of unrelated functions. Let's move a few
of the remaning functions to better locations.

3 years agobasic: create new basic/initrd-util.[ch] for initrd-related functions
Zbigniew Jędrzejewski-Szmek [Sat, 5 Nov 2022 16:29:43 +0000 (17:29 +0100)] 
basic: create new basic/initrd-util.[ch] for initrd-related functions

I changed imports of util.h to initrd-util.h, or added an import of
initrd-util.h, to keep compilation working. It turns out that many files didn't
import util.h directly.

When viewing the patch, don't be confused by git rename detection logic:
a new .c file is added and two functions moved into it.

3 years agotests: move tests for eqzero() to a new file
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 16:19:32 +0000 (17:19 +0100)] 
tests: move tests for eqzero() to a new file

It's a bit silly to have a separate file that one short test, but this is the
last part of the test code that is misplaced, and here consistency beats
brevity.

3 years agotests: move tests for PROTECT_ERRNO to the right file
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 16:15:56 +0000 (17:15 +0100)] 
tests: move tests for PROTECT_ERRNO to the right file

Also, rename them to uppercase so that the test name matches what we're
actually testing.

3 years agotests: create test-raw-clone.c for raw-clone.h
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 16:13:57 +0000 (17:13 +0100)] 
tests: create test-raw-clone.c for raw-clone.h

The include for process-util.h is added for reset_cached_pid(). This
essentially fixes a pre-existing missing include.

3 years agotests: create test-limits-util.c for limits-util funcs
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2022 15:59:04 +0000 (16:59 +0100)] 
tests: create test-limits-util.c for limits-util funcs

3 years agosd-journal: make prot_from_flags() static and rename
Zbigniew Jędrzejewski-Szmek [Sat, 5 Nov 2022 15:12:15 +0000 (16:12 +0100)] 
sd-journal: make prot_from_flags() static and rename

The function had just one caller and a name that didn't explain much.
Let's make it static and rename for clarity.

While at it, the only caller was not doing error handling correctly
— the function would potentially return a negative error value which
wasn't handled. In practice this couldn't happen, but let's remove
this ambiguity.

3 years agoMerge pull request #25266 from poettering/dissect-fsck-fix
Lennart Poettering [Mon, 7 Nov 2022 11:24:53 +0000 (12:24 +0100)] 
Merge pull request #25266 from poettering/dissect-fsck-fix

dissect: fix fsck invocation

3 years agoMerge pull request #25107 from lucab/ups/sysusers-gid-check-username
Luca Boccassi [Sun, 6 Nov 2022 22:58:53 +0000 (23:58 +0100)] 
Merge pull request #25107 from lucab/ups/sysusers-gid-check-username

sysusers: cross-check user and group names too

3 years agoloop-util: open lock fd read-only
Christian Göttsche [Fri, 4 Nov 2022 18:36:31 +0000 (19:36 +0100)] 
loop-util: open lock fd read-only

flock(2) works with file descriptors opened with O_RDONLY.

This affects SELinux systems where access to block devices is quite
restricted to avoid bypasses on filesystem objects.

3 years agocore: update audit messages
Christian Göttsche [Fri, 4 Nov 2022 15:30:57 +0000 (16:30 +0100)] 
core: update audit messages

Pass getuid() instead of literal `0` as auid, since user session
managers also issue audit messages on SELinux denials.

3 years agodissect: get rid of basename() use
Lennart Poettering [Thu, 20 Oct 2022 21:20:49 +0000 (23:20 +0200)] 
dissect: get rid of basename() use

3 years agoci(dev-freeze): Use GitHub Action for PR comments
Jan Macku [Wed, 12 Oct 2022 13:37:00 +0000 (15:37 +0200)] 
ci(dev-freeze): Use GitHub Action for PR comments

GitHub Action `devel-freezer` helps with development freeze notifications
during the RC phase. It will create comments using predefined messages on
newly created and updated PRs when the RC tag has been released.
Also, it will update comments once a new major version has been released.

Documentation available at: https://github.com/redhat-plumbers-in-action/devel-freezer

3 years agotest: fstab-generator: adjust PATH for fsck
Christian Göttsche [Fri, 4 Nov 2022 14:48:50 +0000 (15:48 +0100)] 
test: fstab-generator: adjust PATH for fsck

fsck(8) is located in /usr/sib/ on Debian sid:

    stdout:
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-01-dev-nfs.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-02-dhcp.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-03-dhcp6.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-04-nfs.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-05-nfs4.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-06-ipv4.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-07-ipv6.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-08-implicit-nfs.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-09-cifs.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-10-iscsi.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-11-live.input
    *** Running /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-12-dev-sdx.input
    --- /dev/fd/63  2022-11-04 15:39:13.131532174 +0100
    +++ /dev/fd/62  2022-11-04 15:39:13.131532174 +0100
    @@ -6,3 +6,4 @@
     initrd-usr-fs.target.requires
     initrd-usr-fs.target.requires/sysroot.mount
     sysroot.mount
    +systemd-fsck-root.service
    **** Unexpected output for /home/christian/Coding/workspaces/systemd/test/testdata/test-fstab-generator/test-12-dev-sdx.input
    stderr:
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on NFS was requested.
    Skipping root directory handling, as root on CIFS was requested.
    Skipping root directory handling, as root on iSCSI was requested.
    Skipping root directory handling, as root on live image was requested.
    Found entry what=/dev/sdx1 where=/sysroot type=n/a opts=ro
    Checking was requested for /dev/sdx1, but the fsck command does not exist.

3 years agodissect: fix fsck 25266/head
Lennart Poettering [Fri, 4 Nov 2022 17:26:42 +0000 (18:26 +0100)] 
dissect: fix fsck

Since f7725647bb41c3398a867f139efe526efe8aa1b3 when dissecting a disk
image we operate with fds to the device nodes in question wherever we
can. This includes when we fork off fsck, where we pass a /proc/self/fd/
path as argument. This only works if we keep that fd open however and
disable O_CLOEXEC on the fd. Hence do so, and fix fsck this way.

(Without this, all fsck will fail, since the fd path is invalid)

3 years agoprocess-util: add new FORK_CLOEXEC_OFF flag for disabling O_CLOEXEC on remaining fds
Lennart Poettering [Fri, 4 Nov 2022 17:20:47 +0000 (18:20 +0100)] 
process-util: add new FORK_CLOEXEC_OFF flag for disabling O_CLOEXEC on remaining fds

Often the fds that shall stay around in the child shall be passed
to a process over execve(), hence add an option to explicitly disable
O_CLOEXEC on them in the child.

3 years agofd-util: add new fd_cloexec_many() helper
Lennart Poettering [Fri, 4 Nov 2022 17:20:19 +0000 (18:20 +0100)] 
fd-util: add new fd_cloexec_many() helper

3 years agofd-util: make fd_in_set() (and thus close_all_fds()) handle invalidated fds in the...
Lennart Poettering [Fri, 4 Nov 2022 17:19:29 +0000 (18:19 +0100)] 
fd-util: make fd_in_set() (and thus close_all_fds()) handle invalidated fds in the array

let's handle gracefully if fds in the specified array are already
invalidated (i.e. negative). This is handy when putting together arrays
on the fly.

3 years agoMerge pull request #25257 from fbuihuu/fix-test-execute-on-opensuse
Luca Boccassi [Fri, 4 Nov 2022 17:29:51 +0000 (18:29 +0100)] 
Merge pull request #25257 from fbuihuu/fix-test-execute-on-opensuse

Fix test execute on opensuse

3 years agokernel-install/90-loaderentry: do not add multiple systemd.machine_id options
Antonio Alvarez Feijoo [Fri, 4 Nov 2022 08:57:24 +0000 (09:57 +0100)] 
kernel-install/90-loaderentry: do not add multiple systemd.machine_id options

Do not unconditionally add a new systemd.machine_id command line option, first
check if it already exists with the expected value.

Fixes #25203

3 years agotmpfiles.d: do not fail if provision.conf fails
Luca Boccassi [Thu, 3 Nov 2022 20:10:57 +0000 (20:10 +0000)] 
tmpfiles.d: do not fail if provision.conf fails

On a read-only filesystem creating /root/.ssh might fail, but that's ok.
Do not fail the run, as this is only needed to add the credential, which
is a separate step.

3 years agopo: Translated using Weblate (Korean)
김인수 [Fri, 4 Nov 2022 12:19:47 +0000 (13:19 +0100)] 
po: Translated using Weblate (Korean)

Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: 김인수 <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main

3 years agotests: minor simplification in test-execute 25257/head
Franck Bui [Fri, 4 Nov 2022 11:50:04 +0000 (12:50 +0100)] 
tests: minor simplification in test-execute

No functional change.

3 years agotests: make test-execute pass on openSUSE
Franck Bui [Fri, 4 Nov 2022 11:24:10 +0000 (12:24 +0100)] 
tests: make test-execute pass on openSUSE

In my understanding user group "3" (aka "sys") is kept for historical reasons
but not really useful these days. That's probably explained why this group
isn't defined on openSUSE.

Hence let's drop reference to this user group, this shouldn't lessen the
revelance of the test since SupplementaryGroups= is still tested with 2 other
groups.

3 years agoresolve: enable per-link mDNS setting by default
Yu Watanabe [Fri, 4 Nov 2022 03:06:21 +0000 (12:06 +0900)] 
resolve: enable per-link mDNS setting by default

Otherwise, if the link is not managed by systemd-networkd, mDNS cannot
be enabled without calling `resolvectl` explicitly.

Fixes #25252.

3 years agoMerge pull request #25244 from yuwata/reboot-util-follow-ups
Luca Boccassi [Fri, 4 Nov 2022 11:13:01 +0000 (12:13 +0100)] 
Merge pull request #25244 from yuwata/reboot-util-follow-ups

reboot-util: several cleanups

3 years agoMerge pull request #25246 from yuwata/udev-serial-by-id-symlinks
Luca Boccassi [Fri, 4 Nov 2022 09:18:08 +0000 (10:18 +0100)] 
Merge pull request #25246 from yuwata/udev-serial-by-id-symlinks

udev: fix by-id symlinks

3 years agoMerge pull request #25250 from mrc0mmand/coverage
Yu Watanabe [Fri, 4 Nov 2022 06:53:03 +0000 (15:53 +0900)] 
Merge pull request #25250 from mrc0mmand/coverage

test: provide coverage for auxiliary utilities

3 years agofirstboot: fix segfault when --locale-messages= is passed without --locale=
Luca Boccassi [Fri, 4 Nov 2022 00:01:16 +0000 (00:01 +0000)] 
firstboot: fix segfault when --locale-messages= is passed without --locale=

\#0  __strcmp_evex () at ../sysdeps/x86_64/multiarch/strcmp-evex.S:295
No locals.
\#1  0x0000557444eb172b in process_locale () at ../src/firstboot/firstboot.c:342
        etc_localeconf = 0x7ffd40217b80 "/root/root/etc/locale.conf"
        locales = {0x0, 0x0, 0x0}
        i = 0
        r = <optimized out>
        __PRETTY_FUNCTION__ = "process_locale"
        __func__ = "process_locale"
\#2  0x0000557444eaff93 in run (argv=0x7ffd40217d98, argc=3) at ../src/firstboot/firstboot.c:1401
        loop_device = 0x0
        unlink_dir = 0x0
        r = <optimized out>
        loop_device = <optimized out>
        unlink_dir = <optimized out>
        r = <optimized out>
        __func__ = <optimized out>
        __PRETTY_FUNCTION__ = <optimized out>
        enabled = <optimized out>
        _error = <optimized out>
        _level = <optimized out>
        _e = <optimized out>
        _level = <optimized out>
        _e = <optimized out>
\#3  main (argc=3, argv=0x7ffd40217d98) at ../src/firstboot/firstboot.c:1432
        r = <optimized out>
        __PRETTY_FUNCTION__ = "main"

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

3 years agoreboot-util: drop unnecessary cast 25244/head
Yu Watanabe [Thu, 3 Nov 2022 00:19:07 +0000 (09:19 +0900)] 
reboot-util: drop unnecessary cast

Follow-up for ede5a78f50ed2d5f86dc7a117de2a51b397d52d4.

3 years agoreboot-util: drop redundant headers
Yu Watanabe [Thu, 3 Nov 2022 00:16:43 +0000 (09:16 +0900)] 
reboot-util: drop redundant headers

Follow-up for ede5a78f50ed2d5f86dc7a117de2a51b397d52d4.

3 years agomeson: sort libraries
Yu Watanabe [Thu, 3 Nov 2022 00:10:59 +0000 (09:10 +0900)] 
meson: sort libraries

Except for 'threads'.

Follow-up for ede5a78f50ed2d5f86dc7a117de2a51b397d52d4.

3 years agotest: introduce sanity coverage for auxiliary utils 25250/head
Frantisek Sumsal [Thu, 3 Nov 2022 12:13:03 +0000 (13:13 +0100)] 
test: introduce sanity coverage for auxiliary utils

3 years agotest-sysusers: check group creation with matching user entry 25107/head
Luca BRUNO [Thu, 3 Nov 2022 15:11:01 +0000 (15:11 +0000)] 
test-sysusers: check group creation with matching user entry

3 years agosysusers: cross-check user and group names too
Luca BRUNO [Thu, 3 Nov 2022 15:11:00 +0000 (15:11 +0000)] 
sysusers: cross-check user and group names too

This adds an additional name check when cross-matching new group
entries against existing users, which allows coalescing entries
matching both ID and name.
It provides a small idempotence enhancement when creating groups
in cases where matching user entries are in place. By fine-tuning
the conflict detection logic, this avoids picking up new random
IDs and correctly prefers configuration values instead.

3 years agotest: cover a couple of previously missed analyze code paths
Frantisek Sumsal [Thu, 3 Nov 2022 10:33:13 +0000 (11:33 +0100)] 
test: cover a couple of previously missed analyze code paths

3 years agotest: cover legacy/deprecated systemd-analyze verbs
Frantisek Sumsal [Thu, 3 Nov 2022 09:59:38 +0000 (10:59 +0100)] 
test: cover legacy/deprecated systemd-analyze verbs

They're no longer documented since 26e1e97345 but still work.

3 years agoudev: add safe guard for setting by-id symlink 25246/head
Yu Watanabe [Thu, 3 Nov 2022 00:52:23 +0000 (09:52 +0900)] 
udev: add safe guard for setting by-id symlink

The ID_BUS property is necessary for creating by-id symlinks.

3 years agoudev: drop redundant call of usb_id and assignment of ID_USB_INTERFACE_NUM
Yu Watanabe [Thu, 3 Nov 2022 00:43:14 +0000 (09:43 +0900)] 
udev: drop redundant call of usb_id and assignment of ID_USB_INTERFACE_NUM

The usb_id builtin command is already called in the above, and the
command sets the ID_USB_INTERFACE_NUM property.

3 years agoudev: first set properties based on usb subsystem
Yu Watanabe [Thu, 3 Nov 2022 00:39:36 +0000 (09:39 +0900)] 
udev: first set properties based on usb subsystem

After 479da1107a0d4e2f7ef5cd938512b87a0e45f180, the usb_id builtin
command does not set ID_SERIAL if ID_BUS is already set.
Before the commit, all properties set based on pci bus were overwritten
by the usb_id, hence now it is sufficient setting them only when ID_BUS is
not set yet.

Fixes #25238.

3 years agotest: add a sanity coverage for systemd-analyze verbs
Frantisek Sumsal [Wed, 2 Nov 2022 16:51:51 +0000 (17:51 +0100)] 
test: add a sanity coverage for systemd-analyze verbs

3 years agoshutdown: Add Xen kexec support
Samuel Thibault [Tue, 1 Nov 2022 15:53:02 +0000 (16:53 +0100)] 
shutdown: Add Xen kexec support

In the Xen case, it's the hypervisor which manages kexec. We thus
have to ask it whether a kernel is loaded, instead of relying on
/sys/kernel/kexec_loaded.

3 years agotest: further extend systemctl's sanity coverage
Frantisek Sumsal [Wed, 2 Nov 2022 10:44:00 +0000 (11:44 +0100)] 
test: further extend systemctl's sanity coverage

Also, fix a race condition introduced by d16684fe13:
```
[   16.904218] H testsuite-26.sh[394]: + systemd-run --unit failed.service /bin/false
[   16.964783] H systemd[845]: failed.service: Executing: /bin/false
[   16.965062] H systemd[1]: Started failed.service.
[   16.965462] H testsuite-26.sh[844]: Running as unit: failed.service
[   16.966390] H testsuite-26.sh[394]: + systemctl is-failed failed.service
[   16.977970] H testsuite-26.sh[846]: active
[   16.978403] H systemd[1]: failed.service: Main process exited, code=exited, status=1/FAILURE
[   16.978478] H systemd[1]: failed.service: Failed with result 'exit-code'.
```

3 years agoman: use the correct 'Markers' property name for marking units
Frantisek Sumsal [Wed, 2 Nov 2022 10:48:23 +0000 (11:48 +0100)] 
man: use the correct 'Markers' property name for marking units

Follow-up to c9615f7352 and 70666e28a1.

3 years agocore: fix memleak in GetUnitFileLinks method
Yu Watanabe [Tue, 1 Nov 2022 22:06:46 +0000 (07:06 +0900)] 
core: fix memleak in GetUnitFileLinks method

3 years agoMerge pull request #25229 from mrc0mmand/extend-coverage
Yu Watanabe [Tue, 1 Nov 2022 23:24:38 +0000 (08:24 +0900)] 
Merge pull request #25229 from mrc0mmand/extend-coverage

test: extend the sanity coverage a bit

3 years agotest-network: wait for bound interface to be processed by udevd
Yu Watanabe [Tue, 1 Nov 2022 21:49:26 +0000 (06:49 +0900)] 
test-network: wait for bound interface to be processed by udevd

If another bound interface (dummy98) will be removed before that dummy99
is processed by udevd, then removing dummy98 in the next step makes the
target interface (test1) bring down.

Follow-up for 3e2f7c46da528775f90c521e4cf22c2f61f82a81.

3 years agodocs: DPS and BLS have moved to uapi-group.org
Luca Boccassi [Tue, 1 Nov 2022 21:55:23 +0000 (21:55 +0000)] 
docs: DPS and BLS have moved to uapi-group.org

3 years agoupdate credentials when reloading a service
Jörg Thalheim [Thu, 27 Oct 2022 13:59:56 +0000 (15:59 +0200)] 
update credentials when reloading a service

Many long-running services will reload configuration and therefore
credentials on reload. Therefore its useful if a service reload will
also update credentials.

Tested in https://github.com/numtide/systemd-vaultd/pull/12

3 years agotest: add a couple of sanity tests for systemctl 25229/head
Frantisek Sumsal [Tue, 1 Nov 2022 19:47:37 +0000 (20:47 +0100)] 
test: add a couple of sanity tests for systemctl

3 years agoMerge pull request #25192 from yuwata/wait-online-altname
Luca Boccassi [Tue, 1 Nov 2022 17:31:08 +0000 (18:31 +0100)] 
Merge pull request #25192 from yuwata/wait-online-altname

wait-online: support alternative interface names

3 years agotest: rename TEST-26-SETENV to TEST-26-SYSTEMCTL
Frantisek Sumsal [Tue, 1 Nov 2022 16:53:42 +0000 (17:53 +0100)] 
test: rename TEST-26-SETENV to TEST-26-SYSTEMCTL

3 years agotest: add a couple of sanity tests for loginctl
Frantisek Sumsal [Tue, 1 Nov 2022 08:17:58 +0000 (09:17 +0100)] 
test: add a couple of sanity tests for loginctl

3 years agonamespace: Add hidepid/subset support check
Daan De Meyer [Thu, 27 Oct 2022 11:14:12 +0000 (13:14 +0200)] 
namespace: Add hidepid/subset support check

Using fsopen()/fsconfig(), we can check if hidepid/subset are supported to
avoid the noisy logs from the kernel if they aren't supported. This works
on centos/redhat 8 as well since they've backported fsopen()/fsconfig().

3 years agocondition: Check that subsystem is enabled in ConditionSecurity=tpm2
Daan De Meyer [Thu, 27 Oct 2022 09:12:10 +0000 (11:12 +0200)] 
condition: Check that subsystem is enabled in ConditionSecurity=tpm2

Instead of succeeding when either the firmware reports a TPM device
or we find a TPM device, let's check that the firmware reports a TPM
device and the TPM subsystem is enabled in the kernel.

To check whether the subsystem enabled, we check if the relevant
subdirectory in /sys exists at all.

3 years agotest-network: explicitly prepare default.link 25192/head
Yu Watanabe [Mon, 31 Oct 2022 01:40:31 +0000 (10:40 +0900)] 
test-network: explicitly prepare default.link

On CentOS CI (Arch), 99-default.link is masked. Let's explicitly provide
the same .link file with a different prefix number.

3 years agotest-network: resolve interface name from alternative name
Yu Watanabe [Mon, 31 Oct 2022 05:00:29 +0000 (14:00 +0900)] 
test-network: resolve interface name from alternative name

3 years agotest-network: fix use of undeclared variable
Yu Watanabe [Mon, 31 Oct 2022 03:13:15 +0000 (12:13 +0900)] 
test-network: fix use of undeclared variable

3 years agotest-network: make link_exists() support alternative names
Yu Watanabe [Mon, 31 Oct 2022 03:12:26 +0000 (12:12 +0900)] 
test-network: make link_exists() support alternative names

3 years agonetwork: update comment
Yu Watanabe [Tue, 1 Nov 2022 13:38:33 +0000 (22:38 +0900)] 
network: update comment

3 years agowait-online: support alternative names
Yu Watanabe [Mon, 31 Oct 2022 01:19:43 +0000 (10:19 +0900)] 
wait-online: support alternative names

3 years agowait-online: check received interface name
Yu Watanabe [Mon, 31 Oct 2022 01:25:50 +0000 (10:25 +0900)] 
wait-online: check received interface name

3 years agobuild(deps): bump github/codeql-action from 2.1.17 to 2.1.29
dependabot[bot] [Tue, 1 Nov 2022 09:31:56 +0000 (09:31 +0000)] 
build(deps): bump github/codeql-action from 2.1.17 to 2.1.29

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.17 to 2.1.29.
- [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/v2.1.17...ec3cf9c605b848da5f1e41e8452719eb1ccfb9a6)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump meson from 0.63.2 to 0.63.3 in /.github/workflows
dependabot[bot] [Tue, 1 Nov 2022 09:31:59 +0000 (09:31 +0000)] 
build(deps): bump meson from 0.63.2 to 0.63.3 in /.github/workflows

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

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years agonetwork: forcibly reconfigure all interfaces after sleep
Yu Watanabe [Tue, 1 Nov 2022 04:36:52 +0000 (13:36 +0900)] 
network: forcibly reconfigure all interfaces after sleep

Previously, interfaces are partially reconfigured in a spurious way.
Let's use the same way as `networkctl reconfigure`.

Hopefully fixes #14987 and #24997.

3 years agotest-network: add a testcase that all bound interfaces removed
Yu Watanabe [Tue, 1 Nov 2022 05:32:26 +0000 (14:32 +0900)] 
test-network: add a testcase that all bound interfaces removed

Closes #4202.

3 years agobuild(deps): bump systemd/mkosi
dependabot[bot] [Tue, 1 Nov 2022 09:31:44 +0000 (09:31 +0000)] 
build(deps): bump systemd/mkosi

Bumps [systemd/mkosi](https://github.com/systemd/mkosi) from 792cbc60eb2dc4a58d66bb3c212bf92f8d50f6ea to 14. This release includes the previously tagged commit.
- [Release notes](https://github.com/systemd/mkosi/releases)
- [Changelog](https://github.com/systemd/mkosi/blob/main/NEWS.md)
- [Commits](https://github.com/systemd/mkosi/compare/792cbc60eb2dc4a58d66bb3c212bf92f8d50f6ea...c9772ec920f1cd03181ba14e6fe2c3d35ccb4f92)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump ossf/scorecard-action from 2.0.4 to 2.0.6
dependabot[bot] [Tue, 1 Nov 2022 09:31:50 +0000 (09:31 +0000)] 
build(deps): bump ossf/scorecard-action from 2.0.4 to 2.0.6

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.0.4 to 2.0.6.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/e363bfca00e752f91de7b7d2a77340e2e523cb18...99c53751e09b9529366343771cc321ec74e9bd3d)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agocoverage: Mark _coverage__exit as noreturn
Jan Janssen [Tue, 1 Nov 2022 08:43:32 +0000 (09:43 +0100)] 
coverage: Mark _coverage__exit as noreturn

../src/basic/coverage.h:15:48: warning: function '_coverage__exit' could
be declared with attribute 'noreturn' [-Wmissing-noreturn]

3 years agoresolved: fix typo in feature level table
Youfu Zhang [Tue, 1 Nov 2022 05:18:25 +0000 (13:18 +0800)] 
resolved: fix typo in feature level table

3 years agoMerge pull request #25206 from p-fpv/main
Yu Watanabe [Tue, 1 Nov 2022 07:23:09 +0000 (16:23 +0900)] 
Merge pull request #25206 from p-fpv/main

hwdb: Add Lenovo G580

3 years agohwdb: Add Lenovo G580 25206/head
p-fpv [Mon, 31 Oct 2022 20:45:53 +0000 (23:45 +0300)] 
hwdb: Add Lenovo G580

Fixes #23066.

3 years agoparse_hwdb: allow negative value for EVDEV_ABS_ properties
Yu Watanabe [Tue, 1 Nov 2022 04:10:20 +0000 (13:10 +0900)] 
parse_hwdb: allow negative value for EVDEV_ABS_ properties

3 years agowait-online: split out link_update_name()
Yu Watanabe [Mon, 31 Oct 2022 01:14:30 +0000 (10:14 +0900)] 
wait-online: split out link_update_name()

No functional changes, just refactoring and preparation for later
commits.

3 years agowait-online: ignore one more error in callback function
Yu Watanabe [Mon, 31 Oct 2022 01:22:09 +0000 (10:22 +0900)] 
wait-online: ignore one more error in callback function

3 years agoMerge pull request #25207 from bluca/typo
Luca Boccassi [Mon, 31 Oct 2022 22:12:21 +0000 (23:12 +0100)] 
Merge pull request #25207 from bluca/typo

Typo in manpage, missing +x

3 years agotest: add +x to assert.sh 25207/head
Luca Boccassi [Mon, 31 Oct 2022 21:18:53 +0000 (21:18 +0000)] 
test: add +x to assert.sh

The script has a shebang and .sh extension, so make it executable

W: systemd-tests: script-not-executable [usr/lib/systemd/tests/testdata/units/assert.sh]

3 years agoman: fix typo found by Lintian
Luca Boccassi [Mon, 31 Oct 2022 21:17:47 +0000 (21:17 +0000)] 
man: fix typo found by Lintian

3 years agoMerge pull request #25143 from yuwata/network-reconfigure-interface-when-renamed
Luca Boccassi [Mon, 31 Oct 2022 20:14:24 +0000 (21:14 +0100)] 
Merge pull request #25143 from yuwata/network-reconfigure-interface-when-renamed

network: reconfigure interface when renamed

3 years agonetwork: skip to reassign master ifindex if already set
Yu Watanabe [Thu, 27 Oct 2022 21:40:07 +0000 (06:40 +0900)] 
network: skip to reassign master ifindex if already set

Otherwise, the slave interface may go down, especially when the master
is bond.

Fixes #25067.

3 years agomeson: systemd-repart.standalone
Zbigniew Jędrzejewski-Szmek [Thu, 27 Oct 2022 06:31:30 +0000 (08:31 +0200)] 
meson: systemd-repart.standalone

Repart is growing into an important tool on its own, and users might
want to install newer versions on systems that have older systemd. Let's
make this easier by providing a standalone binary.

Related to https://github.com/systemd/mkosi/issues/1228.

3 years agoudev: drop trivial wrapper for udev_watch_begin()
Yu Watanabe [Tue, 25 Oct 2022 21:07:30 +0000 (06:07 +0900)] 
udev: drop trivial wrapper for udev_watch_begin()

3 years agoudev: Handle AMBA bus the same way as generic platform bus
Marek Vasut [Tue, 25 Oct 2022 10:50:09 +0000 (12:50 +0200)] 
udev: Handle AMBA bus the same way as generic platform bus

On various ARM systems, it is possible to find devices on AMBA bus.
This is defined in Linux kernel drivers/amba/bus.c as separate bus
type. Udev currently does not recognize this when building ID_PATH
which leads to ID_PATH containing the suffix from next recognized
parent device. On ST STM32MP15xx with SDIO WiFi, the ID_PATH looks
like 'platform-soc', which is not unique and basically useless. On
NXP i.MX8M Plus with SDIO WiFi, ID_PATH is 'platform-30b40000.mmc'
which is far more useful.

Add the 'amba' subsystem handling the same way 'platform' subsystem
is handled to get ID_PATH 'platform-soc-amba-48004000.sdmmc' on the
former, which is far more useful compared to 'platform-soc'.

---

```
$ udevadm info --attribute-walk --path=/devices/platform/soc/48004000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/net/wlan0

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/soc/48004000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/net/wlan0':
    KERNEL=="wlan0"
    SUBSYSTEM=="net"
    DRIVER==""
    ATTR{addr_assign_type}=="0"
    ATTR{addr_len}=="6"
    ATTR{address}=="10:98:c3:5f:4b:80"
    ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
    ATTR{carrier_changes}=="1"
    ATTR{carrier_down_count}=="1"
    ATTR{carrier_up_count}=="0"
    ATTR{dev_id}=="0x0"
    ATTR{dev_port}=="0"
    ATTR{flags}=="0x1002"
    ATTR{gro_flush_timeout}=="0"
    ATTR{ifalias}==""
    ATTR{ifindex}=="3"
    ATTR{iflink}=="3"
    ATTR{link_mode}=="0"
    ATTR{mtu}=="1500"
    ATTR{napi_defer_hard_irqs}=="0"
    ATTR{netdev_group}=="0"
    ATTR{operstate}=="down"
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"
    ATTR{proto_down}=="0"
    ATTR{queues/rx-0/rps_cpus}=="0"
    ATTR{queues/rx-0/rps_flow_cnt}=="0"
    ATTR{queues/tx-0/byte_queue_limits/hold_time}=="1000"
    ATTR{queues/tx-0/byte_queue_limits/inflight}=="0"
    ATTR{queues/tx-0/byte_queue_limits/limit}=="0"
    ATTR{queues/tx-0/byte_queue_limits/limit_max}=="1879048192"
    ATTR{queues/tx-0/byte_queue_limits/limit_min}=="0"
    ATTR{queues/tx-0/tx_maxrate}=="0"
    ATTR{queues/tx-0/tx_timeout}=="0"
    ATTR{queues/tx-0/xps_rxqs}=="0"
    ATTR{statistics/collisions}=="0"
    ATTR{statistics/multicast}=="0"
    ATTR{statistics/rx_bytes}=="0"
    ATTR{statistics/rx_compressed}=="0"
    ATTR{statistics/rx_crc_errors}=="0"
    ATTR{statistics/rx_dropped}=="0"
    ATTR{statistics/rx_errors}=="0"
    ATTR{statistics/rx_fifo_errors}=="0"
    ATTR{statistics/rx_frame_errors}=="0"
    ATTR{statistics/rx_length_errors}=="0"
    ATTR{statistics/rx_missed_errors}=="0"
    ATTR{statistics/rx_nohandler}=="0"
    ATTR{statistics/rx_over_errors}=="0"
    ATTR{statistics/rx_packets}=="0"
    ATTR{statistics/tx_aborted_errors}=="0"
    ATTR{statistics/tx_bytes}=="0"
    ATTR{statistics/tx_carrier_errors}=="0"
    ATTR{statistics/tx_compressed}=="0"
    ATTR{statistics/tx_dropped}=="0"
    ATTR{statistics/tx_errors}=="0"
    ATTR{statistics/tx_fifo_errors}=="0"
    ATTR{statistics/tx_heartbeat_errors}=="0"
    ATTR{statistics/tx_packets}=="0"
    ATTR{statistics/tx_window_errors}=="0"
    ATTR{threaded}=="0"
    ATTR{tx_queue_len}=="1000"
    ATTR{type}=="1"

  looking at parent device '/devices/platform/soc/48004000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1':
    KERNELS=="mmc1:0001:1"
    SUBSYSTEMS=="sdio"
    DRIVERS=="brcmfmac"
    ATTRS{class}=="0x00"
    ATTRS{coredump}=="(write-only)"
    ATTRS{device}=="0xa9bf"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{revision}=="0.0"
    ATTRS{vendor}=="0x02d0"

  looking at parent device '/devices/platform/soc/48004000.mmc/mmc_host/mmc1/mmc1:0001':
    KERNELS=="mmc1:0001"
    SUBSYSTEMS=="mmc"
    DRIVERS==""
    ATTRS{device}=="0xa9bf"
    ATTRS{ocr}=="0x00200000"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{rca}=="0x0001"
    ATTRS{revision}=="0.0"
    ATTRS{type}=="SDIO"
    ATTRS{vendor}=="0x02d0"

  looking at parent device '/devices/platform/soc/48004000.mmc/mmc_host/mmc1':
    KERNELS=="mmc1"
    SUBSYSTEMS=="mmc_host"
    DRIVERS==""
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform/soc/48004000.mmc':
    KERNELS=="48004000.mmc"
    SUBSYSTEMS=="amba" <------------------------------------------------------- AMBA is here
    DRIVERS=="mmci-pl18x"
    ATTRS{driver_override}=="(null)"
    ATTRS{id}=="00253180"
    ATTRS{power/autosuspend_delay_ms}=="50"
    ATTRS{power/control}=="on"
    ATTRS{power/runtime_active_time}=="666709"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform/soc':
    KERNELS=="soc"
    SUBSYSTEMS=="platform"
    DRIVERS=="simple-pm-bus"
    ATTRS{driver_override}=="(null)"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
```

3 years agosd-bus: convenience functions to emit a signal to a destination (#25123)
Erik Moqvist [Mon, 31 Oct 2022 20:11:48 +0000 (21:11 +0100)] 
sd-bus: convenience functions to emit a signal to a destination (#25123)

* sd-bus: convenience functions to emit a signal to a destination

3 years agoudev-builtin-net_id: support getting usb path off the host
Charles Hardin [Mon, 10 Oct 2022 20:30:10 +0000 (13:30 -0700)] 
udev-builtin-net_id: support getting usb path off the host

To support predictable interface names in various embeeded systems
add support for an additional naming scheming using the USB host
interface. Several asics have usb controllers that are platform
devices and not children of a pci interface. These embedded systems
should be able to enumerate interfaces by udev path as well to support
configurations and policies.

Signed-off-by: Charles Hardin <charles.hardin@chargepoint.com>
3 years agodissect: add --list option
Antonio Alvarez Feijoo [Thu, 20 Oct 2022 06:07:37 +0000 (08:07 +0200)] 
dissect: add --list option

New option to print the paths of all the files and directories in the image to
stdout.

3 years agoMerge pull request #25092 from fbuihuu/random-seed-tweaks
Luca Boccassi [Mon, 31 Oct 2022 20:10:39 +0000 (21:10 +0100)] 
Merge pull request #25092 from fbuihuu/random-seed-tweaks

Random seed tweaks

3 years agoMerge pull request #24958 from Werkov/meson-generated-directives
Luca Boccassi [Mon, 31 Oct 2022 20:04:30 +0000 (21:04 +0100)] 
Merge pull request #24958 from Werkov/meson-generated-directives

Generate dirrectives for fuzzer tests

3 years agoMerge pull request #25134 from medhefgo/macro
Luca Boccassi [Mon, 31 Oct 2022 20:03:39 +0000 (21:03 +0100)] 
Merge pull request #25134 from medhefgo/macro

macro: Small IN_SET improvements

3 years agoMerge pull request #25136 from yuwata/udev-id-renaming
Luca Boccassi [Mon, 31 Oct 2022 20:02:41 +0000 (21:02 +0100)] 
Merge pull request #25136 from yuwata/udev-id-renaming

udev: cleanup for ID_RENAMING property

3 years agoMerge pull request #25142 from yuwata/network-fix-race-in-device-renaming-vs-dhcp
Luca Boccassi [Mon, 31 Oct 2022 20:01:57 +0000 (21:01 +0100)] 
Merge pull request #25142 from yuwata/network-fix-race-in-device-renaming-vs-dhcp

network,dhcp: fix theoretical race in device renaming

3 years agoMerge pull request #25166 from yuwata/network-router-preference
Luca Boccassi [Mon, 31 Oct 2022 19:59:36 +0000 (20:59 +0100)] 
Merge pull request #25166 from yuwata/network-router-preference

network: adjust route metric based on router preference

3 years agodocs/HACKING.md: clarify some portions
William Roberts [Tue, 25 Oct 2022 14:09:29 +0000 (09:09 -0500)] 
docs/HACKING.md: clarify some portions

Clarify portions of HACKING.md so folks don't spend as much time as I
did on it.

Signed-off-by: William Roberts <william.c.roberts@intel.com>