]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 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

2 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

2 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

2 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()

2 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

2 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

2 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.

2 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

2 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.)

2 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

2 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

2 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.

2 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

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

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

2 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().

2 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.

2 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

2 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

2 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.

2 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

2 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.

2 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.

2 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

2 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

2 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.

2 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

2 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

2 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.

2 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

2 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.

2 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>
2 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

2 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()

2 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()

2 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

2 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.

2 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
2 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

2 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>
2 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.

2 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.

2 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

2 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.

2 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

2 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.

2 years agoMerge pull request #21326 from poettering/mkdir-tweaks
Lennart Poettering [Tue, 16 Nov 2021 21:55:11 +0000 (22:55 +0100)] 
Merge pull request #21326 from poettering/mkdir-tweaks

various tweaks to mkdir code

2 years agoMerge pull request #21391 from poettering/homed-minimize
Lennart Poettering [Tue, 16 Nov 2021 21:53:24 +0000 (22:53 +0100)] 
Merge pull request #21391 from poettering/homed-minimize

homed: add ability to "minimize" home dirs, i.e. shrink to smallest possible size

2 years agocoredump: tweak which dir we create
Lennart Poettering [Tue, 16 Nov 2021 14:24:25 +0000 (15:24 +0100)] 
coredump: tweak which dir we create

2 years agotree-wide: use WRITE_STRING_FILE_MKDIR_0755 at more places
Lennart Poettering [Tue, 16 Nov 2021 14:25:02 +0000 (15:25 +0100)] 
tree-wide: use WRITE_STRING_FILE_MKDIR_0755 at more places

2 years agoMerge pull request #21392 from keszybz/memleak-fix-and-assorted-fs-code-cleanups
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 17:57:04 +0000 (18:57 +0100)] 
Merge pull request #21392 from keszybz/memleak-fix-and-assorted-fs-code-cleanups

Memleak fix and assorted fs code cleanups

2 years agotest: add grow/shrink/minimize test for homed 21391/head
Lennart Poettering [Tue, 16 Nov 2021 09:51:35 +0000 (10:51 +0100)] 
test: add grow/shrink/minimize test for homed

Let's add testing for the stuff we just added.

2 years agohomework: beef up luks resize logic to allow "minimizing" homes
Lennart Poettering [Fri, 29 Oct 2021 07:58:53 +0000 (09:58 +0200)] 
homework: beef up luks resize logic to allow "minimizing" homes

2 years agouser-record: relax rules on diskSize user record field
Lennart Poettering [Thu, 28 Oct 2021 18:16:42 +0000 (20:16 +0200)] 
user-record: relax rules on diskSize user record field

Let's not refuse low or high disk sizes unnecessarily early. They disk
sizes are subject fs limits anyway, hence there's no point in adding
another limit.

Relaxing thhe rules here as the advantage that we can later allow
"homectl resize lennart 0" as a generic way to minimize disk space.

2 years agoresize-fs: add helper that checks if the specified fs can do online grow/shrink
Lennart Poettering [Fri, 15 Oct 2021 15:53:48 +0000 (17:53 +0200)] 
resize-fs: add helper that checks if the specified fs can do online grow/shrink

There's only one that can do this (btrfs), but let's abstract that fact,
a bit in case the other file systems learn this too one day.

2 years agohomework: make sync of identies when resizing homes optional
Lennart Poettering [Wed, 13 Oct 2021 15:43:11 +0000 (17:43 +0200)] 
homework: make sync of identies when resizing homes optional

This is preparation for resizing automatically at login and logout.

2 years agoshared: clean up mkdir.h/label.h situation 21326/head
Lennart Poettering [Fri, 12 Nov 2021 14:44:50 +0000 (15:44 +0100)] 
shared: clean up mkdir.h/label.h situation

Previously the mkdir_label() family of calls was implemented in
src/shared/mkdir-label.c but its functions partly declared ins
src/shared/label.h and partly in src/basic/mkdir.h (!!). That's weird
(and wrong).

Let's clean this up, and add a proper mkdir-label.h matching the .c
file.

2 years agomkdir: drop mkdir_errno_wrapper(), use mkdirat_errno_wrapper() instead
Lennart Poettering [Fri, 12 Nov 2021 14:18:06 +0000 (15:18 +0100)] 
mkdir: drop mkdir_errno_wrapper(), use mkdirat_errno_wrapper() instead

Let's reduce our code duplication, and let's focus on using xyzat()
style APIs more, hence drop mkdir_errno_wrapper() and stick to
mkdirar_errno_wrapper() wherever we can, it's a true superset of
functionality after all.

