]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agonetwork: make MACAddress= takes hardware address with its length is INFINIBAND_ALEN 21517/head
Yu Watanabe [Thu, 4 Nov 2021 18:20:29 +0000 (03:20 +0900)] 
network: make MACAddress= takes hardware address with its length is INFINIBAND_ALEN

Also, the multicast and local bits in the specified MAC address for
ethernet are adjusted.

3 years agonetif-util: introduce net_verify_hardware_address()
Yu Watanabe [Sat, 6 Nov 2021 01:55:21 +0000 (10:55 +0900)] 
netif-util: introduce net_verify_hardware_address()

3 years agoUpdate LINGUAS (#21499)
Hugo Carvalho [Thu, 25 Nov 2021 11:24:00 +0000 (11:24 +0000)] 
Update LINGUAS (#21499)

3 years agorepart,homed: split out disk cleanup macros into generic header
Lennart Poettering [Tue, 28 Sep 2021 21:24:57 +0000 (23:24 +0200)] 
repart,homed: split out disk cleanup macros into generic header

3 years agolist: add LIST_POP() helper that pops the first item off a linked list
Lennart Poettering [Tue, 28 Sep 2021 22:13:12 +0000 (00:13 +0200)] 
list: add LIST_POP() helper that pops the first item off a linked list

3 years agoman: "-j", not "-J" is the shortcut for JSON mode in homectl
Lennart Poettering [Thu, 25 Nov 2021 10:21:55 +0000 (11:21 +0100)] 
man: "-j", not "-J" is the shortcut for JSON mode in homectl

The code and --help text got this right, hence fix the man page

3 years agoMerge pull request #21503 from poettering/ioprio-fix
Yu Watanabe [Thu, 25 Nov 2021 05:23:02 +0000 (14:23 +0900)] 
Merge pull request #21503 from poettering/ioprio-fix

work around linux 5.15 ioprio API breakage

3 years agoMerge pull request #21492 from andch-nn/add-micmute-dell-machine
Yu Watanabe [Thu, 25 Nov 2021 04:52:26 +0000 (13:52 +0900)] 
Merge pull request #21492 from andch-nn/add-micmute-dell-machine

Add micmute for dell machine

3 years agoMerge pull request #21506 from poettering/homed-uidmap-fixes
Yu Watanabe [Thu, 25 Nov 2021 04:37:46 +0000 (13:37 +0900)] 
Merge pull request #21506 from poettering/homed-uidmap-fixes

homed uidmap (and other) fixes

3 years agoMerge pull request #21508 from poettering/conn-count-fix
Yu Watanabe [Thu, 25 Nov 2021 04:33:13 +0000 (13:33 +0900)] 
Merge pull request #21508 from poettering/conn-count-fix

pid1: fix connection counting

3 years agobuild: fix build without seccomp
Dominique Martinet [Wed, 24 Nov 2021 14:04:30 +0000 (23:04 +0900)] 
build: fix build without seccomp

- execute.c: bpf functions were in the middle of an #if HAVE_SECCOMP
  block for no reason
- test-fd-util.c: make seccomp-util.h includable without depending on
  <seccomp.h>, and make is_seccomp_available() hardcoded to returning
  false in this case.
  Also fix a stray DEFINED() -- HAVE_SECCOMP is defined as 0, so normal
  #if should be used like everywhere else.

3 years agobuild(deps): bump github/codeql-action from 1.0.23 to 1.0.24
dependabot[bot] [Wed, 24 Nov 2021 15:17:04 +0000 (15:17 +0000)] 
build(deps): bump github/codeql-action from 1.0.23 to 1.0.24

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

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoman: suggest usage of CollectMode= in Accept=yes services 21508/head
Lennart Poettering [Wed, 24 Nov 2021 23:11:31 +0000 (00:11 +0100)] 
man: suggest usage of CollectMode= in Accept=yes services

3 years agosocket: various modernizations
Lennart Poettering [Wed, 24 Nov 2021 22:53:10 +0000 (23:53 +0100)] 
socket: various modernizations

3 years agosocket: always pass socket, fd and SocketPeer ownership to service together
Lennart Poettering [Wed, 24 Nov 2021 22:50:07 +0000 (23:50 +0100)] 
socket: always pass socket, fd and SocketPeer ownership to service together

Per-connection socket instances we currently maintain three fields
related to the socket: a reference to the Socket unit, the connection fd,
and a reference to the SocketPeer object that counts socket peers.

Let's synchronize their lifetime, i.e. always set them all three
together or unset them together, so that their reference counters stay
synchronous.

THis will in particuar ensure that we'll drop the SocketPeer reference
whenever we leave an active state of the service unit, i.e. at the same
time we close the fd for it.

Fixes: #20685
3 years agojournal: Don't allow creating invalid objects
Daan De Meyer [Thu, 11 Nov 2021 13:31:31 +0000 (13:31 +0000)] 
journal: Don't allow creating invalid objects

Let's not allow creating empty entry or data objects. Let's also
not allow creating data objects from data without an embedded '='
character.

3 years agoMerge pull request #21502 from keszybz/os-release-debugging
Lennart Poettering [Wed, 24 Nov 2021 21:00:02 +0000 (22:00 +0100)] 
Merge pull request #21502 from keszybz/os-release-debugging

Additional debugging info to make release-extension easier to introspect

3 years agounit_is_bound_by_inactive: fix return pointer check
Dominique Martinet [Wed, 24 Nov 2021 13:27:22 +0000 (22:27 +0900)] 
unit_is_bound_by_inactive: fix return pointer check

*ret_culprit should be set if ret_culprit has been passed a non-null value,
checking the previous *ret_culprit value does not make sense.

This would cause the culprit to not properly be assigned, leading to
pid1 crash when a unit could not be stopped.

Fixes: #21476
3 years agohomework: add debug log message whenever we applied a uidmap to a mount 21506/head
Lennart Poettering [Wed, 24 Nov 2021 17:40:36 +0000 (18:40 +0100)] 
homework: add debug log message whenever we applied a uidmap to a mount

3 years agohomework: fix a bad error propagation
Lennart Poettering [Wed, 24 Nov 2021 17:36:00 +0000 (18:36 +0100)] 
homework: fix a bad error propagation

3 years agohomework: also apply uid shifting when changing passwords/resizing/updating home...
Lennart Poettering [Wed, 24 Nov 2021 17:34:02 +0000 (18:34 +0100)] 
homework: also apply uid shifting when changing passwords/resizing/updating home areas

This adds uidmap shifting also when resizing/updating/changing
passwords. Prviously I thought we didn't have to, because the user is
not going to access the uidmap if we only quickly activate the home
area. But this thinking is wrong, because the three operations will
result in an update ~/.identity fie to be written, and we should do that
with uidmap applied, so that its ownership maps down to nobody below as
intended.

Fixes: #21441
3 years agohomework: don't try to shift uidmap for already activated home areas
Lennart Poettering [Wed, 24 Nov 2021 17:31:51 +0000 (18:31 +0100)] 
homework: don't try to shift uidmap for already activated home areas

When we want to operate on an already activated home area we so far
tried to reapply the uidmapping logic. We shouldn't do that, it's
already applied after all.

We only want to apply this for newly activated home areas. Hence check
for the right HomeSetupFlags flag for it HOME_SETUP_ALREADY_ACTIVATED.

The patch is actually in theory a two-liner. Except that so far we don#t
pass the HomeSetupFlags flags down all necessary functions where the
uidmap stuff will eventually run. Hence this larger than intended
commit.

3 years agohomework: fix message typo
Lennart Poettering [Wed, 24 Nov 2021 17:29:52 +0000 (18:29 +0100)] 
homework: fix message typo

3 years agohomectl: also acquire "cheap" passwords for homectl update/passwd
Lennart Poettering [Wed, 24 Nov 2021 17:26:28 +0000 (18:26 +0100)] 
homectl: also acquire "cheap" passwords for homectl update/passwd

In 57bb9bcba5563c040ee0c41f58e3730a006a8de2 support was added to read
"cheap" passwords from env vars and stuff before issuing the first
operation, instead of waiting for it until the first operation failed.

This was added for most verbs of "homectl", but two were left out:
update + passwd. Add it there too.

3 years agodissect-image: always say "file of image" when reporting about the image 21502/head
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 14:40:53 +0000 (15:40 +0100)] 
dissect-image: always say "file of image" when reporting about the image

We give a path, but the path is only meaningful inside of the image.
Some messages made it clear that it's a path in the image, let's make
them all do that.

3 years agoAdd debug logs of extension-release scanning
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 14:06:48 +0000 (15:06 +0100)] 
Add debug logs of extension-release scanning

