]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoresolved: add _unused_ annotations to appease clang 21479/head
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 13:35:33 +0000 (14:35 +0100)] 
resolved: add _unused_ annotations to appease clang

3 years agoshared/format-table: add cosmetic initialization
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 11:12:39 +0000 (12:12 +0100)] 
shared/format-table: add cosmetic initialization

p is unconditionally initialized below, but our coding style says that
initialization should be added anyway.

3 years agoresolved: inline declarations of iterator variables
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 11:30:46 +0000 (12:30 +0100)] 
resolved: inline declarations of iterator variables

3 years agoresolved: move packet rewinder initalization inline
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 11:30:30 +0000 (12:30 +0100)] 
resolved: move packet rewinder initalization inline

There is no functional change, but this reduces the risk that
in some future refactoring we'll forget the do the initialization in all
execution paths.

3 years agoudev/cdrom_id: use a macro to initialize context
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 11:13:56 +0000 (12:13 +0100)] 
udev/cdrom_id: use a macro to initialize context

c was initialized unconditionally, but one has to look at the function
body to understand this. Let's make the whole thing shorter and more
direct.

3 years agoFIDO2 device removal instructions (#21426)
Robert-L-Turner [Mon, 22 Nov 2021 11:43:44 +0000 (19:43 +0800)] 
FIDO2 device removal instructions (#21426)

* man: document FIDO2 device removal

Indicate to users how to remove FIDO2 device in the --fido2-device=path section by setting path to an empty string ("").  Tested on systemd 249 (249.6-3-arch)

3 years agoMerge pull request #21452 from vcaputo/mmap-cache-fd
Daan De Meyer [Mon, 22 Nov 2021 09:35:34 +0000 (10:35 +0100)] 
Merge pull request #21452 from vcaputo/mmap-cache-fd

mmap-cache: simplify MMapFileDescriptor-centric function signatures

3 years agoMerge pull request #21425 from keszybz/ppc64-fixes
Lennart Poettering [Mon, 22 Nov 2021 09:10:05 +0000 (10:10 +0100)] 
Merge pull request #21425 from keszybz/ppc64-fixes

Add base-filesystem defines for arm64/ppc64el/riscv64 and make build quiet again

3 years agotest runner: print time before/after tests
Luca Boccassi [Sat, 20 Nov 2021 00:44:13 +0000 (00:44 +0000)] 
test runner: print time before/after tests

When a timeout occurs we actually can't see when the test started/stopped. Print the time.

4 years agoanalyze: fix printing config when there is no main config file
Zbigniew Jędrzejewski-Szmek [Sat, 20 Nov 2021 10:42:31 +0000 (11:42 +0100)] 
analyze: fix printing config when there is no main config file

Since 8b8024f1c231c166f5c450905c8fd91d11704ae7 and the follow-up commits, the
main config file may be located in /usr or in other paths. But the code in
analyze.c was still assuming that it must be in /etc. Things mostly worked for
our own config files because we usually install a comments-only file in /etc,
but was not correct in the general case.

This fixes in particular 'systemd-analyze cat-config systemd/zram-generator.conf'.
In Fedora we distribute a config file in zram-generator-defaults.rpm that is in
/usr/lib, and 'cat-config' would refuse to show it because
/etc/systemd/zram-generator.conf does not exist.

The main config file is optional, but let's print an informative message
because this is a slightly unusual case.

The file paths that we printed were missing the root prefix.

4 years agoMerge pull request #21432 from DaanDeMeyer/journal-trivial-fixes
Luca Boccassi [Sat, 20 Nov 2021 18:00:35 +0000 (18:00 +0000)] 
Merge pull request #21432 from DaanDeMeyer/journal-trivial-fixes

Journal trivial fixes

4 years agoMerge pull request #21431 from DaanDeMeyer/issue-19799
Luca Boccassi [Sat, 20 Nov 2021 17:58:51 +0000 (17:58 +0000)] 
Merge pull request #21431 from DaanDeMeyer/issue-19799

journal: Limit the number of audit fields we add to a message

4 years agonspawn: use FOREACH_STRING() more
Lennart Poettering [Fri, 19 Nov 2021 14:48:01 +0000 (15:48 +0100)] 
nspawn: use FOREACH_STRING() more

4 years agocore: prefix functions to avoid identical static function names
Christian Göttsche [Fri, 19 Nov 2021 16:34:08 +0000 (17:34 +0100)] 
core: prefix functions to avoid identical static function names

The function name `method_reload` is used both in dbus-unit.c and
dbus-manager.c for static functions.
With the previous addition of adding the function name to the audit
information on SELinux denials, rename the one (and its relatives) in
dbus-unit.c as most of the functions in src/core/dbus-unit.c are already
prefixed with `bus_unit_`.

4 years agoselinux: name mac_selinux_generic_access_check as internal function
Christian Göttsche [Wed, 28 Jul 2021 15:00:02 +0000 (17:00 +0200)] 
selinux: name mac_selinux_generic_access_check as internal function

`mac_selinux_generic_access_check()` should not be called directly, only
via the wrapper macros `mac_selinux_access_check` and
`mac_selinux_unit_access_check`.

4 years agoselinux: improve debug log format
Christian Göttsche [Wed, 28 Jul 2021 14:59:57 +0000 (16:59 +0200)] 
selinux: improve debug log format

path might be NULL when checking against the system permissions, so wrap
with strna().

The command line might not be available over D-Bus and thus cl might be
empty. Print "n/a" instead of the empty string.

4 years agoselinux: add function name to audit data
Christian Göttsche [Wed, 28 Jul 2021 14:59:51 +0000 (16:59 +0200)] 
selinux: add function name to audit data

Include the systemd C function name in the audit message to improve the
debug ability on denials.
Similar like kernel denial messages include the syscall name.

4 years agommap-cache: s/mmap_cache/mmap_cache_fd_/ where apropos 21452/head
Vito Caputo [Wed, 17 Nov 2021 04:37:30 +0000 (20:37 -0800)] 
mmap-cache: s/mmap_cache/mmap_cache_fd_/ where apropos

Mostly mechanical renaming of mmap-cache functions that now
operate exclusively on the MMapFileDescriptor.

4 years agommap-cache: simplify API around MMapFileDescriptor
Vito Caputo [Wed, 17 Nov 2021 01:03:15 +0000 (17:03 -0800)] 
mmap-cache: simplify API around MMapFileDescriptor

MMapFileDescriptor carries a reference to its originating
MMapCache, there's no value in supplying the
MMapFileDescriptor-centric functions a separate MMapCache.

A future commit will rename these functions to consistently use
an mmap_cache_fd_* prefix for improved clarity.

4 years agojournal: Limit the number of audit fields per log message 21431/head
Daan De Meyer [Thu, 18 Nov 2021 12:37:04 +0000 (12:37 +0000)] 
journal: Limit the number of audit fields per log message

Similar to the kmsg handler, let's also limit the number of fields
we parse from audit messages.

Fixes #19799

4 years agoAdd a trivial guard against using the same uuid twice 21425/head
Zbigniew Jędrzejewski-Szmek [Fri, 19 Nov 2021 16:26:36 +0000 (17:26 +0100)] 
Add a trivial guard against using the same uuid twice

4 years agoshared/base-filesystem: use LIB_ARCH_TUPLE instead of string
Zbigniew Jędrzejewski-Szmek [Fri, 19 Nov 2021 16:02:09 +0000 (17:02 +0100)] 
shared/base-filesystem: use LIB_ARCH_TUPLE instead of string

4 years agoTrivial style fixes
Zbigniew Jędrzejewski-Szmek [Fri, 19 Nov 2021 15:34:17 +0000 (16:34 +0100)] 
Trivial style fixes

4 years agodocs: document the partition UUID used by homed
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 14:16:20 +0000 (15:16 +0100)] 
docs: document the partition UUID used by homed

4 years agoshared/gpt: fix bit-flip in LoongArch root partition UUID
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 14:15:55 +0000 (15:15 +0100)] 
shared/gpt: fix bit-flip in LoongArch root partition UUID

