1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-25 10:04:04 +03:00

54822 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
7e8facb36b port string_hashsum from libgcrypt to openssl^gcrypt
This allows resolved and importd to be built without libgcrypt.

Note that we now say either 'cryptographic library' or 'cryptolib'.

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2021-12-01 12:36:57 +01:00
Kevin Kuehler
fc169a6fb2 basic/openssl-util: Add sha256 hash wrapper 2021-12-01 12:36:57 +01:00
Kevin Kuehler
1736344e9e resolve: Port nsec3 code to openssl^gcrypt
Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2021-12-01 12:36:45 +01:00
Kevin Kuehler
1cd7a2c172 resolve: Port dnskey verification by ds to openssl^gcrypt
Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2021-11-30 23:00:21 +01:00
Kevin Kuehler
0351cbb9e4 resolve: Port dnssec verify from gcrypt to openssl^gcrypt
Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2021-11-30 23:00:21 +01:00
Zbigniew Jędrzejewski-Szmek
667dac6ed6 resolved: split out function to hash signature
dnssec_verify_rrset() is just too long.
2021-11-30 23:00:21 +01:00
Zbigniew Jędrzejewski-Szmek
cc1ecbaaf3 resolved: split out function to generate signature
dnssec_verify_rrset() is just too long.
2021-11-30 23:00:21 +01:00
Kevin Kuehler
bf4b1adf6f resolve: Add coverage for dnssec ecdsa (rfc6605) 2021-11-30 23:00:21 +01:00
Zbigniew Jędrzejewski-Szmek
6214d42bd2 import: port importd from libgcrypt to openssl^gcrypt
This is heavily based on Kevin Kuehler's work, but the logic is also
significantly changed: instead of a straighforward port to openssl, both
versions of the code are kept, and at compile time we pick one or the other.

The code is purposefully kept "dumb" — the idea is that the libgcrypt codepaths
are only temporary and will be removed after everybody upgrades to openssl 3.
Thus, a separate abstraction layer is not introduced. Instead, very simple
ifdefs are used to select one or the other. If we added an abstraction layer,
we'd have to remove it again afterwards, and it don't think it makes sense to
do that for a temporary solution.

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>

# Conflicts:
#	meson.build
2021-11-30 23:00:21 +01:00
Zbigniew Jędrzejewski-Szmek
57633d2376 meson: add config setting to select between openssl and gcrypt
This is not pretty, but it is supposed to be only a temporary measure.
2021-11-30 23:00:21 +01:00
Kevin Kuehler
ade99252e2 repart: port to our home-grown hmac_sha256
This reduces dependencies. The speed of the code here is uimportant, because we
hash only a tiny amount of input data.

Debian and Ubuntu currently build without repart, see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976959
> repart requires openssl and so far I tried to avoid linking against
> both gnutls and openssl.

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2021-11-30 23:00:21 +01:00
Yu Watanabe
528da64a0c network: address: drop deprecated temporary address
Fixes #19838.
2021-11-30 18:17:23 +01:00
Zbigniew Jędrzejewski-Szmek
8592a0d799
Merge pull request #21578 from bluca/json_spec
docs: clarify JSON terms in COREDUMP_PACKAGE_METADATA
2021-11-30 16:36:36 +01:00
Rasmus Villemoes
4ced52595f sysusers: avoid creating spurious "nobody" group
On distros using Debian's base-passwd, the name of the group with gid 65534 is
nogroup. Currently, systemd-sysusers creates a spurious "nobody" group

  systemd-sysusers[243]: Creating group nobody with gid 996

That's both confusing and redundant, as the nobody user still has primary group
65534 aka nogroup, and the nobody group simply goes completely unused.

So explicitly specify the primary group of the nobody user, and add a line
ensuring that that group exists.