3 years agodissect-image: provide a more useful message when ENOMEDIUM is returned
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 12:06:37 +0000 (13:06 +0100)] 
dissect-image: provide a more useful message when ENOMEDIUM is returned

3 years agodissect-image: do not enable "verification" when trying to acquire metadata
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 12:03:25 +0000 (13:03 +0100)] 
dissect-image: do not enable "verification" when trying to acquire metadata

The whole point of acquiring metadata is quite often to figure out why the
image does not pass verification. Refusing to provide metadata is just being
hostile to the user.

When called from other places (e.g. image_read_metadata()), verification is
still performed.

3 years agotest: make test-execute pass on Linux 5.15 21503/head
Lennart Poettering [Wed, 24 Nov 2021 14:58:50 +0000 (15:58 +0100)] 
test: make test-execute pass on Linux 5.15

Linux 5.15 broke kernel API:

https://github.com/torvalds/linux/commit/e70344c05995a190a56bbd1a23dc2218bcc8c924

Previously setting IOPRIO_CLASS_NONE for a process would then report
IOPRIO_CLASS_NONE back. But since 5.15 it reports IOPRIO_CLASS_BE
instead. Since IOPRIO_CLASS_NONE is an alias for a special setting of
IOPRIO_CLASS_BE this makes some sense, but it's also a kernel API
breakage that our testsuite trips up on.