2 years agotree-wide: don't use mkdir_errno_wrapper() without reason
Lennart Poettering [Fri, 12 Nov 2021 14:16:19 +0000 (15:16 +0100)] 
tree-wide: don't use mkdir_errno_wrapper() without reason

Simple mkdir() is fine, too, no need to use the wrapper

2 years agomkdir-label: make mkdir_label() a wrapper around mkdirat_label()
Lennart Poettering [Fri, 12 Nov 2021 14:14:52 +0000 (15:14 +0100)] 
mkdir-label: make mkdir_label() a wrapper around mkdirat_label()

2 years agosysext: fix tmpfs mount source
Lennart Poettering [Tue, 16 Nov 2021 14:24:38 +0000 (15:24 +0100)] 
sysext: fix tmpfs mount source

It's "sysext", not "sysexit".

The string passed here is pure decoration, and noone will see it, since
it's only in our private mount namespace. But still, it's a typo, let's
fix it

2 years agoselinux: make mac_selinux_create_file_prepare() at wrapper around _at()
Lennart Poettering [Fri, 12 Nov 2021 14:13:37 +0000 (15:13 +0100)] 
selinux: make mac_selinux_create_file_prepare() at wrapper around _at()

Let's make sure mac_selinux_create_file_prepare_at() works fine with
AT_FDCWD, and then make mac_selinux_create_file_prepare() just a inline
wrapper around it.

2 years agosmack make mac_smack_fix_at() useful when called with dir_fd=AT_FDCWD
Lennart Poettering [Fri, 12 Nov 2021 14:12:23 +0000 (15:12 +0100)] 
smack make mac_smack_fix_at() useful when called with dir_fd=AT_FDCWD

2 years agomkdir: use chase_symlinks_and_stat() where appropriate
Lennart Poettering [Fri, 12 Nov 2021 13:49:49 +0000 (14:49 +0100)] 
mkdir: use chase_symlinks_and_stat() where appropriate

2 years agomkdir: make sure mode is set
Lennart Poettering [Fri, 12 Nov 2021 13:49:34 +0000 (14:49 +0100)] 
mkdir: make sure mode is set

2 years agomkdir: tighten permission check
Lennart Poettering [Fri, 12 Nov 2021 13:48:52 +0000 (14:48 +0100)] 
mkdir: tighten permission check

Let's complain about any bit that is set in the existing inode but no in
the mask we are supposed to use.

2 years agoTEST-08: don't force ext4 for /
Franck Bui [Tue, 16 Nov 2021 08:28:41 +0000 (09:28 +0100)] 
TEST-08: don't force ext4 for /

Forcing a specific fs for the image is usually a bad idea because the initrd
(borrowed from the host) is likely to include only support for the filesystem
used by the host's rootfs.

Since the point of this test is to check aliases on mount units, there's no
specific need for ext4, hence drop any parts that request or rely on ext4.

2 years agomeson: Downgrade unused function from error to warning in local builds
Daan De Meyer [Tue, 16 Nov 2021 09:52:39 +0000 (09:52 +0000)] 
meson: Downgrade unused function from error to warning in local builds

When working on systemd, it's often useful to be able to comment out
a function to see how a build behaves without it. Currently, when doing
this with a static function that's only used once, the build fails because
the function then becomes unused. As such, Let's downgrade the unused
function error to a warning in local builds.

2 years agotmpfiles: split out config for systemd-resolve
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 11:52:21 +0000 (12:52 +0100)] 
tmpfiles: split out config for systemd-resolve

This mirrors what was done in 564761fcaeda8c013210f7c6934847a6d0228ec9
for sysusers.d. If we allow separating resolved sysusers config
in a subpackage, we should do the same for the symlink that is
only useful when resolved is installed.

Related to #21317.

2 years agoMerge pull request #21275 from keszybz/makefs-quiet
Lennart Poettering [Tue, 16 Nov 2021 15:55:47 +0000 (16:55 +0100)] 
Merge pull request #21275 from keszybz/makefs-quiet

Makefs quiet output

2 years agoMerge pull request #21386 from keszybz/binfmt-later
Lennart Poettering [Tue, 16 Nov 2021 15:54:47 +0000 (16:54 +0100)] 
Merge pull request #21386 from keszybz/binfmt-later

Order binfmt.service after local-fs.target

2 years agohwdb: ieee1394-unit-function: add entry for MOTU Track 16
Takashi Sakamoto [Tue, 16 Nov 2021 08:05:07 +0000 (17:05 +0900)] 
hwdb: ieee1394-unit-function: add entry for MOTU Track 16