This is not a problem for Debian (or Ubuntu) itself, as they add their own
version of basic.conf in their systemd build logic. But it appears on for
example Yocto/OpenEmbedded.
2021-11-30 16:16:25 +01:00
Luca Boccassi
3d170ca580
Merge pull request #21573 from keszybz/one-more-table-sort
One more table sort and man page updates
2021-11-30 14:52:08 +00:00
Luca Boccassi
45f822ceb3 docs: clarify ELF note usage in COREDUMP_PACKAGE_METADATA 2021-11-30 14:42:43 +00:00
Yu Watanabe
b224530f5f
Merge pull request #21559 from jcg190701/main
fix ConditionDirectoryNotEmpty when it comes to a Non-directory file
2021-11-30 22:34:21 +09:00
Zbigniew Jędrzejewski-Szmek
5143e657d2 basic/architecture: sort and reindent one more table
No idea why I didn't do this one in the previous round.
2021-11-30 13:54:29 +01:00
Zbigniew Jędrzejewski-Szmek
77e289abb4 man: fix typo
Follow-up for c896eb7ad65f4dbe968fdf01fa51e9ef4d2d11ed.
2021-11-30 13:54:27 +01:00
Zbigniew Jędrzejewski-Szmek
17cd1f627b man: add missing plural and reorder sentence
We shouldn't explain what a value does before listing valid values…

Follow-up for 4f1ac4a38d1adf08f849af1a61c7a248932d8e13.
2021-11-30 13:52:32 +01:00
Luca Boccassi
bedd92b956 docs: clarify JSON terms in COREDUMP_PACKAGE_METADATA 2021-11-30 12:36:16 +00:00
Yu Watanabe
a6f44d610c tree-wide: fix typo 2021-11-30 12:30:07 +00:00
Luca Boccassi
dc063e0978
Merge pull request #21568 from yuwata/network-fix-json-format
network: fix json format
2021-11-30 09:13:03 +00:00
jiangchuangang
7c4c9948d0 fix ConditionPathIsReadWrite when path does not exist. 2021-11-30 16:47:54 +08:00
Yu Watanabe
718f0a74ab man: fix copy-and-paste mistake 2021-11-30 09:29:51 +01:00
jiangchuangang
193105f2d0 fix ConditionDirectoryNotEmpty when it comes to a Non-directory file 2021-11-30 09:16:15 +08:00
Yu Watanabe
94f0bd624b test-network: add more basic tests for network json formats 2021-11-30 10:03:51 +09:00
Yu Watanabe
d27e9b0f83 network: json: add missing initialization
Fixes CID#1466513.
2021-11-30 10:03:51 +09:00
Yu Watanabe
b89931ba28 json: make JSON_BUILD_PAIR_IN_ADDR_NON_NULL or friends handle NULL gracefully
Fixes #21567.
2021-11-30 10:03:51 +09:00
Amir Omidi
a41699c90b
systemctl: display how long a systemd service will run (#21494) 2021-11-30 09:24:18 +09:00
Zbigniew Jędrzejewski-Szmek
8e560cd090
Merge pull request #21532 from yuwata/network-json-more
network: add more json entries
2021-11-29 21:26:56 +01:00
Zbigniew Jędrzejewski-Szmek
08e70b4a21
Merge pull request #21541 from bluca/analyze_security_profile
analyze: add --profile switch to security verb
2021-11-29 21:23:34 +01:00
Jan Janssen
0289441e09 sd-boot: Fix assert failure in random-seed.c
Fixes: #21556
2021-11-30 03:10:03 +09:00
Michal Sekletar
c29e6a9530 unit: add jobs that were skipped because of ratelimit back to run_queue
Assumption in edc027b was that job we first skipped because of active
ratelimit is still in run_queue. Hence we trigger the queue and dispatch
it in the next iteration. Actually we remove jobs from run_queue in
job_run_and_invalidate() before we call unit_start(). Hence if we want
to attempt to run the job again in the future we need to add it back
to run_queue.

Fixes #21458
2021-11-30 03:06:35 +09:00
Nacho Barrientos
081f44859a Byte order to host before using the lifetime
I've seen this in `NetworkManager-1.34.0-0.3.el8.x86_64` (latest in CentOS
Stream 8 at the time of writing this message) which does not use the latest
Systemd but probably the code base is the same (see
51f93e00a2).

Before the patch:

```
libsystemd: eth0: DHCPv6 client: T1 expires in 34y 3w 6d 45min 31s
libsystemd: eth0: DHCPv6 client: T2 expires in 54y 5month 3w 3d 23h 20min 35s
```

After the patch:

```
libsystemd: eth0: DHCPv6 client: T1 expires in 3d 7h 58min 3s
libsystemd: eth0: DHCPv6 client: T2 expires in 5d 2h 26min 50s
```

same box (x86_64 system) and same DHCPv6 server.

