1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-09 13:57:42 +03:00

51163 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
01d0123f04
Merge pull request #19506 from xnox/ship-stub-elf
boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stub
2021-05-12 09:45:36 +02:00
Lennart Poettering
dc90ad6825
Merge pull request #19581 from yuwata/specifier-refuse-too-long-results
specifier: refuse too long results
2021-05-12 09:42:08 +02:00
Lennart Poettering
041ea9f9bb netlink,network: drop "const" from opaque object parameters in supposed-to-be-public APIs
This drops the "const" specifier from the opaque object parameters to
various functions in our API.

This effectively reverts #19292 and more.

Why drop this? Our public APIs should not leak too much information
about how stuff is implemented internally. In our public APIs we
shouldn't give too many guarantees we don#t want to necessarily keep.
Specifically: in many cases it makes sense that getters actually
generate/parse/allocate data on the fly, storing/caching the result
internally, to speed things up, do things lazily or to track memory
allocations so that they can be freed later. Doing this means we need to
change the objects, even though the getters are semantically a read
operation.

We want to retain the freedom that we can change things around
internally. By exposing the objects as "const" we remove a good chunk of
that, for little gain.

See sd_bus_creds_get_description() for a real example of a getter that
implicitly caches and thus modifies the relevant object.

This removes the "const" decorators from sd-dhcp and sd-netlink, two
APIs that we intend to make public eventually even though they still are
not, leaving us the chance to still fix this before it becomes set in
stone.
2021-05-12 16:19:58 +09:00
Yu Watanabe
0653649202 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.
2021-05-12 10:26:07 +09:00
Yu Watanabe
678d6b4f92 dns-domain: use DNS_LABEL_MAX at one more place 2021-05-12 10:21:22 +09:00
Yu Watanabe
3d862ff066 creds-util: introduce CREDENTIAL_NAME_MAX 2021-05-12 10:20:47 +09:00
Yu Watanabe
ae3f4bae68 fd-util: introduce FDNAME_MAX 2021-05-12 10:19:19 +09:00
Yu Watanabe
6001df6594 gpt: introduce GPT_LAVEL_MAX 2021-05-12 10:16:36 +09:00
Yu Watanabe
f4767dc081 test: move test_specifier_printf() to test-specifier.c 2021-05-12 10:09:11 +09:00
Yu Watanabe
695c5fee6d specifier: rename variable 2021-05-12 10:09:11 +09:00
Yu Watanabe
567097848c specifier: use SD_ID128_STRING_MAX 2021-05-12 10:09:11 +09:00
zsien
5c2e595767 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).
2021-05-11 14:27:44 +02:00
howl
fd37987da5 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>
2021-05-11 08:54:04 +02:00
howl
44cf2e6022 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>
2021-05-11 08:53:21 +02:00
Yu Watanabe
690ceca8dc
Merge pull request #19562 from keszybz/flag-manips
Fix flag manipulations in cryptsetup
2021-05-11 14:34:07 +09:00
Lennart Poettering
c37f7963b1 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.
2021-05-11 14:33:11 +09:00
Lennart Poettering
7eea910d24 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
2021-05-11 14:32:42 +09:00
Lennart Poettering
51b274d881 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.
2021-05-11 14:32:24 +09:00
Yu Watanabe
b35028ebaa
Merge pull request #19575 from poettering/hwdb-whitespace-fix-again
hwdb: remove trailing whitespace
2021-05-11 14:31:35 +09:00
Lennart Poettering
9854ac4af4 man: remove some trailing whitespace 2021-05-10 23:10:44 +02:00
Lennart Poettering
23a2badf74 hwdb: remove trailing whitespace 2021-05-10 23:03:52 +02:00
gitm0
cbec0bfa5d
hwdb: add accel matrix for One-netbook OneMix 3s (#19549) 2021-05-10 22:20:58 +02:00
Lennart Poettering
aa67e45b4b
Merge pull request #19570 from poettering/userdb-followup-fixlets
two minor userdb fixes
2021-05-10 22:06:32 +02:00
Lennart Poettering
708274eef3
Merge pull request #19568 from poettering/userdbctl-dropin
userdbctl: add new --with-varlink= and --with-drop-in= flags
2021-05-10 22:06:07 +02:00
Zbigniew Jędrzejewski-Szmek
031e7e3241 test-efi-create-disk: support /boot/efi
Most of our tools allow EFI mount to be on /boot/efi. Do the same here.
2021-05-10 20:35:31 +02:00
Zbigniew Jędrzejewski-Szmek
bdf5d8d4c0 test-efi-create-disk: shellcheckify 2021-05-10 20:34:08 +02:00
Zbigniew Jędrzejewski-Szmek
4f3dca78bb meson: rework test-efi-disk.img creation to not require variables
The primary goal is to make the name of the custom_target() rule match
the output file again. Having them different is confusing.
2021-05-10 20:28:24 +02:00
Zbigniew Jędrzejewski-Szmek
9d59f5b2f9 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.
2021-05-10 19:53:52 +02:00
Zbigniew Jędrzejewski-Szmek
8205c151b3 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.
2021-05-10 19:52:06 +02:00
Lennart Poettering
40fb3503f4 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).
2021-05-10 18:11:06 +02:00
Lennart Poettering
58dbf4c925 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.
2021-05-10 18:08:38 +02:00
Lennart Poettering
c96a301213 man: document new userdbctl features 2021-05-10 18:02:50 +02:00
Lennart Poettering
59092877b3 userdbctl: add two new switches --with-dropin=/--with-varlink=
These directly correspond to the underlying flags. They are useful for
testing.
2021-05-10 18:02:50 +02:00
Lennart Poettering
a346a34f7f
Merge pull request #19548 from poettering/userdb-dropin
userdb: add support for loading user/group records from JSON drop-ins
2021-05-10 17:53:45 +02:00
Lennart Poettering
f2147ed5ea docs: link info about static user/group drop-in files from the relevant specs 2021-05-10 14:59:26 +02:00
Lennart Poettering
62a90b48d0 man: document new userdbd features 2021-05-10 14:59:05 +02:00
Lennart Poettering
71b5738030 man: update nss-systemd documentation with new features 2021-05-10 14:58:44 +02:00
Lennart Poettering
8fbb1941f1 userdbd: also listen on a varlink socket io.systemd.DropIn
Let's explicitly support looking things up via dropin as a varlink
service.
2021-05-10 14:58:39 +02:00
Lennart Poettering
85f088abe8 userdb: optionally read user/group/membership "dropins", too 2021-05-10 14:58:07 +02:00
Zbigniew Jędrzejewski-Szmek
2d0b71b6f6
Merge pull request #19542 from yuwata/unit-after-socket
network, timesync, resolve: check bus is ready before emitting property change or signal
2021-05-10 14:44:15 +02:00
Zbigniew Jędrzejewski-Szmek
8808d3289e
Merge pull request #19556 from lucasrangit/network-wifi-interface-type-typos
network: update documentation and examples to use correct interface type and lookup command
2021-05-10 13:55:07 +02:00
Lucas Magasweran
2480ca95ba 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
```
2021-05-10 13:40:33 +02:00
Roman Beranek
ee3713b71d 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.
2021-05-10 12:29:48 +02:00
Samuel BF
c362a432af 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.
2021-05-10 12:20:27 +02:00
Lucas Magasweran
b419e8776b network: examples: use wlan for Type instead of wifi 2021-05-10 11:28:52 +02:00
Harsh Barsaiyan
2c324dd161 hwdb: Add Asus TP550LA 2021-05-10 11:25:15 +02:00
Dimitri John Ledkov
36c5f589fb
boot/efi: add --build-id=sha1 to ELF efi objects
As it is not nice to ship ELF binary without a note.gnu.build-id set.
2021-05-10 09:36:04 +01:00
Dimitri John Ledkov
7840d7af22
boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stub
Binutils for non-x86 architectures currently does not support PE binaries. Thus
linux.efi.stub is useless on those, as one cannot use any tooling to add
linux/cmdline/splash sections to it. In addition to PE linux.efi.stub also
install ELF linux.elf.stub, such that one can use objcopy ELF target to copy in
linux/cmdline/splash sections and then convert the result to a PE binary.
2021-05-10 09:35:59 +01:00
Dimitri John Ledkov
67f7244928
Merge pull request #19436 from xnox/sbat
boot: add optional EFI SBAT support
2021-05-10 09:30:16 +01:00
Lennart Poettering
2baec39665
Merge pull request #19545 from poettering/nss-systemd-shadow
nss-systemd: also expose shadow/gshadow entries from userdb records
2021-05-10 09:46:49 +02:00