4e767154891083069a58c5c960f386974ad87fb4 added a slightly different UUID
in the header and in the docs. This makes the code match the docs.

> As some downstream projects are already using the UUID as in the docs, most
> notably util-linux [1], we should adjust code to match doc; no shipping
> LoongArch systems are using upstream systemd, and no open-source distro is
> merging LoongArch support yet, so the change should break no one. This also
> matches the work being done by @yetist at loongarch64/systemd#7.

[1] https://github.com/util-linux/util-linux/commit/2d29fccaad267d1b003dc0ed2bb9634ff76f3e49

4 years agodocs: generate table from header using a script
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 14:09:30 +0000 (15:09 +0100)] 
docs: generate table from header using a script

This adds a helper script:
$ python3 tools/list-discoverable-partitions.py <src/shared/gpt.h
<!-- generated with tools/list-discoverable-partitions.py -->
| Partition Type UUID | Name | Allowed File Systems | Explanation |
|---------------------|------|----------------------|-------------|
| _Root Partition (Alpha)_ | `6523f8ae-3eb1-4e2a-a05a-18b695ae656f` | [Root Partition] | [Root Partition more] |
| _Root Partition (ARC)_ | `d27f46ed-2919-4cb8-bd25-9531f3c16534` | ditto | ditto |
...

The output can be pasted into the markdown file. I think this works better than
trying to match the two lists by hand.

4 years agoshared/gpt: ARM_64 → ARM64
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 10:48:17 +0000 (11:48 +0100)] 
shared/gpt: ARM_64 → ARM64

"arm64" is generally written without the underscore.

4 years agoshared/gpt: add entries for a bunch of architectures
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 10:30:15 +0000 (11:30 +0100)] 
shared/gpt: add entries for a bunch of architectures

I don't think we want people to send us pull requests over the next two years.
Let's just make something up ourselves, this is going to have at least as good
results, and will be much quicker.

Note that this only includes architectures for which there's some indication
that they are in active use. In architecture.h there are some more esoteric
ones like ARC_BE. We can add those if there's some actual user demand.

In particular, I included everything on the Debian "List of official ports" [1]
and a few other arches that we have received patches for in recent times.

[1] https://www.debian.org/ports/#portlist-released