(I made some minimal effort to inform the kernel people about this API
breakage during the 5.15 rc phase, but noone was interested.)

Either way let's hadle this gracefully in our test suite and accept
"best-effort" too when "none" was set.

(This is only triggable if the tests are run on 5.15 with full privs)

3 years agoman: don't mention IOSchedulingClass=none anymore in the docs
Lennart Poettering [Wed, 24 Nov 2021 14:54:29 +0000 (15:54 +0100)] 
man: don't mention IOSchedulingClass=none anymore in the docs

Let's not mention a redundant setting of "none". Let's instead only
mention "best-effort", which is the same. Also mention the default
settings properly.

(Also, while we are at it, don#t document the numeric alias, that's
totally redundant and harder to use, so no need to push people towards
it.)

3 years agotest: add test for ioprio normalization
Lennart Poettering [Wed, 24 Nov 2021 14:52:13 +0000 (15:52 +0100)] 
test: add test for ioprio normalization

3 years agocore: normalize ioprio values we acquire from kernel
Lennart Poettering [Wed, 24 Nov 2021 14:39:43 +0000 (15:39 +0100)] 
core: normalize ioprio values we acquire from kernel

Linux 5.15 broke API in ioprio_get(): instead of returning
IOPRIO_CLASS_NONE when that's set it now returns IOPRIO_CLASS_BE, which
is what this actually is (the former is just an alias for the latter
with a priority value of 4).

Let's hide the differences between old and new kernels here, and always
normalize to what the new kernels do.

3 years agoioprio: normalize io priority values in configuration
Lennart Poettering [Wed, 24 Nov 2021 14:38:10 +0000 (15:38 +0100)] 
ioprio: normalize io priority values in configuration

Let's always say IOPRIO_CLASS_BE when IOPRIO_CALSS_NONE is set.

3 years agoioprio-util: add macro for default ioprio settings
Lennart Poettering [Wed, 24 Nov 2021 14:30:22 +0000 (15:30 +0100)] 
ioprio-util: add macro for default ioprio settings

IOPRIO_CLASS_NONE with any priority value actually is an alias for
IOPRIO_CLASS_BE with priority value 4 – which is the default ioprio for
all processes.

We got this right at one place, but wrong at three others (where we
assumed the default value was 0, not 4). Let's add a
macro that encodes this properly, and use it everywhere.

3 years agoshared: split out ioprio related stuff into ioprio-util.[ch]
Lennart Poettering [Wed, 24 Nov 2021 14:24:55 +0000 (15:24 +0100)] 
shared: split out ioprio related stuff into ioprio-util.[ch]

No actual code changes, just some splitting out.

3 years agodissect-image: reuse common exit path
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 12:02:11 +0000 (13:02 +0100)] 
dissect-image: reuse common exit path

3 years agoshared/format-table: drop unnecessary _cleanup_
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 10:59:10 +0000 (11:59 +0100)] 
shared/format-table: drop unnecessary _cleanup_

3 years agotest-pretty-print: spelling nitpick
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 10:44:54 +0000 (11:44 +0100)] 
test-pretty-print: spelling nitpick