In Linux kernel 5.16 prepatch, MOTU Track 16 is newly supported by ALSA
firewire-motu driver.

This commit adds hwdb entry for the device.

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=411ac2982cb6

2 years agonetwork: tuntap: drop unnecessary minus
Yu Watanabe [Tue, 16 Nov 2021 07:24:35 +0000 (16:24 +0900)] 
network: tuntap: drop unnecessary minus

2 years agoMerge pull request #21383 from yuwata/network-address-scope
Lennart Poettering [Tue, 16 Nov 2021 15:53:26 +0000 (16:53 +0100)] 
Merge pull request #21383 from yuwata/network-address-scope

network: use route_scope_from_string() at one more place

2 years agoMerge pull request #21380 from poettering/homed-test-qemu
Lennart Poettering [Tue, 16 Nov 2021 15:52:57 +0000 (16:52 +0100)] 
Merge pull request #21380 from poettering/homed-test-qemu

homed: make sure homed tests actually run in qemu, too

2 years agoumount: fix log message
Lennart Poettering [Tue, 16 Nov 2021 09:09:29 +0000 (10:09 +0100)] 
umount: fix log message

The sentence wasn't correct English language, let's fix that. More
importantly: if the mount options are empty we'd display "(null)" here.
Fix that. (And they can be empty IRL, see CI results)

2 years agoanalyze: supress bogus compiler warning 21392/head
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 13:24:46 +0000 (14:24 +0100)] 
analyze: supress bogus compiler warning

2 years agoman: document fs types known to makefs 21275/head
Zbigniew Jędrzejewski-Szmek [Sat, 13 Nov 2021 15:47:40 +0000 (16:47 +0100)] 
man: document fs types known to makefs

2 years agomakefs: add "support" for f2fs
Zbigniew Jędrzejewski-Szmek [Sat, 13 Nov 2021 15:40:46 +0000 (16:40 +0100)] 
makefs: add "support" for f2fs

The man page doesn't quite match what --help says, and I needed to use "-f" to
write a wiped partition. This all feels a bit experimental, but the fs has some
adherents, and we should make it easy to use.

(Also, an empty 256MB device formatted and mounted shows up as
  Filesystem      Size  Used Avail Use% Mounted on
  /dev/loop0      254M   85M  170M  34% /var/tmp/mount
which also seems a bit over the top…)

Requested in https://github.com/systemd/systemd/pull/21275#issuecomment-967928690.

2 years agomakefs: fix too-long swap labels
Zbigniew Jędrzejewski-Szmek [Fri, 12 Nov 2021 14:56:56 +0000 (15:56 +0100)] 
makefs: fix too-long swap labels

Apparently mkswap has it's own limit, and it seems to be one lower than the one
for ext2/3/4.

$ for i in ext2 ext3 ext4 btrfs xfs vfat swap minix; do
  echo $i && wipefs -q -a '/var/tmp/głąbźśńćąśððð.img'
  build/systemd-makefs $i '/var/tmp/głąbźśńćąśððð.img'
done

ext2
/var/tmp/głąbźśńćąśððð.img successfully formatted as ext2 (label "głąbźśńćą", uuid 7626bc5c-8ac4-43cf-87b7-1b2761272dd3)
ext3
/var/tmp/głąbźśńćąśððð.img successfully formatted as ext3 (label "głąbźśńćą", uuid 0da22cad-0dbf-4a7a-962d-12cd39d006b5)
ext4
/var/tmp/głąbźśńćąśððð.img successfully formatted as ext4 (label "głąbźśńćą", uuid dded267b-8955-4d19-82a5-1f231d446059)
btrfs
/var/tmp/głąbźśńćąśððð.img successfully formatted as btrfs (label "głąbźśńćąśððð.img", uuid 9e2e89f1-010d-4ab6-80f3-f9e215dbc225)
xfs
/var/tmp/głąbźśńćąśððð.img successfully formatted as xfs (label "głąbźśń", uuid 2cc937af-4c41-465c-8f52-aab2304bd860)
vfat
mkfs.fat 4.2 (2021-01-31)
/var/tmp/głąbźśńćąśððð.img successfully formatted as vfat (label "G__B_______", uuid a3a9e028)

swap
...
LABEL=głąbźśńć, UUID=0ab787aa-37a6-4b32-978b-d71efc6e6098
/var/tmp/głąbźśńćąśððð.img successfully formatted as swap (label "głąbźśńć", uuid 0ab787aa-37a6-4b32-978b-d71efc6e6098)

minix
...
/var/tmp/głąbźśńćąśððð.img successfully formatted as minix (no label or uuid specified)