4 years agoshared/gpt: add a macro to make the definitions a bit less onerous
Zbigniew Jędrzejewski-Szmek [Fri, 19 Nov 2021 15:06:27 +0000 (16:06 +0100)] 
shared/gpt: add a macro to make the definitions a bit less onerous

4 years agojournal: Add verify_hash_table() 21432/head
Daan De Meyer [Tue, 16 Nov 2021 14:39:18 +0000 (14:39 +0000)] 
journal: Add verify_hash_table()

The existing verify_hash_table() function is renamed to
verify_data_hash_table() since it only verifies the data hash table.

The verify information is also made a little more detailed by splitting
one of the checks in two.

4 years agojournal: Add journal_file_object_to_string()
Daan De Meyer [Fri, 12 Nov 2021 11:17:01 +0000 (11:17 +0000)] 
journal: Add journal_file_object_to_string()

4 years agojournal: Simplify definition of HEADER_INCOMPATIBLE_SUPPORTED
Daan De Meyer [Mon, 15 Nov 2021 11:45:00 +0000 (11:45 +0000)] 
journal: Simplify definition of HEADER_INCOMPATIBLE_SUPPORTED

4 years agojournal: Use more structured initialization
Daan De Meyer [Thu, 11 Nov 2021 15:35:28 +0000 (15:35 +0000)] 
journal: Use more structured initialization

4 years agojournal: Use size_t instead of unsigned for array sizes
Daan De Meyer [Sun, 31 Oct 2021 12:33:40 +0000 (12:33 +0000)] 
journal: Use size_t instead of unsigned for array sizes

4 years agoshared/gpt: reorder arches alphabetically
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 10:00:56 +0000 (11:00 +0100)] 
shared/gpt: reorder arches alphabetically

It's just too annoying to add new ones otherwise.

4 years agoupdate TODO
Lennart Poettering [Fri, 19 Nov 2021 14:39:19 +0000 (15:39 +0100)] 
update TODO

4 years agodoc: rebreak boot loader spec
Lennart Poettering [Fri, 19 Nov 2021 14:39:32 +0000 (15:39 +0100)] 
doc: rebreak boot loader spec

4 years agodocs: switch the first two columns in partition uuid list
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 09:48:30 +0000 (10:48 +0100)] 
docs: switch the first two columns in partition uuid list

Readers are most likely to want to go from a partition id to the uuid,
so puts the uuid second

4 years agoshared/base-filesystem: add define for s390x
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 18:10:18 +0000 (19:10 +0100)] 
shared/base-filesystem: add define for s390x

This is based on the information in #14311 and
https://refspecs.linuxfoundation.org/LSB_3.2.0/LSB-Core-S390X/LSB-Core-S390X.pdf
and https://wiki.debian.org/Multiarch/Tuples.

Fixes #14311.

4 years agoshared/base-filesystem: m68k is 32-bit only
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 09:15:17 +0000 (10:15 +0100)] 
shared/base-filesystem: m68k is 32-bit only

4 years agoshared/base-filesystem: add define for arm
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 08:57:26 +0000 (09:57 +0100)] 
shared/base-filesystem: add define for arm

$ ls -l /lib /lib64
ls: cannot access '/lib64': No such file or directory
lrwxrwxrwx. 1 root root 7 Jan 26  2021 /lib -> usr/lib
$ ldd /bin/sh|grep ld
/lib/ld-linux-armhf.so.3 (0xb6f80000)

4 years agoshared/base-filesystem: add define for riscv64
Zbigniew Jędrzejewski-Szmek [Wed, 17 Nov 2021 14:10:20 +0000 (15:10 +0100)] 
shared/base-filesystem: add define for riscv64

https://wiki.debian.org/ArchitectureSpecificsMemo shows the triplet, but no the
linker paths. I used the linker path from Fedora.

$ ls -l /lib /lib64
lrwxrwxrwx. 1 root root 7 Aug 13  2020 /lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Aug 13  2020 /lib64 -> usr/lib64
$ ldd /bin/sh|grep ld
/lib/ld-linux-riscv64-lp64d.so.1 (0x0000003fb8185000)
$ ls -l /lib/ld-linux-riscv64-lp64d.so.1
lrwxrwxrwx 1 root root 19 Aug  4 19:28 /lib/ld-linux-riscv64-lp64d.so.1 -> ../lib64/ld-2.32.so

$ uname -r
5.10.6+

So even though the canonical linker path uses /lib/, we need the /lib64 symlink
to be present.

4 years agoshared/base-filesystem: add define for ppc64el
Zbigniew Jędrzejewski-Szmek [Wed, 17 Nov 2021 14:01:18 +0000 (15:01 +0100)] 
shared/base-filesystem: add define for ppc64el

https://wiki.debian.org/ArchitectureSpecificsMemo shows the triplet, but no the
linker paths. I used the linker path from Fedora, but I can't look up the
linker paths for BE and 32 bit. At least the ifdef scaffolding is provided, so
it should be trivial to fill in if somebody has access to such a system.

$ ls -l /lib /lib64
lrwxrwxrwx. 1 root root 7 Jan 26  2021 /lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Jan 26  2021 /lib64 -> usr/lib64
$ ldd /bin/sh|grep ld
/lib64/ld64.so.2 (0x00007fffa0a90000)
$ uname -r
5.14.9-200.fc34.ppc64le