The antonym of "nay" is usually spelled as "yea" (and pronouced as yā, so it
rhymes with "nay"), see e.g. https://www.cop.senate.gov/general/Features/votes.htm

3 years agoshell-completion: add journalctl --facility
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 10:21:10 +0000 (11:21 +0100)] 
shell-completion: add journalctl --facility

Fixes #21484.

3 years agobasic/architectures: sort by name and remove duplicates
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 17:19:59 +0000 (18:19 +0100)] 
basic/architectures: sort by name and remove duplicates

C.f. 086df29f35069bb454d52a21a146f76cf7bd42dc.

3 years agobpf: fix memleak in restrict_fs_bpf
Julia Kartseva [Tue, 23 Nov 2021 23:38:11 +0000 (15:38 -0800)] 
bpf: fix memleak in restrict_fs_bpf

Memory allocated in bpf skeleton is not freed. Wrap ptr in _cleanup_.

Fixes: #21471
3 years agoMerge pull request #21448 from poettering/disk-image-purpose
Lennart Poettering [Wed, 24 Nov 2021 08:37:04 +0000 (09:37 +0100)] 
Merge pull request #21448 from poettering/disk-image-purpose

encode disk image purpose in extension-release.d + os-release

3 years agorecurse-dir: give callers of recurse_dir_at() control over path prefix
Lennart Poettering [Tue, 23 Nov 2021 21:18:31 +0000 (22:18 +0100)] 
recurse-dir: give callers of recurse_dir_at() control over path prefix

One of the niceties of recurse_dir()/recurse_dir_at() is that the path
argument is decoration, it's not used for actually accessing the fs in
anyway. That's very handy in environments where chroots and relative
paths are used, as we can path in any path we like and the recursion
function will suffix with whatever it discovers but will not try to make
sense of the prefix you pass.

This works great, except that the recurse_dir_at() wrapper broke that:
it adjusted the path if NULL to "." simply for the sake of making
openat() on the top work. Let's make this adjustment more local and do
it only for the openat() itself, and otherwise pass the path through the
way we got it. This means: if a caller really wants the paths that are
concatenated to start with a "." it can just pass that. This way the
caller gets full control back of the path prefix. Win!

Note that all current users of recurse_dir_at() don't pass NULL as
second arg, hence this check is without any real effect for now. It's
preparation for future uses however.

3 years agoupdate TODO 21448/head
Lennart Poettering [Thu, 18 Nov 2021 21:00:20 +0000 (22:00 +0100)] 
update TODO

3 years agotest: test new SYSEXT_SCOPE=/PORTABLE_PREFIXES= fields in TEST-29
Lennart Poettering [Tue, 23 Nov 2021 15:34:40 +0000 (16:34 +0100)] 
test: test new SYSEXT_SCOPE=/PORTABLE_PREFIXES= fields in TEST-29

3 years agodissect: show intended purpose of images in dissection output
Lennart Poettering [Fri, 19 Nov 2021 15:20:00 +0000 (16:20 +0100)] 
dissect: show intended purpose of images in dissection output

With this the tool will show whether an image is intended to be a
bootable OS image, a system extension, or a portable service image.
Example output with this patch:

<snip>
      Name: image_53.raw
      Size: 3.2G

Machine ID: bb9f2921198040feb7c82270bf66e4b8
OS Release: NAME=Fedora
            VERSION=34 (Thirty Four)
            …
            PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
            IMAGE_VERSION=53

    Use As: ✓ bootable system for UEFI
            ✓ bootable system for container
            ✗ portable service
            ✗ extension for system
            ✗ extension for initrd
            ✗ extension for portable service

RW DESIGNATOR PARTITION UUID                       PARTITION LABEL      FSTYPE ARCHITECTURE VERITY GROWFS NODE         PARTNO
rw root       d56af2b4-35eb-2e40-8f08-2d3b7012b0fc Root Partition       btrfs  x86-64       no         no /dev/loop1p2 2
rw esp        e3d11339-05c1-a74a-ae77-aae76812c134 ESP System Partition vfat   -            -          no /dev/loop1p1 1

</snip>

3 years agoos-release: add new PORTABLE_PREFIXES= field for declaring valid portable service...
Lennart Poettering [Fri, 19 Nov 2021 15:19:19 +0000 (16:19 +0100)] 
os-release: add new PORTABLE_PREFIXES= field for declaring valid portable service match prefixes

