Commit Graph
54581 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 0c4f37f0fb 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.
2021-11-23 16:20:14 +01:00
Zbigniew Jędrzejewski-Szmek a33bc79b99 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.
2021-11-23 12:31:20 +01:00
Robert-L-Turner 6d5ea0f127 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)
2021-11-22 11:43:44 +00:00
Daan De Meyer f910926715 Merge pull request #21452 from vcaputo/mmap-cache-fd
mmap-cache: simplify MMapFileDescriptor-centric function signatures
2021-11-22 10:35:34 +01:00
Lennart Poettering 494876ce38 Merge pull request #21425 from keszybz/ppc64-fixes
Add base-filesystem defines for arm64/ppc64el/riscv64 and make build quiet again
2021-11-22 10:10:05 +01:00
Luca Boccassi 4792cc5f63 test runner: print time before/after tests
When a timeout occurs we actually can't see when the test started/stopped. Print the time.
2021-11-22 09:05:00 +00:00
Zbigniew Jędrzejewski-Szmek 0895e87348 analyze: fix printing config when there is no main config file
Since 8b8024f1c2 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.
2021-11-21 12:10:51 +00:00
Luca Boccassi 289a42304d Merge pull request #21432 from DaanDeMeyer/journal-trivial-fixes
Journal trivial fixes
2021-11-20 18:00:35 +00:00
Luca Boccassi 26bae8109d Merge pull request #21431 from DaanDeMeyer/issue-19799
journal: Limit the number of audit fields we add to a message
2021-11-20 17:58:51 +00:00
Lennart Poettering a50966416e nspawn: use FOREACH_STRING() more 2021-11-20 17:54:53 +00:00
Christian Göttsche 7e570d575f 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_`.
2021-11-20 16:38:03 +00:00
Christian Göttsche 963438a027 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`.
2021-11-20 16:38:03 +00:00
Christian Göttsche 6fbb33f631 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.
2021-11-20 16:38:03 +00:00
Christian Göttsche f0804759cf 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.
2021-11-20 16:38:03 +00:00
Vito Caputo c3bd54bf4f mmap-cache: s/mmap_cache/mmap_cache_fd_/ where apropos
Mostly mechanical renaming of mmap-cache functions that now
operate exclusively on the MMapFileDescriptor.
2021-11-19 13:43:00 -08:00
Vito Caputo 1da2c4ceeb 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.
2021-11-19 13:39:00 -08:00
Daan De Meyer 66e2bb282b 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
2021-11-19 18:50:59 +00:00
Zbigniew Jędrzejewski-Szmek c0fb66ec30 Add a trivial guard against using the same uuid twice 2021-11-19 18:49:46 +01:00
Zbigniew Jędrzejewski-Szmek a965a3191e shared/base-filesystem: use LIB_ARCH_TUPLE instead of string 2021-11-19 18:49:46 +01:00
Zbigniew Jędrzejewski-Szmek ba9ddcb8d6 Trivial style fixes 2021-11-19 18:49:46 +01:00
Zbigniew Jędrzejewski-Szmek 0ccc588c2f docs: document the partition UUID used by homed 2021-11-19 18:49:46 +01:00
Zbigniew Jędrzejewski-Szmek 91f658cc03 shared/gpt: fix bit-flip in LoongArch root partition UUID
4e76715489 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
2021-11-19 18:49:46 +01:00
Zbigniew Jędrzejewski-Szmek 00db9a114e 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.
2021-11-19 18:49:46 +01:00
Zbigniew Jędrzejewski-Szmek 16bcaebcfa shared/gpt: ARM_64 → ARM64
"arm64" is generally written without the underscore.
2021-11-19 18:49:46 +01:00
Zbigniew Jędrzejewski-Szmek 6b47cc9897 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
2021-11-19 18:49:46 +01:00
Zbigniew Jędrzejewski-Szmek a7f787d607 shared/gpt: add a macro to make the definitions a bit less onerous 2021-11-19 18:49:46 +01:00
Daan De Meyer 368a14b67b 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.
2021-11-19 17:12:29 +00:00
Daan De Meyer 363b2b9aaf journal: Add journal_file_object_to_string() 2021-11-19 17:12:27 +00:00
Daan De Meyer b92d1eba31 journal: Simplify definition of HEADER_INCOMPATIBLE_SUPPORTED 2021-11-19 17:06:57 +00:00
Daan De Meyer d164ac771e journal: Use more structured initialization 2021-11-19 17:06:57 +00:00
Daan De Meyer 86e68f3814 journal: Use size_t instead of unsigned for array sizes 2021-11-19 17:06:55 +00:00
Zbigniew Jędrzejewski-Szmek 086df29f35 shared/gpt: reorder arches alphabetically
It's just too annoying to add new ones otherwise.
2021-11-19 16:52:38 +01:00
Lennart Poettering 1ccfb792e4 update TODO 2021-11-19 15:40:08 +01:00
Lennart Poettering 49d5e4d0bb doc: rebreak boot loader spec 2021-11-19 15:40:08 +01:00
Zbigniew Jędrzejewski-Szmek 1aeb03798a 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
2021-11-19 15:30:08 +01:00
Zbigniew Jędrzejewski-Szmek fe037986c8 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.
2021-11-19 15:30:08 +01:00
Zbigniew Jędrzejewski-Szmek 996eaea547 shared/base-filesystem: m68k is 32-bit only 2021-11-19 15:30:08 +01:00
Zbigniew Jędrzejewski-Szmek 2db409ce22 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)
2021-11-19 15:30:08 +01:00
Zbigniew Jędrzejewski-Szmek 761e9382a0 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.
2021-11-19 15:30:08 +01:00
Zbigniew Jędrzejewski-Szmek e98157b975 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.
2021-11-19 15:30:08 +01:00
Zbigniew Jędrzejewski-Szmek dcc87c6800 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.
2021-11-19 15:30:08 +01:00
Zbigniew Jędrzejewski-Szmek 6f32005fd1 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.
2021-11-19 15:30:08 +01:00
Zbigniew Jędrzejewski-Szmek 60106de05a shared/gpt: drop outdated comment
C.f. 1fb2d8fcb6.
2021-11-19 15:30:08 +01:00
Lennart Poettering 14efbfd96d 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/
2021-11-19 15:10:37 +01:00
Zbigniew Jędrzejewski-Szmek e55ed6aa85 Merge pull request #21444 from poettering/gpt-test
tests: dump table of archs + wether gpt partition type exists
2021-11-19 15:08:36 +01:00
Daniel Maixner 324b410341 removed copyright 2021-11-19 13:39:01 +00:00
Lennart Poettering bab5077098 test-gpt: add test that shows for which archs we have GPT partition types 2021-11-19 11:23:36 +01:00
Lennart Poettering f6ec896bc1 gpt: make gpt_partition_type_uuid_from_string() return parameter optional 2021-11-19 11:23:36 +01:00
Lennart Poettering f85b12d6fd strv: make sure FOREACH_STRING() can be nested 2021-11-19 11:23:36 +01:00
Evgeny Vereshchagin 2fd1beb3e2 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
2021-11-19 08:52:28 +00:00