Note that the macro defines listed in the wiki page don't match what I get
on Fedora: __PPC64__ vs. __ppc64__.

$ cpp -dM < /dev/null |grep -iE '__(powerpc|ppc)'|sort
 #define __powerpc__ 1
 #define __powerpc64__ 1
 #define __PPC__ 1
 #define __PPC64__ 1

First half of the fix for #14311.

4 years agoshared/base-filesystem: add define for arm64
Zbigniew Jędrzejewski-Szmek [Wed, 17 Nov 2021 13:51:39 +0000 (14:51 +0100)] 
shared/base-filesystem: add define for arm64

https://wiki.debian.org/ArchitectureSpecificsMemo:
> arm64 aarch64-linux-gnu 64 AARCH64 /lib/ld-linux-aarch64.so.1 aarch64 aarch64

Fedora:
$ ls -l /lib /lib64
lrwxrwxrwx. 1 root root 7 Jul 27  2020 /lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Jul 27  2020 /lib64 -> usr/lib64
$ ldd /bin/sh|grep ld
/lib/ld-linux-aarch64.so.1 (0x0000ffff8c905000)
$ ls -l /lib/ld-linux-aarch64.so.1 /lib64/ld-2.32.so
lrwxrwxrwx. 1 root root     19 Jul 13 07:28 /lib/ld-linux-aarch64.so.1 -> ../lib64/ld-2.32.so
-rwxr-xr-x. 1 root root 961248 Jul 13 07:56 /lib64/ld-2.32.so

$ uname -r
5.14.16-101.fc33.aarch64

So we need both /lib and /lib64 to be present, even though the canonical linker
path uses /lib.

4 years agoshared/base-filesystem: add (empty) iffdery for the table
Zbigniew Jędrzejewski-Szmek [Wed, 17 Nov 2021 13:43:02 +0000 (14:43 +0100)] 
shared/base-filesystem: add (empty) iffdery for the table

I think this is going to be very annoying for our downstream maintainers.
Let's at least provide the ifdef scaffolding so that only filling in the
actual entries remains. The structure is copied from missing_syscall.h.

4 years agoshared/gpt: drop outdated comment
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 09:39:21 +0000 (10:39 +0100)] 
shared/gpt: drop outdated comment

C.f. 1fb2d8fcb69bcdbab0a5dd23bbf02f729e47e656.

4 years agodocs: clarify the assumption on numeric values of JSON parsers we make
Lennart Poettering [Fri, 12 Nov 2021 09:17:07 +0000 (10:17 +0100)] 
docs: clarify the assumption on numeric values of JSON parsers we make

Prompted by:

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/BOBD6KVTXPR6K5ANAX6LIJLKNSGXCR3B/

4 years agoMerge pull request #21444 from poettering/gpt-test
Zbigniew Jędrzejewski-Szmek [Fri, 19 Nov 2021 14:08:36 +0000 (15:08 +0100)] 
Merge pull request #21444 from poettering/gpt-test

tests: dump table of archs + wether gpt partition type exists

4 years agoremoved copyright
Daniel Maixner [Fri, 19 Nov 2021 12:44:35 +0000 (13:44 +0100)] 
removed copyright

4 years agotest-gpt: add test that shows for which archs we have GPT partition types 21444/head
Lennart Poettering [Fri, 19 Nov 2021 10:23:06 +0000 (11:23 +0100)] 
test-gpt: add test that shows for which archs we have GPT partition types

4 years agogpt: make gpt_partition_type_uuid_from_string() return parameter optional
Lennart Poettering [Fri, 19 Nov 2021 10:22:58 +0000 (11:22 +0100)] 
gpt: make gpt_partition_type_uuid_from_string() return parameter optional

4 years agostrv: make sure FOREACH_STRING() can be nested
Lennart Poettering [Fri, 19 Nov 2021 10:22:44 +0000 (11:22 +0100)] 
strv: make sure FOREACH_STRING() can be nested

4 years agooss-fuzz: move apt-gets and pips to the systemd repository
Evgeny Vereshchagin [Wed, 17 Nov 2021 08:47:29 +0000 (08:47 +0000)] 
oss-fuzz: move apt-gets and pips to the systemd repository

to be able to control our dependencies right here without
sending PRs like https://github.com/google/oss-fuzz/pull/5199 and
https://github.com/google/oss-fuzz/pull/5601.

It should also allow us to pin meson to let Dependabot keep track of
it and jump from one version to another without breaking anything

4 years agoMerge pull request #21436 from yuwata/network-bus-introspect
Zbigniew Jędrzejewski-Szmek [Fri, 19 Nov 2021 08:42:46 +0000 (09:42 +0100)] 
Merge pull request #21436 from yuwata/network-bus-introspect

network: add --bus-introspect option

4 years agosystemd-coredump: allow setting external core size to infinity
Thomas Blume [Mon, 15 Nov 2021 09:11:44 +0000 (10:11 +0100)] 
systemd-coredump: allow setting external core size to infinity

Make it compatible to the ulimit setting: unlimited