This regression has likely been introduced by 8a8955507af363c31297bbc5df79852db4ad39d6.
2021-11-30 03:05:02 +09:00
Marco Scardovi
55dad038b2 Add missing greater than/less than tab on some HP
Some HP keyboards (like https://h30434.www3.hp.com/t5/image/serverpage/image-id/203235i01AD626584587DA1?v=v2) have <> between AltGr and left arrow. This add the fix and make it working again
2021-11-29 16:26:27 +00:00
Zbigniew Jędrzejewski-Szmek
8fb444011e
Merge pull request #21534 from yuwata/udev-accept-longer-hw-address
udev/net: accept longer HW address
2021-11-29 14:00:52 +01:00
Zbigniew Jędrzejewski-Szmek
4b658ff651
Merge pull request #21531 from keszybz/log2-tables
Optimize log2 tables
2021-11-29 13:58:49 +01:00
Zbigniew Jędrzejewski-Szmek
1e135e9780
Merge pull request #21537 from medhefgo/boot-sbat
meson: Default to sbat-distro=auto
2021-11-29 11:30:25 +01:00
Luca Boccassi
c0775eb787 coredump: fix parsing metadata without access to executable
This was broken in a subtle way: we'd get an ELF ref, but not the right one,
so no metadata note would be found.
Change the parsing function to return 1 when it finds something, so that
we can return early only when that happens.
2021-11-29 11:25:48 +01:00
Zbigniew Jędrzejewski-Szmek
48c67fdfb1 meson: upgrade warning about bad init values to an error
We never expect to get this warning, it is most likely to occur if
somebody messes up enumeration values.
2021-11-29 11:16:23 +01:00
Zbigniew Jędrzejewski-Szmek
8a7da94082 networkd: replace a table with log2 fields by a list 2021-11-29 11:16:15 +01:00
Zbigniew Jędrzejewski-Szmek
0580badc15 networkd: align table 2021-11-29 11:16:07 +01:00
Zbigniew Jędrzejewski-Szmek
19aa7eeb6c networkd: replace a table with log2 fields by a list 2021-11-29 11:15:58 +01:00
Zbigniew Jędrzejewski-Szmek
7396e01484 networkd: replace a table with log2 fields by a list 2021-11-29 11:15:50 +01:00
Zbigniew Jędrzejewski-Szmek
67b65e1104 networkd: replace a table with log2 fields by a list
The code looks a bit more complicated, but the compiler generates a simpler and
more compact text.

An additional advantage is that if any of the fields were repeating or not
power-of-two, the compiler would warn about an overridden entry in the table.
2021-11-29 11:15:31 +01:00
Zbigniew Jędrzejewski-Szmek
f4ada1b42f basic/util: add macro variants of log2 functions
The macro variants can be used in static initializers.

The same guard against calling __builtin_clz(0) is added as for
__builtin_clzll(0), since that's undefined behaviour too. Our code
wouldn't call it, but this avoids a potential pitfall with the macro.
All variants map 0→0. Otherwise we'd often have to handle 0 specially
in callers.

__builtin_clz takes unsigned as the argument, so there's no LOG2I macro.
2021-11-29 11:12:52 +01:00
Topi Miettinen
ddf127cda4 pam_systemd: Check also abstract socket for X11
It seems that `pam_systemd` was the only thing left that wanted to use sockets
in file system path `/tmp/.X11-unix/X*`. X11 apps actually prefer using the
abstract socket version.

This allows running Xserver with `-nolisten tcp -nolisten unix`, which makes
the server only listen to an abstract socket.

Also in my setup, Xserver is running as a separate system service instead of
starting from display manager service, and now `PrivateTmp=yes` can be used for
both. The file system of the display manager service is inherited by user apps
and now their `/tmp` will be separate from `/tmp` of PID1 namespace as well as
`/tmp` of Xserver.
2021-11-28 18:24:39 +00:00
Jan Janssen
52ccce6ac5 meson: Rename compile_args to efi_cfalgs
compile_args sounds like it could be used for other targets besides
efi binaries. This also keeps the name in line with efi_ldflags.
2021-11-28 16:22:15 +01:00
Jan Janssen
252b6b1bfd meson: Default to sbat-distro=auto
Any recent shim will refuse starting an image that does not have an sbat section
and will do so with a generic "Security Violation" message. And it is very easy
to forget passing -Dsbat-distro=auto to meson when creating a fresh build dir.

Adding sbat info when shim is not used or secure boot is disabled does not hurt
anyone, so default to auto. This still ensures to not add auto-detected info in
case we are cross building.
2021-11-28 16:20:54 +01:00