3 years agoextension-release.d/: add a new field SYSEXT_SCOPE= for clarifying what a system...
Lennart Poettering [Thu, 18 Nov 2021 21:00:31 +0000 (22:00 +0100)] 
extension-release.d/: add a new field SYSEXT_SCOPE= for clarifying what a system extension is for

This should make things a bit more robust since it ensures system
extension can only applied to the right environments. Right now three
different "scopes" are defined:

1. "system" (for regular OS systems, after the initrd transition)
2. "initrd" (for sysext images that apply to the initrd environment)
3. "portable" (for sysext images that apply to portable images)

If not specified we imply a default of "system portable", i.e. any image
where the field is not specified is implicitly OK for application to OS
images and for portable services – but not for initrds.

3 years agodissect-image: when extracting metadata from image also check if it contains init...
Lennart Poettering [Fri, 19 Nov 2021 14:48:41 +0000 (15:48 +0100)] 
dissect-image: when extracting metadata from image also check if it contains init system

It's good to know whether we can boot the image.

3 years agodissect: add helper call for unifying three loops
Lennart Poettering [Fri, 19 Nov 2021 14:47:20 +0000 (15:47 +0100)] 
dissect: add helper call for unifying three loops

3 years agobootctl: use new red/green check/cross mark helpers at two places
Lennart Poettering [Tue, 23 Nov 2021 13:08:01 +0000 (14:08 +0100)] 
bootctl: use new red/green check/cross mark helpers at two places

3 years agopretty-print: add helper for quickly outputting red/green cross/check marks
Lennart Poettering [Tue, 23 Nov 2021 09:37:03 +0000 (10:37 +0100)] 
pretty-print: add helper for quickly outputting red/green cross/check marks

Compound constructors FTW!

3 years agosd-bus: Fix standard method argument names
Miika Karanki [Tue, 23 Nov 2021 15:23:01 +0000 (17:23 +0200)] 
sd-bus: Fix standard method argument names

The argument names of methods under org.freedesktop.DBus.Properties and
org.freedesktop.DBus.Introspectable interfaces are specifies in D-Bus
specification[1]. They are:

  org.freedesktop.DBus.Introspectable.Introspect (out STRING xml_data)
  org.freedesktop.DBus.Properties.Get (in STRING interface_name,
                                       in STRING property_name,
                                       out VARIANT value);
  org.freedesktop.DBus.Properties.Set (in STRING interface_name,
                                       in STRING property_name,
                                       in VARIANT value);
  org.freedesktop.DBus.Properties.GetAll (in STRING interface_name,
                                          out DICT<STRING,VARIANT> props);

sd-bus is using different argument names in the introspection document.
Usually this is not a problem but in case something tries to map the
argument names based on the introspection document to the position of
the arguments in the method call, then using names different than the
ones specified in the D-Bus specification is confusing.

So fix the names to match the D-Bus specification.

[1] https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-introspectable

3 years agodocs: remove comment that makes githubs renderer very angry
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 18:42:38 +0000 (19:42 +0100)] 
docs: remove comment that makes githubs renderer very angry

It is fine on github.com, but not on github.io.

3 years agoMerge pull request #21479 from keszybz/cosmetic-initialization-adjustments
Lennart Poettering [Tue, 23 Nov 2021 17:42:45 +0000 (18:42 +0100)] 
Merge pull request #21479 from keszybz/cosmetic-initialization-adjustments

Cosmetic initialization adjustments

3 years agoprocess-util: add missing NULL initialization for _cleanup_ variable
Lennart Poettering [Tue, 23 Nov 2021 15:54:19 +0000 (16:54 +0100)] 
process-util: add missing NULL initialization for _cleanup_ variable

This is will otherwise trigger a bad memory access in the error path

3 years agoMerge pull request #21440 from poettering/homed-initial-fs-size
Lennart Poettering [Tue, 23 Nov 2021 15:44:26 +0000 (16:44 +0100)] 
Merge pull request #21440 from poettering/homed-initial-fs-size

homed: also support minimizing/maximizing home dirs when creating them

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 agovirt: Fix the detection for Hyper-V VMs
Boqun Feng [Tue, 23 Nov 2021 07:09:26 +0000 (15:09 +0800)] 
virt: Fix the detection for Hyper-V VMs

Use product_version instead of product_name in DMI table and the string
"Hyper-V" to avoid misdetection.

Fixes: #21468
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
3 years agoMerge pull request #21443 from poettering/homed-grow-shrink-on-login-logout
Lennart Poettering [Tue, 23 Nov 2021 12:13:06 +0000 (13:13 +0100)] 
Merge pull request #21443 from poettering/homed-grow-shrink-on-login-logout

