1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 14:55:37 +03:00
Commit Graph

54696 Commits

Author SHA1 Message Date
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
Zbigniew Jędrzejewski-Szmek
39c37ca2d2
Merge pull request #21436 from yuwata/network-bus-introspect
network: add --bus-introspect option
2021-11-19 09:42:46 +01:00
Thomas Blume
6e8791a042 systemd-coredump: allow setting external core size to infinity
Make it compatible to the ulimit setting: unlimited
2021-11-19 09:23:52 +01:00
Lennart Poettering
548614cc9a
Merge pull request #21420 from DaanDeMeyer/journal-enumerate-skip
journal: Skip over corrupt entry items in enumerate_data()
2021-11-19 09:23:17 +01:00
Lennart Poettering
5c9da90d1d
Merge pull request #21411 from poettering/homed-maximize
homed: add concept for "maximizing" home dirs
2021-11-19 09:22:11 +01:00
Yu Watanabe
cc0f820960
Merge pull request #21435 from yuwata/network-cleanups-for-alternative-names
network: cleanups for alternative names
2021-11-19 12:05:04 +09:00
Yu Watanabe
a72d2a7bca 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.
2021-11-19 12:04:42 +09:00
Lennart Poettering
9f5827e01c homectl: parse "min" and "max" as special disk size values 2021-11-19 00:05:53 +01:00
Lennart Poettering
41caad6fcc 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.)
2021-11-19 00:05:53 +01:00
Lennart Poettering
2b02eb0591 homework: also add logic for "maximizing" size of home 2021-11-19 00:05:53 +01:00
Lennart Poettering
34081f6be7 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
2021-11-19 00:05:53 +01:00
Lennart Poettering
5813fca61f 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.
2021-11-19 00:05:53 +01:00
Yu Watanabe
558434a4aa man: add new man page org.freedesktop.network1 2021-11-19 07:23:40 +09:00
Yu Watanabe
6b4c1c9f3c network: support --bus-introspect option 2021-11-19 06:50:02 +09:00
Yu Watanabe
6e194652b8 network: use BusObjectImplementation 2021-11-19 06:49:25 +09:00
Daan De Meyer
8a799bed4c 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().
2021-11-18 21:43:17 +00:00
Daan De Meyer
847c7ee8c3 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.
2021-11-18 21:43:17 +00:00
Daan De Meyer
5a94a2bf2b 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
2021-11-18 21:43:15 +00:00
Yu Watanabe
1b345c1e3b network: skip re-generating map from alternative names to link 2021-11-19 06:13:02 +09:00
Yu Watanabe
50df02a705 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.
2021-11-19 06:13:02 +09:00
Frantisek Sumsal
1285252823 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
2021-11-18 21:06:04 +00:00
Daan De Meyer
9c41618008 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.
2021-11-18 19:37:17 +00:00
Franck Bui
86bd939d7f TEST-12: make sure 'adm' group exist
'adm' group is not available on openSUSE.
2021-11-18 19:13:17 +00:00
Luca Boccassi
21d00e52db man/kernel-command-line: add reference to getty_auto variable
Follow-up for #21422
2021-11-18 15:29:43 +00:00
Luca Boccassi
26b2832992
Merge pull request #21424 from keszybz/json-double
Use double and int64_t types in json
2021-11-18 13:37:20 +00:00
Daan De Meyer
ceb4192df6 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.
2021-11-18 13:28:14 +00:00
Daan De Meyer
4cdb970b5b 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.
2021-11-18 13:28:08 +00:00
Luca Boccassi
ee3fddcc8a 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.
2021-11-18 10:38:48 +00:00
Lennart Poettering
3510cef8fa
Merge pull request #21401 from poettering/open-mkdir-at
add open_mkdir_at() helper and use it
2021-11-18 10:13:26 +01:00
Zbigniew Jędrzejewski-Szmek
e92777d275 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
2021-11-18 09:19:23 +01:00
Zbigniew Jędrzejewski-Szmek
718ca77232 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.
2021-11-18 01:34:31 +01:00
Zbigniew Jędrzejewski-Szmek
a810dd5c00 test-sizeof: add intmax types 2021-11-18 01:34:31 +01:00
Zbigniew Jędrzejewski-Szmek
337712e777 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.
2021-11-18 01:34:31 +01:00
dependabot[bot]
d59d6cc154 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](5581e08a65...a627e9fa50)

---
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>
2021-11-18 01:17:19 +03:00
Lennart Poettering
fe60b860a6
Merge pull request #21421 from poettering/homed-recovery-pw
homed: handle password changing for accounts that have recovery keys correctly
2021-11-17 21:55:31 +01:00
Lennart Poettering
96603ea076 tree-wide: port various places over to open_mkdir_at() 2021-11-17 21:48:29 +01:00