]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agotree-wide: refuse too long strings earlier in specifier_printf() 19581/head
Yu Watanabe [Sun, 9 May 2021 16:46:48 +0000 (01:46 +0900)] 
tree-wide: refuse too long strings earlier in specifier_printf()

We usually call specifier_printf() and then check the validity of
the result. In many cases, validity checkers, e.g. path_is_valid(),
refuse too long strings. This makes specifier_printf() refuse such
long results earlier.

Moreover, unit_full_string() and description field in sysuser now
refuse results longer than LONG_LINE_MAX. config_parse() already
refuses the line longer than LONG_LINE_MAX. Hence, it should be ok
to set the same value as the maximum length of the resolved string.

4 years agodns-domain: use DNS_LABEL_MAX at one more place
Yu Watanabe [Wed, 12 May 2021 01:12:18 +0000 (10:12 +0900)] 
dns-domain: use DNS_LABEL_MAX at one more place

4 years agocreds-util: introduce CREDENTIAL_NAME_MAX
Yu Watanabe [Wed, 12 May 2021 01:20:47 +0000 (10:20 +0900)] 
creds-util: introduce CREDENTIAL_NAME_MAX

4 years agofd-util: introduce FDNAME_MAX
Yu Watanabe [Wed, 12 May 2021 01:19:19 +0000 (10:19 +0900)] 
fd-util: introduce FDNAME_MAX

4 years agogpt: introduce GPT_LAVEL_MAX
Yu Watanabe [Wed, 12 May 2021 01:16:36 +0000 (10:16 +0900)] 
gpt: introduce GPT_LAVEL_MAX

4 years agotest: move test_specifier_printf() to test-specifier.c
Yu Watanabe [Sun, 9 May 2021 15:13:14 +0000 (00:13 +0900)] 
test: move test_specifier_printf() to test-specifier.c

4 years agospecifier: rename variable
Yu Watanabe [Sun, 9 May 2021 12:39:34 +0000 (21:39 +0900)] 
specifier: rename variable

4 years agospecifier: use SD_ID128_STRING_MAX
Yu Watanabe [Sun, 9 May 2021 12:23:32 +0000 (21:23 +0900)] 
specifier: use SD_ID128_STRING_MAX

4 years agobootctl: same entry path check case-insensitive
zsien [Mon, 10 May 2021 07:42:54 +0000 (15:42 +0800)] 
bootctl: same entry path check case-insensitive

Some motherboards convert the path to uppercase under certain circumstances
(e.g. after booting into the Boot Menu in the ASUS ROG STRIX B350-F GAMING).

4 years agohwdb: keyboard: D330 Touchpad toggle keymap
howl [Mon, 10 May 2021 22:24:11 +0000 (00:24 +0200)] 
hwdb: keyboard: D330 Touchpad toggle keymap

I have also seen that VIOS LTH17 has the exact same correction and it's also a SIPODEV composite hid device also through usb. In the D330 is a detachable keyboard. It's possible that a very generic way to apply this to at least affected sipodev keyboard could be found using the device ids, but needs info to do that and ensure all sipodev keyboard with the pertinent ids need it.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
4 years agohwdb: sensor: D330-IGM use pvr instead cvr
howl [Mon, 10 May 2021 22:31:28 +0000 (00:31 +0200)] 
hwdb: sensor: D330-IGM use pvr instead cvr

We use pvr match for efifb pitch and drm orientation quirk and in touchpad toggle keymap. Also seems most consistent with the devices here.

While at it, correct a typo, 81H3 and 81MD are product names not numbers, my bad.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
4 years agoMerge pull request #19562 from keszybz/flag-manips
Yu Watanabe [Tue, 11 May 2021 05:34:07 +0000 (14:34 +0900)] 
Merge pull request #19562 from keszybz/flag-manips

Fix flag manipulations in cryptsetup

4 years agounit-def: ensure UnitType enum fits any errno value
Lennart Poettering [Mon, 10 May 2021 16:43:07 +0000 (18:43 +0200)] 
unit-def: ensure UnitType enum fits any errno value

This is a follow-up for #19514 which changed unit_name_to_instance() to
return ENOMEM as a UnitType enum, even though the enum didn't
necessarily have range for that.

Let's extend the range explicitly, so that we can cover the full errno
range in it.

4 years agobootctl: extend --make-machine-id-directory= documentation a bit
Lennart Poettering [Mon, 10 May 2021 17:03:49 +0000 (19:03 +0200)] 
bootctl: extend --make-machine-id-directory= documentation a bit

The directory might not be created in the ESP but in the extended boot
loader partition, hence don#t claim otherwise.

Also, give a brief reason why the concept exists at all.

Link up machine-id man page.