homed: add ability to auto-grow home dir in login and auto-shrink on logout (if luks2+btrfs is used)

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 agoMerge pull request #21472 from mrc0mmand/sanitizer_suppressions
Frantisek Sumsal [Tue, 23 Nov 2021 10:32:41 +0000 (10:32 +0000)] 
Merge pull request #21472 from mrc0mmand/sanitizer_suppressions

test: suppress certain leaks reported by LSan

3 years agotest: update test to use --disk-size=min 21440/head
Lennart Poettering [Fri, 19 Nov 2021 08:58:50 +0000 (09:58 +0100)] 
test: update test to use --disk-size=min

3 years agoman: document min/max for --disk-space= too
Lennart Poettering [Fri, 19 Nov 2021 08:58:34 +0000 (09:58 +0100)] 
man: document min/max for --disk-space= too

3 years agohomework: correct initial minimal fs size calculations by LUKS2/GPT overhead
Lennart Poettering [Thu, 4 Nov 2021 22:49:17 +0000 (23:49 +0100)] 
homework: correct initial minimal fs size calculations by LUKS2/GPT overhead

So far we assumed we ignore the LUKS2/GPT header overhead when
determining what the lower bound for images sizes is. Let's correct
this.

3 years agohomework: when creating home dir also treat specified size as hint
Lennart Poettering [Thu, 4 Nov 2021 20:54:46 +0000 (21:54 +0100)] 
homework: when creating home dir also treat specified size as hint

The resize logic is now able to handle resize requests that cannot be
fulfilled in full gracefully. Let's do the same when allocating new home
directories.

This means "homectl create foo --disk-size=min" and "homectl create foo
--disk-size=max" may now be used to create the smallest or largest home
directory we support.

3 years agocore/automount: Add ExtraOptions field
Andrew Stone [Thu, 11 Nov 2021 21:45:47 +0000 (13:45 -0800)] 
core/automount: Add ExtraOptions field

3 years agoman/doc: document auto resize modes 21443/head
Lennart Poettering [Fri, 19 Nov 2021 09:55:57 +0000 (10:55 +0100)] 
man/doc: document auto resize modes

3 years agohomework: upload home password into kernel keyring if needed
Lennart Poettering [Tue, 2 Nov 2021 17:24:02 +0000 (18:24 +0100)] 
homework: upload home password into kernel keyring if needed

If we do automatic disk space rebalancing, we must be able to unlock the
encrypted volume for that in the background, thus we need to decryption
key around in userspace. Let's do this via the kernel keyring. This
allows us to do this in a relatively secure way, so that it sticks
around between homework invocations, but still is destroyed
automatically when homed goes down.

3 years agohomework: add auto-shrink/auto-grow
Lennart Poettering [Fri, 29 Oct 2021 08:15:00 +0000 (10:15 +0200)] 
homework: add auto-shrink/auto-grow

3 years agohomectl: expose new autoResizeMode JSON user record property
Lennart Poettering [Thu, 4 Nov 2021 17:05:49 +0000 (18:05 +0100)] 
homectl: expose new autoResizeMode JSON user record property

3 years agouser-record: add auto-resize property
Lennart Poettering [Fri, 29 Oct 2021 07:45:17 +0000 (09:45 +0200)] 
user-record: add auto-resize property

3 years agoMerge pull request #21470 from poettering/resolved-250-fixes
Lennart Poettering [Tue, 23 Nov 2021 07:01:50 +0000 (08:01 +0100)] 
Merge pull request #21470 from poettering/resolved-250-fixes

various smaller additions/fixes for resolved

3 years agoman: fix type in sd_bus_error_add_map() prototype
Lennart Poettering [Mon, 22 Nov 2021 21:05:57 +0000 (22:05 +0100)] 
man: fix type in sd_bus_error_add_map() prototype

Fixes: #21467
3 years agoresolved: lower connection timeout for DoT connections in opportunistic mode 21470/head
Lennart Poettering [Mon, 22 Nov 2021 17:32:57 +0000 (18:32 +0100)] 
resolved: lower connection timeout for DoT connections in opportunistic mode

Fixes: #20801
3 years agoresolved: clean up manager_write_resolv_conf() a bit
Lennart Poettering [Mon, 22 Nov 2021 17:29:17 +0000 (18:29 +0100)] 
resolved: clean up manager_write_resolv_conf() a bit

