Commit Graph
55464 Commits
Author SHA1 Message Date
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
https://github.com/NetworkManager/NetworkManager/commit/51f93e00a23fbd09f5ad96da6290bf4ca737d46a).

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 8a8955507a.
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
Jan Janssen 0a15a824d2 sd-boot: Use non-failing allocators everywhere else 2021-11-29 16:20:45 +01:00
Jan Janssen ccfbdbdcab sd-boot: Simplify path creation 2021-11-29 16:20:45 +01:00
Jan Janssen 4f94341504 sd-boot: Make stra_to_path/stra_to_str non-failing 2021-11-29 16:20:45 +01:00
Jan Janssen da76f890aa sd-boot: Use non-failing allocators in boot.c 2021-11-29 16:20:45 +01:00
Jan Janssen 484ddd2926 sd-boot: Add non-failing allocators 2021-11-29 16:20:32 +01:00
Jan Janssen fd86250c1e sd-boot: Always add TextInputEx to wait queue if available 2021-11-29 14:42:18 +01:00
Jan Janssen b848b7e166 sd-boot: Add LTO support 2021-11-29 14:41:46 +01:00
Jan Janssen 0e3bcb02d2 sd-boot: Let compiler figure out libgcc location
Since we now let the compiler call the linker for us, we can just
rely on it to find the right (static) libgcc to use.
2021-11-29 14:33:26 +01:00
Jan Janssen fe330f02df sd-boot: Let the compiler invoke the linker for us
For LTO to work, the linker has to be called with some magic sauce arguments.
And the easiest way to get those is to just let the compiler to the job for us.
2021-11-29 14:24:56 +01: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
Luca Boccassi 64a05587ce Merge pull request #21549 from yuwata/network-netdev-mac-address-none
network: netdev: make MACAddress= take 'none'
2021-11-28 12:36:35 +00:00
Jan Janssen 5a45a6bbb6 test-parse-util: Add SI-suffix parse_size tests 2021-11-28 11:48:34 +01:00
Jan Janssen d19bff65ee test-namespace: Convert to TEST macro 2021-11-28 11:48:34 +01:00
Jan Janssen 353b980204 test-barrier: Convert to TEST macro 2021-11-28 11:48:34 +01:00
Jan Janssen 26e555cbba test: Convert to TEST/TEST_RET macros
Note that test-cgroup-mask, test-cgroup-unit-default and test-unit-name will now
report being skipped instead of reporting success if not run under systemd.
2021-11-28 11:46:26 +01:00
Jan Janssen 0578dfe3eb test: Add sd_booted condition test to TEST macro
Note that this will only report test skips if they use TEST_RET macro.
Regular TEST macros can still be skipped, but this will not be reported
back to main();
2021-11-28 11:42:28 +01:00
Jan Janssen 4c0acc0761 test: Add TEST_RET macro
This declares a test function whose return code will be passed from
main(). The first test that does not return EXIT_SUCCESS wins.
2021-11-28 11:40:45 +01:00
Yu Watanabe 5b8bdd20c6 network/netdev: generate persistent MAC address for batadv and bridge
This mostly reverts 489f01f806 and
deb2cfa4c6.

As now MACAddress=none is supported. So, users can still disable MAC
address assignment.
2021-11-28 12:04:55 +09:00
Yu Watanabe aaa5ca57ae network/netdev: make MACAddress= take 'none' to suppress generating persistent hardware address
This is mostly equivalent to .link file's MACAddressPolicy=none.
2021-11-28 12:04:55 +09:00
Yu Watanabe 5dcc5b1a11 network/netdev: move config_parse_netdev_kind() at the end 2021-11-28 12:04:55 +09:00
Topi Miettinen 788e720181 namespace: allow ProcSubset=pid with some ProtectKernel options
In case `/proc` is successfully mounted with pid tree subset only due to
`ProcSubset=pid`, the protective mounts for `ProtectKernelTunables=yes` and
`ProtectKernelLogs=yes` to non-pid `/proc` paths are failing because the paths
don't exist. But the pid only option may have failed gracefully (for example
because of ancient kernel), so let's try the mounts but it's not fatal if they
don't succeed.
2021-11-27 17:36:51 +00:00
Luca Boccassi cab35e9672 Merge pull request #21535 from yuwata/network-netdev-verify-mac
network/netdev: verify MAC address
2021-11-27 13:48:56 +00:00
Yu Watanabe 70b0652697 network: route: route->link may be NULL
Fixes #21544.
2021-11-27 13:48:02 +00:00
Alyssa Ross f000edf9ea docs: fix descriptions in discoverable partitions
00db9a114e ("docs: generate table from header using a script") got the
descriptions for the partition types mixed up.  After that change, the
spec claimed, for example, that the /usr partition should contain
"dm-verity integrity hash data for the matching root partition", and
that the /usr verity partition should be of type "Any native, optionally
in LUKS".  This made the spec an extremely confusing read before I
figured out what must have happened!

I've gone through the table as it existed prior to 00db9a114e, and moved
the descriptions around in the script that generates the table until
they matched up with what they used to be.  Then I regenerated the
table from the fixed script.
2021-11-27 13:46:35 +00:00
Yu Watanabe f5caacec1c Merge pull request #21533 from yuwata/network-trivial-follow-ups
network: trivial follow-ups
2021-11-27 06:42:19 +09:00
Yu Watanabe e76d491c87 Merge pull request #21530 from keszybz/strv-cleanup
Modernize style and drop strv_free_free
2021-11-27 06:41:56 +09:00
Yu Watanabe 007899f43e network/netdev: verify specified MAC address
Drop multicast bit and set local bit of the specified MAC address.

This also makes failure in generating persistent MAC address
non-critical.
2021-11-27 06:39:04 +09:00
Yu Watanabe 5e20e1e3e3 network/netdev: use "struct hw_addr_data" to store MAC address 2021-11-27 06:39:04 +09:00