2 years agomakefs: fix too-long ext2/3/4 labels
Zbigniew Jędrzejewski-Szmek [Fri, 12 Nov 2021 13:22:58 +0000 (14:22 +0100)] 
makefs: fix too-long ext2/3/4 labels

2 years agomakefs: fix label for vfat filesystems
Zbigniew Jędrzejewski-Szmek [Tue, 9 Nov 2021 07:52:19 +0000 (08:52 +0100)] 
makefs: fix label for vfat filesystems

I was testing with a "test1.img" and mkfs.vfat rejects "TEST1.IMG" with the
error "Labels with characters *?.,;:/\|+=<>[]" are not allowed". So let's
replace those characters with "_".

2 years agobasic/utf8: add function to convert to ASCII
Zbigniew Jędrzejewski-Szmek [Fri, 12 Nov 2021 09:27:13 +0000 (10:27 +0100)] 
basic/utf8: add function to convert to ASCII

The conversion must be lossy because ASCII doesn't have enough chars.

2 years agobasic: f2fs can do discard
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 11:32:07 +0000 (12:32 +0100)] 
basic: f2fs can do discard

2 years agobasic: cramfs is also a read-only fs
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 11:31:57 +0000 (12:31 +0100)] 
basic: cramfs is also a read-only fs

2 years agozsh: drop unused code
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 11:24:27 +0000 (12:24 +0100)] 
zsh: drop unused code

The verbs were commented, so the completion functions wouldn't be
invoked anyway.

2 years agozsh: add hints for more systemd-analyze verbs and options
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 11:23:11 +0000 (12:23 +0100)] 
zsh: add hints for more systemd-analyze verbs and options

2 years agoshell-completion: fix indentation
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 11:20:26 +0000 (12:20 +0100)] 
shell-completion: fix indentation

2 years agoanalyze: clarify return value
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 11:20:17 +0000 (12:20 +0100)] 
analyze: clarify return value

In this case, EXIT_SUCCESS is the same as 0, but we shouldn't use it
in a function that returns negative on error.

2 years agoanalyze: add --quiet option
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 11:19:42 +0000 (12:19 +0100)] 
analyze: add --quiet option

This is useful for shell completion, but also for users who don't care
about the extra output.

2 years agotest: make homed test run in qemu 21380/head
Lennart Poettering [Mon, 15 Nov 2021 15:21:37 +0000 (16:21 +0100)] 
test: make homed test run in qemu

2 years agobasic/generate-fs-switch-case: inline comments
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 09:32:09 +0000 (10:32 +0100)] 
basic/generate-fs-switch-case: inline comments

Let's keep the comments together with the lines they describe, this is easier
to read and probably more maintainable in the long run.

Also, () → {} for idiomaticity.

2 years agohomed: wait for luks devices to go away
Lennart Poettering [Mon, 15 Nov 2021 16:55:47 +0000 (17:55 +0100)] 
homed: wait for luks devices to go away

Let's make sure LUKS volumes are really definitely gone before we retun
in the deactivation logic.

2 years agoMerge pull request #21373 from poettering/filesystems-more-groups
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 09:27:21 +0000 (10:27 +0100)] 
Merge pull request #21373 from poettering/filesystems-more-groups

some file system tables/magic love

2 years agoanalyze: fix memleak
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 09:25:22 +0000 (10:25 +0100)] 
analyze: fix memleak

2 years agounits: delay binfmt processing until after local-fs.target 21386/head
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 08:19:07 +0000 (09:19 +0100)] 
units: delay binfmt processing until after local-fs.target

Users may use rules that refer to binaries e.g. in /opt or /usr/local,
and those directories may be separate mount points. We don't need the
binfmt rules in early boot, so let's delay the service so that we can
rely on the full local filesystem being visible.

Fixes #21178.

2 years agoman: add markup
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 08:15:29 +0000 (09:15 +0100)] 
man: add markup

2 years agobasic/errno-util: adjust indentation
Zbigniew Jędrzejewski-Szmek [Tue, 16 Nov 2021 08:08:12 +0000 (09:08 +0100)] 
basic/errno-util: adjust indentation

It was bothering me that this backslash wasn't aligned with the
ones below.

2 years agodocs: mention RET_NERRNO() in CODING_STYLE.md
Lennart Poettering [Mon, 15 Nov 2021 08:32:41 +0000 (09:32 +0100)] 
docs: mention RET_NERRNO() in CODING_STYLE.md

2 years agotree-wide: use new RET_NERRNO() helper at various places
Lennart Poettering [Sun, 14 Nov 2021 21:40:49 +0000 (22:40 +0100)] 
tree-wide: use new RET_NERRNO() helper at various places