Let's downgrade log messages which are not fatal for the service to
LOG_WARNING.

And let's simplify clean-up by using _cleanup_(unlink_and_freep).

3 years agoresolved: make sure we don't hit an assert when dealing with incomplete DNSSD service...
Lennart Poettering [Mon, 22 Nov 2021 15:14:07 +0000 (16:14 +0100)] 
resolved: make sure we don't hit an assert when dealing with incomplete DNSSD service definitions

Fixes: #21142
3 years agoresolved: properly signal transient errors back to NSS stack
Lennart Poettering [Mon, 22 Nov 2021 14:17:34 +0000 (15:17 +0100)] 
resolved: properly signal transient errors back to NSS stack

NSS mostly knows four error cases: SUCCESS, NOTFOUND, UNAVAIL, TRYAGAIN,
and they can all be used in nsswitch.conf to route requests.

So far nss-resolve would return SUCCESS + NOTFOUND + UNAVAIL. Let's also
return TRYAGAIN in some cases, specifically the ones where we are
currntly unable to resolve a request but likely could later. i.e.
errors caused by networking issues or such.

Fixes: #20786
3 years agoresolved: fix ResolveService() hostname handling
Lennart Poettering [Mon, 22 Nov 2021 13:37:54 +0000 (14:37 +0100)] 
resolved: fix ResolveService() hostname handling

Let's eat up special returns of dns_query_process_cname_many() when
storing hostname resolution results.

The rest of the code assumes only == 0 means success and != 0 means
error, but so far > 0 also could mean success, let's fix that.

Fixes: #21365 #21140
(This was originally broken in 1db8e6d1db0880de240e5598e28d24d708479434)

3 years agonspawn: voidify expose_port_execute() calls
Lennart Poettering [Mon, 22 Nov 2021 13:37:48 +0000 (14:37 +0100)] 
nspawn: voidify expose_port_execute() calls

3 years agoresolved: add "proxy-only" stub on 127.0.0.54
Lennart Poettering [Mon, 22 Nov 2021 11:20:05 +0000 (12:20 +0100)] 
resolved: add "proxy-only" stub on 127.0.0.54

This beefs up the DNS stub logic to listen on two IP addresses:
127.0.0.53 (as before) + 127.0.0.54 (new). When the latter is contact
our stub will operate in "bypass" mode only, i.e we'll try to pass DNS
requests as unmodified upstream as we can (and not do mDNS/LLMNR and
such, also no DNSSEC validation – but we'll still do DNS-over-TLS
wrapping).

This is supposed to be useful for container environments or tethering:
this stub could be exposed (via NAT redirect) to clients of this system
and we'll try to stay out of the way with doing too much DNS magic
ourselves, but still expose whatever the current DNS server is from
upstream under a stable address/port.

How to use this:

  # iptables -t nat -I PREROUTING -p udp -i <interface> --dport 53 -j DNAT --to 127.0.0.54:53
  # echo 1 > /proc/sys/net/ipv4/conf/<interface>/route_localnet

3 years agosocket-util: add helper for generically initializing sockaddr_union from in_addr_union
Lennart Poettering [Mon, 22 Nov 2021 10:29:42 +0000 (11:29 +0100)] 
socket-util: add helper for generically initializing sockaddr_union from in_addr_union

3 years agoresolved: include IP address info in debug output for incoming datagrams
Lennart Poettering [Mon, 22 Nov 2021 10:13:26 +0000 (11:13 +0100)] 
resolved: include IP address info in debug output for incoming datagrams

3 years agotest: drop the `su` wrapper and use `systemctl` directly 21472/head
Frantisek Sumsal [Mon, 22 Nov 2021 21:12:09 +0000 (22:12 +0100)] 
test: drop the `su` wrapper and use `systemctl` directly

ASan is having a hard time to get its LD_PRELOAD= shenanigans straight
with all the shells flying around. Let's make it a bit easier by using
one of the nifty systemctl's features instead.

3 years agotest: suppress certain leaks reported by LSan
Frantisek Sumsal [Mon, 22 Nov 2021 19:13:51 +0000 (20:13 +0100)] 
test: suppress certain leaks reported by LSan

so we can run TEST-46 under sanitizers once again.

`systemd-homed` runs fsck on home directories, which reports a memory
leak we're not interested in. Let's introduce an LSan suppression file
to get around this. Since the patterns in the suppression file are
matched using basic substring match[0], they're a bit cumbersome, but
should get the work one.