Follow-up for: 6a3fff75baad94d9ebff1a6c7d1fb35448c44a81

4 years agotest-user-util: fix line break confusion
Lennart Poettering [Mon, 10 May 2021 17:19:02 +0000 (19:19 +0200)] 
test-user-util: fix line break confusion

This fixes some line-break confusion introduced by #11199
(c6cecb744b53561efd329309af7d02a3f9979ed1). It also restores a test with
GID_INVALID that was dropped, presumably by accident.

4 years agoMerge pull request #19575 from poettering/hwdb-whitespace-fix-again
Yu Watanabe [Tue, 11 May 2021 05:31:35 +0000 (14:31 +0900)] 
Merge pull request #19575 from poettering/hwdb-whitespace-fix-again

hwdb: remove trailing whitespace

4 years agoman: remove some trailing whitespace 19575/head
Lennart Poettering [Mon, 10 May 2021 21:08:58 +0000 (23:08 +0200)] 
man: remove some trailing whitespace

4 years agohwdb: remove trailing whitespace
Lennart Poettering [Mon, 10 May 2021 21:03:52 +0000 (23:03 +0200)] 
hwdb: remove trailing whitespace

4 years agohwdb: add accel matrix for One-netbook OneMix 3s (#19549)
gitm0 [Mon, 10 May 2021 20:20:58 +0000 (16:20 -0400)] 
hwdb: add accel matrix for One-netbook OneMix 3s (#19549)

4 years agoMerge pull request #19570 from poettering/userdb-followup-fixlets
Lennart Poettering [Mon, 10 May 2021 20:06:32 +0000 (22:06 +0200)] 
Merge pull request #19570 from poettering/userdb-followup-fixlets

two minor userdb fixes

4 years agoMerge pull request #19568 from poettering/userdbctl-dropin
Lennart Poettering [Mon, 10 May 2021 20:06:07 +0000 (22:06 +0200)] 
Merge pull request #19568 from poettering/userdbctl-dropin

userdbctl: add new --with-varlink= and --with-drop-in= flags

4 years agocryptsetup: fix flags check 19562/head
Zbigniew Jędrzejewski-Szmek [Mon, 10 May 2021 13:04:10 +0000 (15:04 +0200)] 
cryptsetup: fix flags check

FLAGS_SET() checks if *all* the bits are set. In this case we want to check
if *any* are. FLAGS_SET() was added in cde2f8605e0c3842f9a87785dd758f955f2d04ba,
but not a bug then yet, because with just one bit, both options are equivalent.
But when more bits were added later, this stopped being correct.

4 years agocryptsetup: initialize variable
Zbigniew Jędrzejewski-Szmek [Mon, 10 May 2021 13:02:34 +0000 (15:02 +0200)] 
cryptsetup: initialize variable

Fixup for cde2f8605e0c3842f9a87785dd758f955f2d04ba. Use PIN+PV because the
status quo ante was that we turned off "uv" and left "up" and "clientPin" in
its default values, which with yubikeys (i.e. the most popular hardware) meant
both "up" and "clientPin" were enabled by default.

Coverity CID#1453085.

4 years agouserdb: initialize .synthesize_root/.synthesize_nobody in generic code 19570/head
Lennart Poettering [Wed, 5 May 2021 20:27:37 +0000 (22:27 +0200)] 
userdb: initialize .synthesize_root/.synthesize_nobody in generic code

Let's initialize this at the same place for any iterator allocated. (Yes
not all types of iterator objects need this, but it's still nice to
share this trivial code at one place).

4 years agouserdb: return ESRCH if we didn't find a single varlink service
Lennart Poettering [Wed, 5 May 2021 20:06:34 +0000 (22:06 +0200)] 
userdb: return ESRCH if we didn't find a single varlink service

Clearly communicate to callers that we didn't find a single varlink
service, when a lookup is attempted. Note that the fallback's to NSS,
drop-ins and synthesis might eat up this error again, but we should
really make this case reasonably recognizable, in particular as our
various tools already handle this condition correctly and print a nice
message then.

4 years agoman: document new userdbctl features 19568/head
Lennart Poettering [Fri, 7 May 2021 10:18:07 +0000 (12:18 +0200)] 
man: document new userdbctl features

4 years agouserdbctl: add two new switches --with-dropin=/--with-varlink=
Lennart Poettering [Thu, 6 May 2021 14:38:38 +0000 (16:38 +0200)] 
userdbctl: add two new switches --with-dropin=/--with-varlink=

These directly correspond to the underlying flags. They are useful for
testing.

4 years agoMerge pull request #19548 from poettering/userdb-dropin
Lennart Poettering [Mon, 10 May 2021 15:53:45 +0000 (17:53 +0200)] 
Merge pull request #19548 from poettering/userdb-dropin

userdb: add support for loading user/group records from JSON drop-ins

4 years agodocs: link info about static user/group drop-in files from the relevant specs 19548/head
Lennart Poettering [Mon, 10 May 2021 12:57:18 +0000 (14:57 +0200)] 
docs: link info about static user/group drop-in files from the relevant specs

4 years agoman: document new userdbd features
Lennart Poettering [Fri, 7 May 2021 10:17:57 +0000 (12:17 +0200)] 
man: document new userdbd features

4 years agoman: update nss-systemd documentation with new features
Lennart Poettering [Fri, 7 May 2021 10:16:49 +0000 (12:16 +0200)] 
man: update nss-systemd documentation with new features

4 years agouserdbd: also listen on a varlink socket io.systemd.DropIn
Lennart Poettering [Thu, 6 May 2021 14:38:28 +0000 (16:38 +0200)] 
userdbd: also listen on a varlink socket io.systemd.DropIn

Let's explicitly support looking things up via dropin as a varlink
service.

4 years agouserdb: optionally read user/group/membership "dropins", too
Lennart Poettering [Fri, 30 Apr 2021 21:10:59 +0000 (23:10 +0200)] 
userdb: optionally read user/group/membership "dropins", too

4 years agoMerge pull request #19542 from yuwata/unit-after-socket
Zbigniew Jędrzejewski-Szmek [Mon, 10 May 2021 12:44:15 +0000 (14:44 +0200)] 
Merge pull request #19542 from yuwata/unit-after-socket

network, timesync, resolve: check bus is ready before emitting property change or signal

4 years agoMerge pull request #19556 from lucasrangit/network-wifi-interface-type-typos
Zbigniew Jędrzejewski-Szmek [Mon, 10 May 2021 11:55:07 +0000 (13:55 +0200)] 
Merge pull request #19556 from lucasrangit/network-wifi-interface-type-typos

network: update documentation and examples to use correct interface type and lookup command

4 years agoman: network: use `networkctl list` instead of `status` to list network interface... 19556/head
Lucas Magasweran [Mon, 10 May 2021 08:11:28 +0000 (10:11 +0200)] 
man: network: use `networkctl list` instead of `status` to list network interface type

To determine the network interface type for use in the `Type=` directive, it is more concise to use the `list` command. Whereas, the `status` command requires an interface parameter.

For example, on a RaspberryPi 4 the following shows that the `wlan0` interface type `wlan` is more coveniently listed by the `list` command.

```
root@raspberrypi4-64:~# networkctl list
IDX LINK  TYPE     OPERATIONAL SETUP
  1 lo    loopback carrier     unmanaged
  2 eth0  ether    routable    configured
  3 wlan0 wlan     off         unmanaged

3 links listed.
```

Whereas the `networkctl status` command doesn't include this information.

```
root@raspberrypi4-64:~# networkctl status
●   State: routable
  Address: 192.168.1.141 on eth0
           fd8b:8779:b7a4::f43 on eth0
           fd8b:8779:b7a4:0:dea6:32ff:febe:d1ce on eth0
           fe80::dea6:32ff:febe:d1ce on eth0
  Gateway: 192.168.1.1 (CZ.NIC, z.s.p.o.) on eth0
      DNS: 192.168.1.1

May 07 14:17:18 raspberrypi4-64 systemd-networkd[212]: eth0: Gained carrier
May 07 14:17:19 raspberrypi4-64 systemd-networkd[212]: eth0: Gained IPv6LL
May 07 14:17:19 raspberrypi4-64 systemd-networkd[212]: eth0: DHCPv6 address fd8b:8779:b7a4::f43/128 timeout preferred -1 valid -1
May 07 14:17:21 raspberrypi4-64 systemd-networkd[212]: eth0: DHCPv4 address 192.168.1.141/24 via 192.168.1.1
```

To get the interface type using the `status` command you need to specify an additional argument.

```
root@raspberrypi4-64:~# networkctl status wlan0
● 3: wlan0
                     Link File: /lib/systemd/network/99-default.link
                  Network File: n/a
                          Type: wlan
                         State: off (unmanaged)
                          Path: platform-fe300000.mmcnr
                        Driver: brcmfmac
                    HW Address: dc:a6:32:be:d1:cf (Raspberry Pi Trading Ltd)
                           MTU: 1500 (min: 68, max: 1500)
                         QDisc: noop
  IPv6 Address Generation Mode: eui64
          Queue Length (Tx/Rx): 1/1
```

4 years agoresolve: remove RRs from zones before an update
Roman Beranek [Fri, 30 Apr 2021 13:51:44 +0000 (15:51 +0200)] 
resolve: remove RRs from zones before an update

During an update of RRs, the records of each DNS-SD service are
replaced with new ones. However the old RRs can only be removed from
the mDNS scopes as long as they remain accessible from the DnssdService
structures, otherwise they remain stuck there.

Therefore the removal must take place before the update.

4 years agoWider range of options for selecting entries for systemd-journal-gatewayd
Samuel BF [Thu, 29 Apr 2021 19:45:53 +0000 (21:45 +0200)] 
Wider range of options for selecting entries for systemd-journal-gatewayd

Introducing --user, --system, --merge and --file flags, like for journalctl
and systemd-journal-upload.

4 years agonetwork: examples: use wlan for Type instead of wifi
Lucas Magasweran [Mon, 10 May 2021 08:09:56 +0000 (10:09 +0200)] 
network: examples: use wlan for Type instead of wifi

4 years agohwdb: Add Asus TP550LA
Harsh Barsaiyan [Sun, 9 May 2021 08:59:50 +0000 (14:29 +0530)] 
hwdb: Add Asus TP550LA

4 years agoMerge pull request #19436 from xnox/sbat
Dimitri John Ledkov [Mon, 10 May 2021 08:30:16 +0000 (09:30 +0100)] 
Merge pull request #19436 from xnox/sbat

boot: add optional EFI SBAT support

4 years agoMerge pull request #19545 from poettering/nss-systemd-shadow
Lennart Poettering [Mon, 10 May 2021 07:46:49 +0000 (09:46 +0200)] 
Merge pull request #19545 from poettering/nss-systemd-shadow

nss-systemd: also expose shadow/gshadow entries from userdb records

4 years agoMerge pull request #19298 from bluca/cryptsetup_nopass
Luca Boccassi [Sun, 9 May 2021 12:49:55 +0000 (13:49 +0100)] 
Merge pull request #19298 from bluca/cryptsetup_nopass

cryptsetup: add 'headless' parameter to skip password/pin query, allow pin-less enroll on FIDO2, support user presence/verification flags

4 years agoMerge pull request #19552 from yuwata/fix-typo-and-coverty-issues
Luca Boccassi [Sun, 9 May 2021 12:36:17 +0000 (13:36 +0100)] 
Merge pull request #19552 from yuwata/fix-typo-and-coverty-issues

Fix typo and coverity issues

4 years agotree-wide: fix typo 19552/head
Yu Watanabe [Sun, 9 May 2021 05:36:19 +0000 (14:36 +0900)] 
tree-wide: fix typo

4 years agouserdb: shorten code a bit
Yu Watanabe [Sun, 9 May 2021 05:33:20 +0000 (14:33 +0900)] 
userdb: shorten code a bit

Hopefully fixes CID#1452937.

4 years agotest: add one more assertion to make Coverty happy
Yu Watanabe [Sun, 9 May 2021 05:16:11 +0000 (14:16 +0900)] 
test: add one more assertion to make Coverty happy

Fixes CID#1452934.

4 years agonetworkd: correct batman-adv setting name (GatewayBandwidth) (#19539)
Jörg Deckert [Sat, 8 May 2021 12:39:32 +0000 (14:39 +0200)] 
networkd: correct batman-adv setting name (GatewayBandwidth) (#19539)

Co-authored-by: Jörg Deckert <jdeckert@unitas-network.de>
4 years agonss-systemd: synthesize NSS shadow/gshadow records from userdb, as well 19545/head
Lennart Poettering [Wed, 5 May 2021 14:11:26 +0000 (16:11 +0200)] 
nss-systemd: synthesize NSS shadow/gshadow records from userdb, as well

This ensures we not only synthesize regular paswd/group records of
userdb records, but shadow records as well. This should make sure that
userdb can be used as comprehensive superset of the classic
passwd/group/shadow/gshadow functionality.

4 years agonss-systemd: set USERDB_SUPPRESS_SHADOW flag when looking up user records
Lennart Poettering [Wed, 5 May 2021 13:53:07 +0000 (15:53 +0200)] 
nss-systemd: set USERDB_SUPPRESS_SHADOW flag when looking up user records

Setting the flags means we won#t try to read the data from /etc/shadow
when reading a user record, thus slightly making conversion quicker and
reducing the chance of generating MAC faults, because we needlessly
access a privileged resource. Previously, passing the flag didn't
matter, when converting our JSON records to NSS since the flag only had
an effect on whether to use NSS getspnam() and related calls or not. But
given that we turn off NSS anyway as backend for this conversion (since
we want to avoid NSS loops, where we turn NSS data to our JSON user
records, and then to NSS forever and ever) it was unnecessary to pass
it.

This changed in one of the previous commits however, where we added
support for reading user definitions from drop-in files, with separate
drop-in files for the shadow data.

4 years agostring-util: explicitly cast character to unsigned
Yu Watanabe [Sat, 8 May 2021 05:56:31 +0000 (14:56 +0900)] 
string-util: explicitly cast character to unsigned

This also adds comment why we cast to unsigned.

Follow-up for 7971f9030ae4bebe0d4a6845ed31584f8ab18103.

Addresses the comment https://github.com/systemd/systemd/pull/19544#discussion_r628472794.

4 years agorfc3046 implementation
Yegor Alexeyev [Wed, 21 Apr 2021 03:51:07 +0000 (06:51 +0300)] 
rfc3046 implementation

4 years agoresolve: check that bus is ready before emitting signal or property change 19542/head
Yu Watanabe [Fri, 7 May 2021 16:56:24 +0000 (01:56 +0900)] 
resolve: check that bus is ready before emitting signal or property change

4 years agotimesync: check that bus is ready before emitting property change
Yu Watanabe [Fri, 7 May 2021 16:55:08 +0000 (01:55 +0900)] 
timesync: check that bus is ready before emitting property change

4 years agonetwork: check that bus is ready at one more place
Yu Watanabe [Fri, 7 May 2021 16:54:07 +0000 (01:54 +0900)] 
network: check that bus is ready at one more place

4 years agolocal-addresses: wrap long comment
Yu Watanabe [Fri, 7 May 2021 16:10:31 +0000 (01:10 +0900)] 
local-addresses: wrap long comment

Follow-up for 54e6f97bc9931679aa9b895546621b15e0f464a4.

4 years agoMerge pull request #19438 from poettering/nspawn-uidmap
Lennart Poettering [Fri, 7 May 2021 22:12:20 +0000 (00:12 +0200)] 
Merge pull request #19438 from poettering/nspawn-uidmap

nspawn: add support for kernel 5.12 ID mapping mounts

4 years agoMerge pull request #19538 from poettering/userdbd-simplify-nss-listing
Lennart Poettering [Fri, 7 May 2021 22:12:01 +0000 (00:12 +0200)] 
Merge pull request #19538 from poettering/userdbd-simplify-nss-listing

userdbd: refactoring to simplify NSS user listing

4 years agoupdate TODO 19438/head
Lennart Poettering [Tue, 27 Apr 2021 16:33:23 +0000 (18:33 +0200)] 
update TODO

4 years agobash: update shell completion for new nspawn option
Lennart Poettering [Tue, 27 Apr 2021 16:33:27 +0000 (18:33 +0200)] 
bash: update shell completion for new nspawn option

4 years agoman: document new nspawn ID mapping mounts features
Lennart Poettering [Tue, 27 Apr 2021 16:31:24 +0000 (18:31 +0200)] 
man: document new nspawn ID mapping mounts features

4 years agonspawn: introduce --private-users-ownership=map|auto
Lennart Poettering [Tue, 27 Apr 2021 16:03:31 +0000 (18:03 +0200)] 
nspawn: introduce --private-users-ownership=map|auto

This adds a two new values to --private-users-ownership=: "map" and
"auto".

"map" exposes the kernel 5.12 idmap feature pretty much 1:1. It fails if
the kernel or used file system doesn't support ID mapping.

"auto" is a bit smarter: if we can make ID mapping work, we'll use it,
otherwise revert back to classic chown()ing. We'll also use chown()ing
if we detect that an image is already ID shifted, both to increase
compatibility with the status quo ante, and to simplify our codepaths,
since the mappings become a lot simpler if we only have to map from zero
to something else, instead of from anything to anything else.

The short -U switch, and --private-users=pick will now imply
--private-users-ownership=auto instead of
--private-users-ownership=chown, since the new logic should be the much
better choice.

4 years agonspawn: drop an unnecessary local variable
Lennart Poettering [Wed, 28 Apr 2021 15:24:34 +0000 (17:24 +0200)] 
nspawn: drop an unnecessary local variable

4 years agodissect-image: add support for optionally mounting images with idmapping on
Lennart Poettering [Wed, 28 Apr 2021 15:23:29 +0000 (17:23 +0200)] 
dissect-image: add support for optionally mounting images with idmapping on

4 years agomount-util: add a helper that can add an idmap to an existing mount
Lennart Poettering [Tue, 27 Apr 2021 15:27:45 +0000 (17:27 +0200)] 
mount-util: add a helper that can add an idmap to an existing mount

This makes use of the new kernel 5.12 APIs to add an idmap to a mount
point. It does so by cloning the mountpoint, changing it, and then
unmounting the old mountpoint, replacing it later with the new one.

4 years agonspawn: tighten userns UID shift/range checks
Lennart Poettering [Tue, 27 Apr 2021 15:25:51 +0000 (17:25 +0200)] 
nspawn: tighten userns UID shift/range checks

Let's add a helper that ensures the UID shift/range parameters actually
fit together.

4 years agoprocess-util: add option for cloning with CLONE_NEWUSER
Lennart Poettering [Tue, 27 Apr 2021 15:00:07 +0000 (17:00 +0200)] 
process-util: add option for cloning with CLONE_NEWUSER

This is useful for allocating a userns fd later on for use in idmapped
mounts.

4 years agomount-util: add helper that ensures something is a mount point
Lennart Poettering [Tue, 27 Apr 2021 14:13:51 +0000 (16:13 +0200)] 
mount-util: add helper that ensures something is a mount point

4 years agonspawn: replace boolean --private-user-chown by enum
Lennart Poettering [Tue, 27 Apr 2021 13:26:26 +0000 (15:26 +0200)] 
nspawn: replace boolean --private-user-chown by enum

This replaces --private-user-chown by an enum value
--private-user-ownership=off|chown. Changes otherwise very little.

This is mostly preparation for a follow-up commit adding a new "map"
mode, using kernel 5.12 UID mapping mounts.

Note that this does alter codeflow a bit: the new enum already knows
three different values instead of the old true/false pair. Besides "off"
and "chown" it knows -EINVAL, i.e. whenever the value wsn't set
explicitly. This value is changed to "off" or "chown" before use, thus
retaining compat to the status quo before, except it won't override
explicit configuration anymore. Thus, if you explicitly request
--private-user=pick you can now combine it wiht an explicit
--private-user-ownership=off if you like, which will give you a
container that runs under its own UID set, but the files will be owned
by the original image. Makes not much sense besids maybe debugging, but
if requested explicitly I think it's OK to implement.

4 years agonspawn: add high-level option for identity userns mapping
Lennart Poettering [Tue, 27 Apr 2021 12:37:19 +0000 (14:37 +0200)] 
nspawn: add high-level option for identity userns mapping

userns identity 1:1 mapping is a pretty useful concept since it isolates
capability sets between containers and hosts, even if it doesn't map
any uid ranges. Let's support it with an explicit concept.

(Note that this is identical to --private-users=0:65536 (which in turn
is identical to --private-users=0), but I think it makes to emphasize
this concept as a high-level one that makes sense to support.)

4 years agoFIDO2: if defined, check for FIDO_ERR_UV_BLOCKED 19298/head
Luca Boccassi [Wed, 21 Apr 2021 22:01:47 +0000 (23:01 +0100)] 
FIDO2: if defined, check for FIDO_ERR_UV_BLOCKED

Newer libfido versions added this error, so check for it since it
can help the user with a more specific message

4 years agoFIDO2: ask and record whether user verification was used to lock the volume
Luca Boccassi [Tue, 13 Apr 2021 12:12:46 +0000 (13:12 +0100)] 
FIDO2: ask and record whether user verification was used to lock the volume

Some tokens support authorization via fingerprint or other biometric
ID. Add support for "user verification" to cryptenroll and cryptsetup.
Disable by default, as it is still quite uncommon.

4 years agoFIDO2: ask and record whether user presence was used to lock the volume
Luca Boccassi [Mon, 12 Apr 2021 21:48:05 +0000 (22:48 +0100)] 
FIDO2: ask and record whether user presence was used to lock the volume

In some cases user presence might not be required to get _a_
secret out of a FIDO2 device, but it might be required to
the get actual secret that was used to lock the volume.
Record whether we used it in the LUKS header JSON metadata.
Let the cryptenroll user ask for the feature, but bail out if it is
required by the token and the user disabled it.
Enabled by default.

4 years agoFIDO2: support pin-less LUKS enroll/unlock
Luca Boccassi [Mon, 12 Apr 2021 20:06:59 +0000 (21:06 +0100)] 
FIDO2: support pin-less LUKS enroll/unlock

Closes: https://github.com/systemd/systemd/issues/19246
Some FIDO2 devices allow the user to choose whether to use a PIN or not
and will HMAC with a different secret depending on the choice.
Some other devices (or some device-specific configuration) can instead
make it mandatory.
Allow the cryptenroll user to choose whether to use a PIN or not, but
fail immediately if it is a hard requirement.
Record the choice in the JSON-encoded LUKS header metadata so that the
right set of options can be used on unlock.

4 years agocryptsetup: add 'headless' parameter to skip password/pin query
Luca Boccassi [Fri, 9 Apr 2021 19:43:10 +0000 (20:43 +0100)] 
cryptsetup: add 'headless' parameter to skip password/pin query

On headless setups, in case other methods fail, asking for a password/pin
is not useful as there are no users on the terminal, and generates
unwanted noise. Add a parameter to /etc/crypttab to skip it.

4 years agouserdbd: simplify logic for generating NSS listings 19538/head
Lennart Poettering [Thu, 6 May 2021 14:01:44 +0000 (16:01 +0200)] 
userdbd: simplify logic for generating NSS listings

So far we basically had two ways to iterate through NSS records: one via
the varlink IPC and one via the userdb.[ch] infra, with slightly
different implementations.

Let's clean this up, and always use userdb.[ch] also when resolving via
userdbd. The different codepaths for the NameServiceSwitch and the
Multiplexer varlink service now differ only in the different flags
passed to the userdb lookup.

Behaviour shouldn't change by this. This is mostly refactoring, reducing
redundant codepaths.

4 years agouserdb: add new flag for excluding varlink data in lookups
Lennart Poettering [Thu, 6 May 2021 13:51:30 +0000 (15:51 +0200)] 
userdb: add new flag for excluding varlink data in lookups

This is useful to later-on use the userdb infra for only some sources.

4 years agouserdb: rename userdb lookup flags a bit
Lennart Poettering [Thu, 6 May 2021 13:46:30 +0000 (15:46 +0200)] 
userdb: rename userdb lookup flags a bit

Let's use "exclude" for flags that really exclude records from our
lookup. Let's use "avoid" referring to concepts that when flag is set
we'll not use but we have a fallback path for that should yield the same
result. Let' use "suppress" for suppressing partial info, even if we
return the record otherwise.

So far we used "avoid" for all these cases, which was confusing.

Whiel we are at it, let's reassign the bits a bit, leaving some space
for bits follow-up commits are going to add.

4 years agoAdded Teclast X4 ACCEL_MOUNT_MATRIX (#19540)
Marco Antonio Mauro [Fri, 7 May 2021 20:17:25 +0000 (22:17 +0200)] 
Added Teclast X4 ACCEL_MOUNT_MATRIX (#19540)

4 years agostring-util: fix build error on aarch64
Yu Watanabe [Fri, 7 May 2021 19:13:12 +0000 (04:13 +0900)] 
string-util: fix build error on aarch64

This fixes the following error:
```
In file included from ../src/basic/af-list.h:6,
                 from ../src/basic/af-list.c:7:
../src/basic/string-util.h: In function 'char_is_cc':
../src/basic/string-util.h:133:19: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  133 |         return (p >= 0 && p < ' ') || p == 127;
      |                   ^~
cc1: all warnings being treated as errors
```

Fixes #19543.

4 years agotest: fix partition check in TEST-58-REPART
Frantisek Sumsal [Fri, 7 May 2021 15:42:14 +0000 (17:42 +0200)] 
test: fix partition check in TEST-58-REPART

Follow-up to 1c41c1dc346dd0d5d235fe0866bbe2d9be924dcd.

4 years agoMerge pull request #18863 from keszybz/cmdline-escaping
Lennart Poettering [Fri, 7 May 2021 15:29:39 +0000 (17:29 +0200)] 
Merge pull request #18863 from keszybz/cmdline-escaping

Escape command lines properly

4 years agoMerge pull request #19134 from poettering/outbound-special-hostname
Zbigniew Jędrzejewski-Szmek [Fri, 7 May 2021 15:15:22 +0000 (17:15 +0200)] 
Merge pull request #19134 from poettering/outbound-special-hostname

introduce a new synthetic hostname "_outbound" that maps to "the" local IP address

4 years agonss-systemd: make llvm work-around for used _cleanup_ explicit
Lennart Poettering [Wed, 5 May 2021 14:06:56 +0000 (16:06 +0200)] 
nss-systemd: make llvm work-around for used _cleanup_ explicit

4 years agouserdbd: reverse which path is a socket and which a symlink
Lennart Poettering [Thu, 6 May 2021 14:41:05 +0000 (16:41 +0200)] 
userdbd: reverse which path is a socket and which a symlink

userdbd listens on "two" sockets, that are actually the same: one is a
real AF_UNIX socket in the fs, and the other is a symlink to it.

So far, when userdbd was started from the command line it would make one
a symlink and the other a real socket, but when invoked via unit files
they'd be swapped, i.e. the other would be a symlink and the one a real
socket.

Let's bring this in line.

Since the "io.systemd.Multiplexer" is our main interface, let's make it
the one exposed as socket, and then make "io.systemd.NameServiceSwitch"
a symlink to it. Or in other words, let's adjust the C code to match the
unit file.

4 years agofileio: optionally, return discovered path of file in search_and_fopen()
Lennart Poettering [Mon, 3 May 2021 16:18:09 +0000 (18:18 +0200)] 
fileio: optionally, return discovered path of file in search_and_fopen()

4 years agoboot: add optional EFI SBAT support 19436/head
Dimitri John Ledkov [Tue, 27 Apr 2021 15:53:53 +0000 (16:53 +0100)] 
boot: add optional EFI SBAT support

Add SBAT support, when -Dsbat-distro value is specified. One can use
-Dsbat-distro=auto for autodetection of all sbat options. Many meson configure
options added to customize SBAT CSV values, but sensible defaults are auto
detected by default. SBAT support is required if shim v15+ is used to load
systemd-boot binary or kernel.efi (Type II BootLoaderSpec).

Fixes #19247

4 years agoMerge pull request #19391 from poettering/dissect-grow
Zbigniew Jędrzejewski-Szmek [Fri, 7 May 2021 13:04:55 +0000 (15:04 +0200)] 
Merge pull request #19391 from poettering/dissect-grow

optionally, grow file systems to partition size when mounting them via GPT auto-discovery

4 years agoMerge pull request #19531 from poettering/nss-systemd-fixes
Lennart Poettering [Fri, 7 May 2021 09:15:53 +0000 (11:15 +0200)] 
Merge pull request #19531 from poettering/nss-systemd-fixes

nss-systemd: two minor fixes

4 years agonss-systemd: properly handle empty membership lists 19531/head
Lennart Poettering [Wed, 5 May 2021 16:57:30 +0000 (18:57 +0200)] 
nss-systemd: properly handle empty membership lists

When we are queried for membership lists on a system that has exactly
zero, then we'll return ESRCH immediately instead of at EOF. Which is
OK, but we need to handle this in various places, and not get confused
by it.

4 years agostring-util: add strextendf() helper, that allows extending some allocated string...
Lennart Poettering [Wed, 5 May 2021 07:56:46 +0000 (09:56 +0200)] 
string-util: add strextendf() helper, that allows extending some allocated string via a format string

It's not going to be efficient if called in inner loops, but it's oh so
handy, and we have some code that does this:

   asprintf(&p, "%s…", b, …);
   free(b);
   b = TAKE_PTR(p);

which can now be replaced by the quicker and easier to read:

   strextendf(&p, "…", …);

4 years agonspawn: fix the sections .nspawn settings are placed in
Lennart Poettering [Wed, 5 May 2021 12:13:40 +0000 (14:13 +0200)] 
nspawn: fix the sections .nspawn settings are placed in

The actual section names are quite different from what the comment so
far suggested. Fix that.

4 years agonss-systemd: reset the right field
Lennart Poettering [Wed, 5 May 2021 14:05:43 +0000 (16:05 +0200)] 
nss-systemd: reset the right field

4 years agoMerge pull request #19523 from bluca/coredump_meta_fixes
Lennart Poettering [Thu, 6 May 2021 20:34:53 +0000 (22:34 +0200)] 
Merge pull request #19523 from bluca/coredump_meta_fixes

docs/COREDUMP_PACKAGE_METADATA.md: Add debuginfod key

4 years agouser-util: add generic definition for special password hash values in /etc/passwd...
Lennart Poettering [Wed, 5 May 2021 13:32:43 +0000 (15:32 +0200)] 
user-util: add generic definition for special password hash values in /etc/passwd + /etc/shadow

Let's add three defines for the 3 special cases of passwords.

Some of our tools used different values for the "locked"/"invalid" case,
let's settle on using "!*" which means the password is both locked *and*
invalid.

Other tools like to use "!!" for this case, which however is less than
ideal I think, since the this could also be a considered an entry with
an empty password, that can be enabled again by unlocking it twice.

4 years agoFix indent prefix being used as a suffix in systemd-analyze dump for some properties
Mike Kazantsev [Thu, 6 May 2021 14:15:04 +0000 (19:15 +0500)] 
Fix indent prefix being used as a suffix in systemd-analyze dump for some properties

4 years agoMerge pull request #19527 from poettering/userdb-fixes
Lennart Poettering [Thu, 6 May 2021 19:54:42 +0000 (21:54 +0200)] 
Merge pull request #19527 from poettering/userdb-fixes

various minor userdb fixes

4 years agouserdb: honour USERDB_AVOID_SHADOW flag also when iterating 19527/head
Lennart Poettering [Mon, 3 May 2021 18:06:15 +0000 (20:06 +0200)] 
userdb: honour USERDB_AVOID_SHADOW flag also when iterating

4 years agouserdb: fix typo in comment
Lennart Poettering [Fri, 30 Apr 2021 21:10:10 +0000 (23:10 +0200)] 
userdb: fix typo in comment

4 years agouserdb: add missing 'else'
Lennart Poettering [Fri, 30 Apr 2021 21:09:35 +0000 (23:09 +0200)] 
userdb: add missing 'else'