4 years agoMerge pull request #21420 from DaanDeMeyer/journal-enumerate-skip
Lennart Poettering [Fri, 19 Nov 2021 08:23:17 +0000 (09:23 +0100)] 
Merge pull request #21420 from DaanDeMeyer/journal-enumerate-skip

journal: Skip over corrupt entry items in enumerate_data()

4 years agoMerge pull request #21411 from poettering/homed-maximize
Lennart Poettering [Fri, 19 Nov 2021 08:22:11 +0000 (09:22 +0100)] 
Merge pull request #21411 from poettering/homed-maximize

homed: add concept for "maximizing" home dirs

4 years agoMerge pull request #21435 from yuwata/network-cleanups-for-alternative-names
Yu Watanabe [Fri, 19 Nov 2021 03:05:04 +0000 (12:05 +0900)] 
Merge pull request #21435 from yuwata/network-cleanups-for-alternative-names

network: cleanups for alternative names

4 years agonetwork: always try to reconfigure when carrier gained
Yu Watanabe [Thu, 18 Nov 2021 20:12:35 +0000 (05:12 +0900)] 
network: always try to reconfigure when carrier gained

When networkd detects a wlan interface, the interface may not be
connected to any access point, and may enter the unmanaged state.
After the interface connected to an access point, previously networkd
did not reconfigure the interface. This fixes the issue.

4 years agohomectl: parse "min" and "max" as special disk size values 21411/head
Lennart Poettering [Fri, 29 Oct 2021 12:34:24 +0000 (14:34 +0200)] 
homectl: parse "min" and "max" as special disk size values

4 years agotest: extend homed test to test home dir "maximization"
Lennart Poettering [Wed, 17 Nov 2021 09:22:20 +0000 (10:22 +0100)] 
test: extend homed test to test home dir "maximization"

This moves the backing store to a separate tmpfs which we can nicely put
a size limit on to make sure we can test maximization sanely: if we ask
for the home dir to be grown really large it should effectively only be
grown until the size of the backing tmpfs.