[0] https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer#suppressions

Example leaks (as reported by TEST-46):
```
systemd-homed[1333]: =================================================================
systemd-homed[1333]: ==1333==ERROR: LeakSanitizer: detected memory leaks
systemd-homed[1333]: Direct leak of 24 byte(s) in 1 object(s) allocated from:
systemd-homed[1333]:     #0 0x7f0c8facccd1 in calloc (/usr/lib/clang/12.0.1/lib/linux/libclang_rt.asan-x86_64.so+0xf4cd1)
systemd-homed[1333]:     #1 0x558d9494ff67  (/usr/bin/fsck+0x3f67)
systemd-homed[1333]: Direct leak of 6 byte(s) in 1 object(s) allocated from:
systemd-homed[1333]:     #0 0x7f0c8fa906c1 in strdup (/usr/lib/clang/12.0.1/lib/linux/libclang_rt.asan-x86_64.so+0xb86c1)
systemd-homed[1333]:     #1 0x558d949518fd  (/usr/bin/fsck+0x58fd)
systemd-homed[1333]: SUMMARY: AddressSanitizer: 30 byte(s) leaked in 2 allocation(s).
systemd-homed[1337]: ==1337==WARNING: Symbolizer was blocked from starting itself!
systemd-homed[1337]: =================================================================
systemd-homed[1337]: ==1337==ERROR: LeakSanitizer: detected memory leaks
systemd-homed[1337]: Direct leak of 67584 byte(s) in 1 object(s) allocated from:
systemd-homed[1337]:     #0 0x7f01edb84b19  (/usr/lib/clang/12.0.1/lib/linux/libclang_rt.asan-x86_64.so+0xf4b19)
systemd-homed[1337]:     #1 0x7f01e8326829  (/usr/bin/../lib/libLLVM-12.so+0xb46829)
systemd-homed[1337]: SUMMARY: AddressSanitizer: 67584 byte(s) leaked in 1 allocation(s).
```

With the suppression file:
```
systemd-homed[1339]: -----------------------------------------------------
systemd-homed[1339]: Suppressions used:
systemd-homed[1339]:   count      bytes template
systemd-homed[1339]:       2         30 /bin/fsck$
systemd-homed[1339]: -----------------------------------------------------
systemd-homed[1343]: ==1343==WARNING: Symbolizer was blocked from starting itself!
systemd-homed[1343]: -----------------------------------------------------
systemd-homed[1343]: Suppressions used:
systemd-homed[1343]:   count      bytes template
systemd-homed[1343]:       1      67584 /lib/libLLVM
systemd-homed[1343]: -----------------------------------------------------
```

3 years agotest: fix a couple of "new" shellcheck-related issues
Frantisek Sumsal [Mon, 22 Nov 2021 19:51:15 +0000 (20:51 +0100)] 
test: fix a couple of "new" shellcheck-related issues

related to https://github.com/koalaman/shellcheck/wiki/SC2295

3 years agoresolved: use RET_NERRNO() where it makes sense
Lennart Poettering [Mon, 22 Nov 2021 10:08:32 +0000 (11:08 +0100)] 
resolved: use RET_NERRNO() where it makes sense

3 years agoRemove own copyright line
Jan Janssen [Mon, 22 Nov 2021 15:08:37 +0000 (16:08 +0100)] 
Remove own copyright line

3 years agokeymap: Add microphone mute keymap for Dell Machine 21492/head
Andy Chi [Mon, 22 Nov 2021 13:51:30 +0000 (21:51 +0800)] 
keymap: Add microphone mute keymap for Dell Machine

3 years agohwdb: 60-keyboard:: Update Dell Privacy Micmute Hotkey Map
Andy Chi [Mon, 22 Nov 2021 13:38:56 +0000 (21:38 +0800)] 
hwdb: 60-keyboard:: Update Dell Privacy Micmute Hotkey Map

Dell new Privacy feature provide new hardware level privacy protect for users
This patch remaps scancode 0x120001 to key code F20 micmute

3 years agoMerge pull request #21357 from mbd98/usr-verity-auto
Luca Boccassi [Mon, 22 Nov 2021 13:09:38 +0000 (13:09 +0000)] 
Merge pull request #21357 from mbd98/usr-verity-auto

veritysetup-generator, fstab-generator: Setup and mount usr verity device when 'usrhash' (and optionally systemd.verity_usr_*) is present as kernel command line parameter

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