(While we are at it, also set a cheaper KDF so that we don't waste CI
cycles for password hashing that aren#t secure anyway.)

4 years agohomework: also add logic for "maximizing" size of home
Lennart Poettering [Fri, 29 Oct 2021 10:21:41 +0000 (12:21 +0200)] 
homework: also add logic for "maximizing" size of home

4 years agohomework: make it safe to invoke home_setup_luks() twice in a row
Lennart Poettering [Fri, 29 Oct 2021 08:13:25 +0000 (10:13 +0200)] 
homework: make it safe to invoke home_setup_luks() twice in a row

Being able to invoke the call twice on the same HomeSetup object will
simplify auto-growing/auto-shrinking since we can issue a resize
operatio directly from activate/deactivate

4 years agohomework: make destroying of HomeSetup optional when resizing
Lennart Poettering [Fri, 29 Oct 2021 07:59:35 +0000 (09:59 +0200)] 
homework: make destroying of HomeSetup optional when resizing

This will be useful when we want to issue a resize operation right when
activating, where the HomeSetup object should be destroyed only after
both activation is done.

4 years agoman: add new man page org.freedesktop.network1 21436/head
Yu Watanabe [Thu, 18 Nov 2021 22:23:40 +0000 (07:23 +0900)] 
man: add new man page org.freedesktop.network1

4 years agonetwork: support --bus-introspect option
Yu Watanabe [Thu, 18 Nov 2021 21:49:50 +0000 (06:49 +0900)] 
network: support --bus-introspect option

4 years agonetwork: use BusObjectImplementation
Yu Watanabe [Thu, 18 Nov 2021 21:49:25 +0000 (06:49 +0900)] 
network: use BusObjectImplementation

4 years agojournal: Skip corrupt Data objects in sd_journal_get_data() 21420/head
Daan De Meyer [Wed, 17 Nov 2021 16:46:29 +0000 (16:46 +0000)] 
journal: Skip corrupt Data objects in sd_journal_get_data()

Similar to the change we made for sd_journal_enumerate_data(), let's
skip corrupt entry items and data objects in sd_journal_get_data().

4 years agojournal: Use separate variable for Data object in sd_journal_get_data()
Daan De Meyer [Wed, 17 Nov 2021 16:44:21 +0000 (16:44 +0000)] 
journal: Use separate variable for Data object in sd_journal_get_data()

A little cleanup to make the next change easier. We're not moving to a
new Entry object in the for loop so there's no danger of changing the
Entry object window.

4 years agojournal: Skip over corrupt entry items in enumerate_data()
Daan De Meyer [Wed, 17 Nov 2021 15:54:35 +0000 (15:54 +0000)] 
journal: Skip over corrupt entry items in enumerate_data()

Similar to sd_journal_next(), if trying to access an entry item
offset's data results in EBADMSG, skip to the next entry item so
we handle corruption better.

Fixes #21407

4 years agonetwork: skip re-generating map from alternative names to link 21435/head
Yu Watanabe [Thu, 18 Nov 2021 21:01:45 +0000 (06:01 +0900)] 
network: skip re-generating map from alternative names to link

4 years agonetwork: do not clear map from alternative names to link when IFLA_PROP_LIST attribut...
Yu Watanabe [Thu, 18 Nov 2021 20:36:44 +0000 (05:36 +0900)] 
network: do not clear map from alternative names to link when IFLA_PROP_LIST attribute is not contained

No IFLA_PROP_LIST attribute contained does not means the interface
has no alternative name.
E.g. the message created by inet6_fill_ifinfo() in net/ipv6/addrconf.c
does not contain IFLA_PROP_LIST.

4 years agotest: make the diff regex BRE-compatible
Frantisek Sumsal [Thu, 18 Nov 2021 16:19:03 +0000 (17:19 +0100)] 
test: make the diff regex BRE-compatible

Since the GNU `diff` utility uses grep-style regular expressions[0], which
use the BRE style, we need to tweak the regex to make it work properly
(most notably - in BRE the meta characters need to be escaped).

```
$ diff a b
21c21
<   Volume Key: 256bit
---
>   Volume Key: 257bit
25c25
< Disk Ceiling: 323.2M
---
> Disk Ceiling: 323.1M

$ diff -I '^\s*Disk (Size|Free|Floor|Ceiling):' a b
21c21
<   Volume Key: 256bit
---
>   Volume Key: 257bit
25c25
< Disk Ceiling: 323.2M
---
> Disk Ceiling: 323.1M

$ diff -I '^\s*Disk \(Size\|Free\|Floor\|Ceiling\):' a b && echo OK
21c21
<   Volume Key: 256bit
---
>   Volume Key: 257bit
```

Caught in one of the nightly CentOS CI cron jobs.

[0] https://www.gnu.org/software/diffutils/manual/html_node/Specified-Lines.html

4 years agojournal: Don't discard kmsg messages coming from journald itself
Daan De Meyer [Mon, 11 Oct 2021 13:05:08 +0000 (14:05 +0100)] 
journal: Don't discard kmsg messages coming from journald itself

Previously, we discarded any kmsg messages coming from journald
itself to avoid infinite loops where potentially the processing
of a kmsg message causes journald to log one or more messages to
kmsg which then get read again by the kmsg handler, ...

However, if we completely disable logging whenever we're processing
a kmsg message coming from journald itself, we also prevent any
infinite loops as we can be sure that journald won't accidentally
generate logging messages while processing a kmsg log message.

This change allows us to store all journald logs generated during
the processing of log messages from other services in the system
journal. Previously these could only be found in kmsg which has
low retention, can't be queried using journalctl and whose logs
don't survive reboots.

4 years agoTEST-12: make sure 'adm' group exist
Franck Bui [Thu, 18 Nov 2021 10:56:02 +0000 (11:56 +0100)] 
TEST-12: make sure 'adm' group exist

'adm' group is not available on openSUSE.

4 years agoman/kernel-command-line: add reference to getty_auto variable
Luca Boccassi [Thu, 18 Nov 2021 13:09:20 +0000 (13:09 +0000)] 
man/kernel-command-line: add reference to getty_auto variable

Follow-up for #21422

4 years agoMerge pull request #21424 from keszybz/json-double
Luca Boccassi [Thu, 18 Nov 2021 13:37:20 +0000 (13:37 +0000)] 
Merge pull request #21424 from keszybz/json-double

Use double and int64_t types in json

4 years agojournal: Use mf as variable name for MapField
Daan De Meyer [Thu, 18 Nov 2021 12:28:07 +0000 (12:28 +0000)] 
journal: Use mf as variable name for MapField

So we can have a variable m for the max iovec size in the next
commit like we do in the rest of the journal logic.

4 years agojournal: Use consistent naming for iovec in audit logic
Daan De Meyer [Thu, 18 Nov 2021 12:25:27 +0000 (12:25 +0000)] 
journal: Use consistent naming for iovec in audit logic

Let's use iovec and n for the iovec variable and it's size just like
we do in the rest of the journal code.

4 years agogetty-generator: add kernel cmdline and env vars to disable it
Luca Boccassi [Wed, 17 Nov 2021 17:28:54 +0000 (17:28 +0000)] 
getty-generator: add kernel cmdline and env vars to disable it

systemd.getty_auto/rd.systemd.getty_auto/SYSTEMD_GETTY_AUTO can be used
to disable the generator. Enabled by default.

4 years agoMerge pull request #21401 from poettering/open-mkdir-at
Lennart Poettering [Thu, 18 Nov 2021 09:13:26 +0000 (10:13 +0100)] 
Merge pull request #21401 from poettering/open-mkdir-at

add open_mkdir_at() helper and use it

4 years agomeson: add check:true/false to all run_command() invocations
Zbigniew Jędrzejewski-Szmek [Wed, 17 Nov 2021 12:58:53 +0000 (13:58 +0100)] 
meson: add check:true/false to all run_command() invocations

meson-0.59.4-1.fc35.noarch says:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300

4 years agoshared/json: use int64_t instead of intmax_t 21424/head
Zbigniew Jędrzejewski-Szmek [Wed, 17 Nov 2021 22:24:49 +0000 (23:24 +0100)] 
shared/json: use int64_t instead of intmax_t

We were already asserting that the intmax_t and uintmax_t types
are the same as int64_t and uint64_t. Pretty much everywhere in
the code base we use the latter types. In principle intmax_t could
be something different on some new architecture, and then the code would
fail to compile or behave differently. We actually do not want the code
to behave differently on those architectures, because that'd break
interoperability. So let's just use int64_t/uint64_t since that's what
we indend to use.

4 years agotest-sizeof: add intmax types
Zbigniew Jędrzejewski-Szmek [Wed, 17 Nov 2021 22:27:59 +0000 (23:27 +0100)] 
test-sizeof: add intmax types

4 years agoshared/json: stop using long double
Zbigniew Jędrzejewski-Szmek [Wed, 17 Nov 2021 17:04:13 +0000 (18:04 +0100)] 
shared/json: stop using long double

It seems that the implementation of long double on ppc64el doesn't really work:
long double cast to integer and back compares as unequal to itself. Strangely,
this effect happens without optimization and both with gcc and clang, so it
seems to be an effect of how long double is implemented by the architecture.

Dumping the values shows the following pattern:
00 00 00 00 00 00 24 40  00 00 00 00 00 00 00 00   # long double v = 10;
00 00 00 00 00 00 24 40  00 00 00 00 00 00 80 39   # (long double)(intmax_t) v

Instead of trying to make this work, I think it's most reasonable to switch to
normal doubles. Notably, we had no tests for floating point behaviour. The
first test we added (for values even not in the range outside of double),
showed failures.

Common implementations of JSON (in particular JavaScript) use 64 bit double.
If we stick to this, users are likely to be happy when they exchange data with
those tools. Exporting values that cannot be represented in other tools would
just cause interop problems.

I don't think the extra precision would be much used. Long double seems to make
most sense as a transient format used in calculations to get extra precision in
operations, and not a storage or exchange format. So I expect low-level
numerical routines that have to know about hardware to make use of it, but it
shouldn't be used by our (higher-level) system library. In particular, we would
have to add tests for implementations conforming to IEEE 754, and those that
don't conform, and account for various implementation differences. It just
doesn't seem worth the effort.

https://en.wikipedia.org/wiki/Long_double#Implementations shows that the
situation is "complicated":

> On the x86 architecture, most C compilers implement long double as the 80-bit
> extended precision type supported by x86 hardware. An exception is Microsoft
> Visual C++ for x86, which makes long double a synonym for double. The Intel
> C++ compiler on Microsoft Windows supports extended precision, but requires
> the /Qlong‑double switch for long double to correspond to the hardware's
> extended precision format.

> Compilers may also use long double for the IEEE 754 quadruple-precision
> binary floating-point format (binary128). This is the case on HP-UX,
> Solaris/SPARC, MIPS with the 64-bit or n32 ABI, 64-bit ARM (AArch64) (on
> operating systems using the standard AAPCS calling conventions, such as
> Linux), and z/OS with FLOAT(IEEE). Most implementations are in software, but
> some processors have hardware support.

> On some PowerPC and SPARCv9 machines, long double is implemented as a
> double-double arithmetic, where a long double value is regarded as the exact
> sum of two double-precision values, giving at least a 106-bit precision; with
> such a format, the long double type does not conform to the IEEE
> floating-point standard. Otherwise, long double is simply a synonym for
> double (double precision), e.g. on 32-bit ARM, 64-bit ARM (AArch64) (on
> Windows and macOS) and on 32-bit MIPS (old ABI, a.k.a. o32).

> With the GNU C Compiler, long double is 80-bit extended precision on x86
> processors regardless of the physical storage used for the type (which can be
> either 96 or 128 bits). On some other architectures, long double can be
> double-double (e.g. on PowerPC) or 128-bit quadruple precision (e.g. on
> SPARC). As of gcc 4.3, a quadruple precision is also supported on x86, but as
> the nonstandard type __float128 rather than long double.

> Although the x86 architecture, and specifically the x87 floating-point
> instructions on x86, supports 80-bit extended-precision operations, it is
> possible to configure the processor to automatically round operations to
> double (or even single) precision. Conversely, in extended-precision mode,
> extended precision may be used for intermediate compiler-generated
> calculations even when the final results are stored at a lower precision
> (i.e. FLT_EVAL_METHOD == 2). With gcc on Linux, 80-bit extended precision is
> the default; on several BSD operating systems (FreeBSD and OpenBSD),
> double-precision mode is the default, and long double operations are
> effectively reduced to double precision. (NetBSD 7.0 and later, however,
> defaults to 80-bit extended precision). However, it is possible to override
> this within an individual program via the FLDCW "floating-point load
> control-word" instruction. On x86_64, the BSDs default to 80-bit extended
> precision. Microsoft Windows with Visual C++ also sets the processor in
> double-precision mode by default, but this can again be overridden within an
> individual program (e.g. by the _controlfp_s function in Visual C++). The
> Intel C++ Compiler for x86, on the other hand, enables extended-precision
> mode by default. On IA-32 OS X, long double is 80-bit extended precision.

So, in short, the only thing that can be said is that nothing can be said. In
common scenarios, we are getting only a bit of extra precision (80 bits instead
of 64), but use space for padding. In other scenarios we are getting no extra
precision. And the variance in implementations is a big issue: we can expect
strange differences in behaviour between architectures, systems, compiler
versions, compilation options, and even the other things that the program is
doing.

Fixes #21390.

4 years agobuild(deps): bump github/codeql-action from 1.0.22 to 1.0.23
dependabot[bot] [Wed, 17 Nov 2021 10:15:28 +0000 (10:15 +0000)] 
build(deps): bump github/codeql-action from 1.0.22 to 1.0.23

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.22 to 1.0.23.
- [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/5581e08a65fc3811c3ac78939dd59e7a8adbf003...a627e9fa504113bfa8e90a9b429b157a38b1cdbd)

---
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>
4 years agoMerge pull request #21421 from poettering/homed-recovery-pw
Lennart Poettering [Wed, 17 Nov 2021 20:55:31 +0000 (21:55 +0100)] 
Merge pull request #21421 from poettering/homed-recovery-pw

homed: handle password changing for accounts that have recovery keys correctly

4 years agotree-wide: port various places over to open_mkdir_at() 21401/head
Lennart Poettering [Tue, 16 Nov 2021 14:24:07 +0000 (15:24 +0100)] 
tree-wide: port various places over to open_mkdir_at()

4 years agofs-util: add new helper open_mkdir_at()
Lennart Poettering [Tue, 16 Nov 2021 14:23:29 +0000 (15:23 +0100)] 
fs-util: add new helper open_mkdir_at()

4 years agohwdb: voidify call to mkdir_parents_label
Luca Boccassi [Wed, 17 Nov 2021 14:08:52 +0000 (14:08 +0000)] 
hwdb: voidify call to mkdir_parents_label

CID#1466060

4 years agopam_systemd_home: prompt user for recovery key if homed asks for it 21421/head
Lennart Poettering [Wed, 17 Nov 2021 16:45:21 +0000 (17:45 +0100)] 
pam_systemd_home: prompt user for recovery key if homed asks for it

For accoutns that have no passwords but only a recovery key homed might
ask explicitly for that. Honour the request and ask the user for it.

4 years agohomectl: if homed asks for the recovery key to be supplied, query the user for it
Lennart Poettering [Wed, 17 Nov 2021 16:42:12 +0000 (17:42 +0100)] 
homectl: if homed asks for the recovery key to be supplied, query the user for it

Fixes: #21103
4 years agoci: switch to weekly dependabot updates
Evgeny Vereshchagin [Tue, 16 Nov 2021 12:09:14 +0000 (12:09 +0000)] 
ci: switch to weekly dependabot updates

Apparently some dependencies get updated much more often
than I would have exepected.

It can always be triggered manually at https://github.com/systemd/systemd/network/dependencies
if there are any urgent updates

4 years agobuild(deps): bump github/super-linter from 4.8.3 to 4.8.4
dependabot[bot] [Wed, 17 Nov 2021 09:21:30 +0000 (09:21 +0000)] 
build(deps): bump github/super-linter from 4.8.3 to 4.8.4

Bumps [github/super-linter](https://github.com/github/super-linter) from 4.8.3 to 4.8.4.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/7d5dc989c55aaba9d3b7194a7496cdfaa4866af3...563be7dc5568017515b9e700329e9c6d3862f2b7)

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

Signed-off-by: dependabot[bot] <support@github.com>
4 years agoCONTAINER_INTERFACE: clarify that /proc/sys can be writable with namespacing
Luca Boccassi [Tue, 16 Nov 2021 22:44:06 +0000 (22:44 +0000)] 
CONTAINER_INTERFACE: clarify that /proc/sys can be writable with namespacing

When user and network namespaces are enabled, the kernel
makes the global keys read-only, and makes the namespaced
ones available for the guest already.

4 years agoci: run codeql on PRs from Dependabot
Evgeny Vereshchagin [Tue, 16 Nov 2021 10:46:16 +0000 (10:46 +0000)] 
ci: run codeql on PRs from Dependabot

To make sure PRs like https://github.com/systemd/systemd/pull/21409
don't break anything.

4 years agoMerge pull request #21406 from yuwata/test-network-debug-udev
Frantisek Sumsal [Wed, 17 Nov 2021 08:39:32 +0000 (08:39 +0000)] 
Merge pull request #21406 from yuwata/test-network-debug-udev

test-network: check alternative name

4 years agotest-network: check if actually alternative name is set 21406/head
Yu Watanabe [Wed, 17 Nov 2021 03:56:06 +0000 (12:56 +0900)] 
test-network: check if actually alternative name is set

Fixes #21404.

4 years agotest-network: make udevd also generate debugging logs
Yu Watanabe [Tue, 16 Nov 2021 23:32:45 +0000 (08:32 +0900)] 
test-network: make udevd also generate debugging logs

4 years agonetwork: accept all values provided by kernel
Yu Watanabe [Tue, 16 Nov 2021 13:50:35 +0000 (22:50 +0900)] 
network: accept all values provided by kernel

Follow-up for af493fb742bece2cafcdbab9238c711ac9090c9f.

The kernel sends FRA_SUPPRESS_IFGROUP attribute with -1, that must be
handled by networkd.

For FRA_SUPPRESS_PREFIXLEN, we already handled -1, but ignored values
larger than 128. We should not configure rules with such a meaningless
value, but should manage such rules when received from kernel. It can
occur when created by other tools mistakenly. If networkd ignores them,
then networkd cannot remove them.