]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotree-wide: fix typo
Yu Watanabe [Wed, 1 Dec 2021 15:07:21 +0000 (00:07 +0900)] 
tree-wide: fix typo

2 years agoFixed typo
KennthStailey [Wed, 1 Dec 2021 14:43:40 +0000 (09:43 -0500)] 
Fixed typo

`ip set dev eth0` should be `ip link set dev eth0`

2 years agodocs: document that systemd closes console during normal runtime
Arvid E. Picciani [Wed, 1 Dec 2021 08:21:04 +0000 (09:21 +0100)] 
docs: document that systemd closes console during normal runtime

fixes #21451

Signed-off-by: Arvid E. Picciani <aep@exys.org>
2 years agocore: add Condition[Memory/CPU/IO]Pressure
Luca Boccassi [Wed, 17 Nov 2021 10:00:12 +0000 (10:00 +0000)] 
core: add Condition[Memory/CPU/IO]Pressure

By default checks PSI on /proc/pressure, and causes a unit to be skipped
if the threshold is above the given configuration for the avg300
measurement.
Also allow to pass a custom timespan, and a particular slice unit to
check under.

Fixes #20139

2 years agoMerge pull request #21581 from keszybz/really-random-fixlets
Yu Watanabe [Wed, 1 Dec 2021 03:54:00 +0000 (12:54 +0900)] 
Merge pull request #21581 from keszybz/really-random-fixlets

Really random fixlets

2 years agoMerge pull request #21564 from yuwata/errno-eagain-eintr
Yu Watanabe [Wed, 1 Dec 2021 03:52:27 +0000 (12:52 +0900)] 
Merge pull request #21564 from yuwata/errno-eagain-eintr

tree-wide: introduce ERRNO_IS_TRANSIENT() and use it

2 years agoMerge pull request #21536 from medhefgo/test
Yu Watanabe [Wed, 1 Dec 2021 03:52:10 +0000 (12:52 +0900)] 
Merge pull request #21536 from medhefgo/test

test: Introduce TEST_RET macro

2 years agoMerge pull request #21288 from loongarch64/la64/main
Yu Watanabe [Wed, 1 Dec 2021 03:51:48 +0000 (12:51 +0900)] 
Merge pull request #21288 from loongarch64/la64/main

Add support for the LoongArch architecture.

2 years agoMerge pull request #21553 from yuwata/network-wireguard-add-routes-to-allowed-ips
Luca Boccassi [Tue, 30 Nov 2021 23:30:31 +0000 (23:30 +0000)] 
Merge pull request #21553 from yuwata/network-wireguard-add-routes-to-allowed-ips

network: wireguard: add routes to AllowedIPs=

2 years agotmpfiles: 'st' may have been used uninitialized 21581/head
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 14:05:58 +0000 (15:05 +0100)] 
tmpfiles: 'st' may have been used uninitialized

2 years agoman: prettify line number handling in python example
Zbigniew Jędrzejewski-Szmek [Sun, 28 Nov 2021 11:30:52 +0000 (12:30 +0100)] 
man: prettify line number handling in python example

This way the 'line_number' variable contains the actual line number as we think
of it, instead of adjusting it on output.

2 years agotest-sizeof: show stack and heap randomization
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 09:28:18 +0000 (10:28 +0100)] 
test-sizeof: show stack and heap randomization

It's useful to reassure yourself those those things actually work ;)

2 years agoMerge pull request #21580 from bluca/core_fork
Zbigniew Jędrzejewski-Szmek [Tue, 30 Nov 2021 20:49:53 +0000 (21:49 +0100)] 
Merge pull request #21580 from bluca/core_fork

Switch coredump ELF parsing to fork+dlopen

2 years agotest-network: add tests for creating routes to wireguard's AllowedIPs= 21553/head
Yu Watanabe [Mon, 29 Nov 2021 07:49:24 +0000 (16:49 +0900)] 
test-network: add tests for creating routes to wireguard's AllowedIPs=

2 years agonetwork: wireguard: automatically configure routes to addresses specified in AllowedIPs=
Yu Watanabe [Mon, 29 Nov 2021 07:36:42 +0000 (16:36 +0900)] 
network: wireguard: automatically configure routes to addresses specified in AllowedIPs=

Closes #14176.

2 years agonetwork: route: expose route_hash_ops
Yu Watanabe [Mon, 29 Nov 2021 07:35:46 +0000 (16:35 +0900)] 
network: route: expose route_hash_ops

2 years agonetwork/wireguard: drop unnecessary .in6 specifier
Yu Watanabe [Mon, 29 Nov 2021 06:13:03 +0000 (15:13 +0900)] 
network/wireguard: drop unnecessary .in6 specifier

This should not change any behavior, as the size of the IPv4 address is
smaller than IPv6.

2 years agonetwork: route: read RTA_TABLE attribute to get route table
Yu Watanabe [Mon, 29 Nov 2021 10:38:24 +0000 (19:38 +0900)] 
network: route: read RTA_TABLE attribute to get route table

If the table of a route is larger than 255, then the value is stored in
RTA_TABLE attribute. But the attribute is not supported by old kernels.
So, first try to read the value from RTA_TABLE attribute, then fallback
to the value in the message header.

2 years agonetwork: route: use typesafe function
Yu Watanabe [Mon, 29 Nov 2021 10:38:03 +0000 (19:38 +0900)] 
network: route: use typesafe function

2 years agooomd: use type suffix instead of casting
Zbigniew Jędrzejewski-Szmek [Tue, 30 Nov 2021 17:42:32 +0000 (18:42 +0100)] 
oomd: use type suffix instead of casting

The end result is the same.

2 years agonetwork: address: drop deprecated temporary address
Yu Watanabe [Tue, 30 Nov 2021 06:52:54 +0000 (15:52 +0900)] 
network: address: drop deprecated temporary address

Fixes #19838.

2 years agoTODO: update dlopen todo list 21580/head
Luca Boccassi [Wed, 24 Nov 2021 20:26:19 +0000 (20:26 +0000)] 
TODO: update dlopen todo list

2 years agoelf-util: switch libelf/libdw to dlopen()
Luca Boccassi [Mon, 22 Nov 2021 11:11:21 +0000 (11:11 +0000)] 
elf-util: switch libelf/libdw to dlopen()

In order to avoid inflating the dependency list for the core
library, use dlopen when inspecting elfs, since it's only
used in two non-core executables.

2 years agomeson: remove libdw dependency from pstore
Luca Boccassi [Wed, 24 Nov 2021 20:23:02 +0000 (20:23 +0000)] 
meson: remove libdw dependency from pstore

systemd-pstore does not use any symbol from libdw, and never did,
but the dependency was listed since the beginning

2 years agoelf-util: add stub for builds without libdw
Luca Boccassi [Sun, 21 Nov 2021 17:31:20 +0000 (17:31 +0000)] 
elf-util: add stub for builds without libdw

2 years agoelf-util: split out helper to parse build-id
Luca Boccassi [Thu, 18 Nov 2021 00:51:41 +0000 (00:51 +0000)] 
elf-util: split out helper to parse build-id

2 years agocoredump: move elf parsing utilities to src/shared/elf-util
Luca Boccassi [Wed, 17 Nov 2021 01:44:33 +0000 (01:44 +0000)] 
coredump: move elf parsing utilities to src/shared/elf-util

2 years agocoredump: always log on failure in parse_core()
Luca Boccassi [Wed, 24 Nov 2021 20:13:44 +0000 (20:13 +0000)] 
coredump: always log on failure in parse_core()

2 years agocoredump: make the buffer optional when analyzing a core file
Luca Boccassi [Wed, 17 Nov 2021 01:27:57 +0000 (01:27 +0000)] 
coredump: make the buffer optional when analyzing a core file

Allow later usage when we only want to fetch the JSON packaging metadata

2 years agocoredump: analyze object with libdwelf in forked process
Luca Boccassi [Sun, 21 Nov 2021 17:05:28 +0000 (17:05 +0000)] 
coredump: analyze object with libdwelf in forked process

Parsing objects is risky as data could be malformed or malicious,
so avoid doing that from the main systemd-coredump process and
instead fork another process, and set it to avoid generating
core files itself.

2 years agocoredump: use _cleanup_ pattern
Luca Boccassi [Mon, 29 Nov 2021 11:31:00 +0000 (11:31 +0000)] 
coredump: use _cleanup_ pattern

Note that c.f needs to be closed _before_ taking or freeing
the buf pointer, as it might be invalidated

2 years agocoredump: flush accumulating buffer after parsing core file
Luca Boccassi [Mon, 29 Nov 2021 10:23:49 +0000 (10:23 +0000)] 
coredump: flush accumulating buffer after parsing core file

2 years agocoredump: check return of dwarf_getscopes
Luca Boccassi [Tue, 30 Nov 2021 02:01:53 +0000 (02:01 +0000)] 
coredump: check return of dwarf_getscopes

2 years agoMerge pull request #21578 from bluca/json_spec
Zbigniew Jędrzejewski-Szmek [Tue, 30 Nov 2021 15:36:36 +0000 (16:36 +0100)] 
Merge pull request #21578 from bluca/json_spec

docs: clarify JSON terms in COREDUMP_PACKAGE_METADATA

2 years agogpt: update the gpt test case for LoongArch 21288/head
Xiaotian Wu [Mon, 19 Apr 2021 13:03:32 +0000 (21:03 +0800)] 
gpt: update the gpt test case for LoongArch

2 years agoarchitecture: Add support for the LoongArch architecture
Wu Xiaotian [Tue, 1 Sep 2020 04:13:18 +0000 (12:13 +0800)] 
architecture: Add support for the LoongArch architecture

2 years agosysusers: avoid creating spurious "nobody" group
Rasmus Villemoes [Tue, 30 Nov 2021 11:50:19 +0000 (12:50 +0100)] 
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.

2 years agoMerge pull request #21573 from keszybz/one-more-table-sort
Luca Boccassi [Tue, 30 Nov 2021 14:52:08 +0000 (14:52 +0000)] 
Merge pull request #21573 from keszybz/one-more-table-sort

One more table sort and man page updates

2 years agodocs: clarify ELF note usage in COREDUMP_PACKAGE_METADATA 21578/head
Luca Boccassi [Tue, 30 Nov 2021 14:42:43 +0000 (14:42 +0000)] 
docs: clarify ELF note usage in COREDUMP_PACKAGE_METADATA

2 years agolibsystemd: ignore both EINTR and EAGAIN 21564/head
Yu Watanabe [Mon, 29 Nov 2021 18:33:55 +0000 (03:33 +0900)] 
libsystemd: ignore both EINTR and EAGAIN

2 years agotree-wide: use ERRNO_IS_TRANSIENT()
Yu Watanabe [Mon, 29 Nov 2021 19:07:24 +0000 (04:07 +0900)] 
tree-wide: use ERRNO_IS_TRANSIENT()

2 years agoerrno-util: introduce ERRNO_IS_TRANSIENT()
Yu Watanabe [Mon, 29 Nov 2021 18:39:35 +0000 (03:39 +0900)] 
errno-util: introduce ERRNO_IS_TRANSIENT()

2 years agoask-password: fix error handling
Yu Watanabe [Tue, 30 Nov 2021 14:05:15 +0000 (23:05 +0900)] 
ask-password: fix error handling

ERRNO_IS_NOT_SUPPORTED() also matches positive values.
Fortunately, lookup_key() does not return positive values.

2 years agosd-dhcp6-client: fix error handling
Yu Watanabe [Tue, 30 Nov 2021 08:58:40 +0000 (17:58 +0900)] 
sd-dhcp6-client: fix error handling

2 years agoMerge pull request #21559 from jcg190701/main
Yu Watanabe [Tue, 30 Nov 2021 13:34:21 +0000 (22:34 +0900)] 
Merge pull request #21559 from jcg190701/main

fix ConditionDirectoryNotEmpty when it comes to a Non-directory file

2 years agobasic/architecture: sort and reindent one more table 21573/head
Zbigniew Jędrzejewski-Szmek [Tue, 30 Nov 2021 08:24:45 +0000 (09:24 +0100)] 
basic/architecture: sort and reindent one more table

No idea why I didn't do this one in the previous round.

2 years agoman: fix typo
Zbigniew Jędrzejewski-Szmek [Thu, 28 Oct 2021 13:55:00 +0000 (15:55 +0200)] 
man: fix typo

Follow-up for c896eb7ad65f4dbe968fdf01fa51e9ef4d2d11ed.

2 years agoman: add missing plural and reorder sentence
Zbigniew Jędrzejewski-Szmek [Thu, 28 Oct 2021 13:47:53 +0000 (15:47 +0200)] 
man: add missing plural and reorder sentence

We shouldn't explain what a value does before listing valid values…

Follow-up for 4f1ac4a38d1adf08f849af1a61c7a248932d8e13.

2 years agodocs: clarify JSON terms in COREDUMP_PACKAGE_METADATA
Luca Boccassi [Tue, 30 Nov 2021 12:36:16 +0000 (12:36 +0000)] 
docs: clarify JSON terms in COREDUMP_PACKAGE_METADATA

2 years agotree-wide: fix typo
Yu Watanabe [Tue, 30 Nov 2021 09:26:17 +0000 (18:26 +0900)] 
tree-wide: fix typo

2 years agoMerge pull request #21568 from yuwata/network-fix-json-format
Luca Boccassi [Tue, 30 Nov 2021 09:13:03 +0000 (09:13 +0000)] 
Merge pull request #21568 from yuwata/network-fix-json-format

network: fix json format

2 years agofix ConditionPathIsReadWrite when path does not exist. 21559/head
jiangchuangang [Tue, 30 Nov 2021 07:25:27 +0000 (15:25 +0800)] 
fix ConditionPathIsReadWrite when path does not exist.

2 years agoman: fix copy-and-paste mistake
Yu Watanabe [Tue, 30 Nov 2021 08:23:54 +0000 (17:23 +0900)] 
man: fix copy-and-paste mistake

2 years agofix ConditionDirectoryNotEmpty when it comes to a Non-directory file
jiangchuangang [Mon, 29 Nov 2021 14:30:37 +0000 (22:30 +0800)] 
fix ConditionDirectoryNotEmpty when it comes to a Non-directory file

2 years agotest-network: add more basic tests for network json formats 21568/head
Yu Watanabe [Mon, 29 Nov 2021 23:12:28 +0000 (08:12 +0900)] 
test-network: add more basic tests for network json formats

2 years agonetwork: json: add missing initialization
Yu Watanabe [Tue, 30 Nov 2021 01:03:05 +0000 (10:03 +0900)] 
network: json: add missing initialization

Fixes CID#1466513.

2 years agojson: make JSON_BUILD_PAIR_IN_ADDR_NON_NULL or friends handle NULL gracefully
Yu Watanabe [Mon, 29 Nov 2021 23:04:54 +0000 (08:04 +0900)] 
json: make JSON_BUILD_PAIR_IN_ADDR_NON_NULL or friends handle NULL gracefully

Fixes #21567.

2 years agosystemctl: display how long a systemd service will run (#21494)
Amir Omidi [Tue, 30 Nov 2021 00:24:18 +0000 (19:24 -0500)] 
systemctl: display how long a systemd service will run (#21494)

2 years agoMerge pull request #21532 from yuwata/network-json-more
Zbigniew Jędrzejewski-Szmek [Mon, 29 Nov 2021 20:26:56 +0000 (21:26 +0100)] 
Merge pull request #21532 from yuwata/network-json-more

network: add more json entries

2 years agoMerge pull request #21541 from bluca/analyze_security_profile
Zbigniew Jędrzejewski-Szmek [Mon, 29 Nov 2021 20:23:34 +0000 (21:23 +0100)] 
Merge pull request #21541 from bluca/analyze_security_profile

analyze: add --profile switch to security verb

2 years agosd-boot: Fix assert failure in random-seed.c
Jan Janssen [Mon, 29 Nov 2021 14:42:26 +0000 (15:42 +0100)] 
sd-boot: Fix assert failure in random-seed.c

Fixes: #21556
2 years agounit: add jobs that were skipped because of ratelimit back to run_queue
Michal Sekletar [Thu, 25 Nov 2021 17:28:25 +0000 (18:28 +0100)] 
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

2 years agoByte order to host before using the lifetime
Nacho Barrientos [Mon, 29 Nov 2021 13:17:55 +0000 (14:17 +0100)] 
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 8a8955507af363c31297bbc5df79852db4ad39d6.

2 years agoAdd missing greater than/less than tab on some HP
Marco Scardovi [Mon, 29 Nov 2021 08:53:56 +0000 (09:53 +0100)] 
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

2 years agoMerge pull request #21534 from yuwata/udev-accept-longer-hw-address
Zbigniew Jędrzejewski-Szmek [Mon, 29 Nov 2021 13:00:52 +0000 (14:00 +0100)] 
Merge pull request #21534 from yuwata/udev-accept-longer-hw-address

udev/net: accept longer HW address

2 years agoMerge pull request #21531 from keszybz/log2-tables
Zbigniew Jędrzejewski-Szmek [Mon, 29 Nov 2021 12:58:49 +0000 (13:58 +0100)] 
Merge pull request #21531 from keszybz/log2-tables

Optimize log2 tables

2 years agoMerge pull request #21537 from medhefgo/boot-sbat
Zbigniew Jędrzejewski-Szmek [Mon, 29 Nov 2021 10:30:25 +0000 (11:30 +0100)] 
Merge pull request #21537 from medhefgo/boot-sbat

meson: Default to sbat-distro=auto

2 years agocoredump: fix parsing metadata without access to executable
Luca Boccassi [Fri, 26 Nov 2021 02:13:57 +0000 (02:13 +0000)] 
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.

2 years agomeson: upgrade warning about bad init values to an error 21531/head
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 10:52:04 +0000 (11:52 +0100)] 
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.

2 years agonetworkd: replace a table with log2 fields by a list
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 11:05:18 +0000 (12:05 +0100)] 
networkd: replace a table with log2 fields by a list

2 years agonetworkd: align table
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 11:03:44 +0000 (12:03 +0100)] 
networkd: align table

2 years agonetworkd: replace a table with log2 fields by a list
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 11:03:12 +0000 (12:03 +0100)] 
networkd: replace a table with log2 fields by a list

2 years agonetworkd: replace a table with log2 fields by a list
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 10:59:53 +0000 (11:59 +0100)] 
networkd: replace a table with log2 fields by a list

2 years agonetworkd: replace a table with log2 fields by a list
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 10:51:12 +0000 (11:51 +0100)] 
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.

2 years agobasic/util: add macro variants of log2 functions
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 10:46:54 +0000 (11:46 +0100)] 
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.

2 years agopam_systemd: Check also abstract socket for X11
Topi Miettinen [Fri, 26 Nov 2021 14:34:48 +0000 (16:34 +0200)] 
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.

2 years agomeson: Rename compile_args to efi_cfalgs 21537/head
Jan Janssen [Fri, 26 Nov 2021 13:13:56 +0000 (14:13 +0100)] 
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.

2 years agomeson: Default to sbat-distro=auto
Jan Janssen [Fri, 26 Nov 2021 13:00:02 +0000 (14:00 +0100)] 
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.

2 years agoMerge pull request #21549 from yuwata/network-netdev-mac-address-none
Luca Boccassi [Sun, 28 Nov 2021 12:36:35 +0000 (12:36 +0000)] 
Merge pull request #21549 from yuwata/network-netdev-mac-address-none

network: netdev: make MACAddress= take 'none'

2 years agotest-parse-util: Add SI-suffix parse_size tests 21536/head
Jan Janssen [Thu, 25 Nov 2021 11:48:41 +0000 (12:48 +0100)] 
test-parse-util: Add SI-suffix parse_size tests

2 years agotest-namespace: Convert to TEST macro
Jan Janssen [Thu, 25 Nov 2021 11:41:42 +0000 (12:41 +0100)] 
test-namespace: Convert to TEST macro

2 years agotest-barrier: Convert to TEST macro
Jan Janssen [Thu, 25 Nov 2021 11:27:42 +0000 (12:27 +0100)] 
test-barrier: Convert to TEST macro

2 years agotest: Convert to TEST/TEST_RET macros
Jan Janssen [Thu, 25 Nov 2021 11:05:57 +0000 (12:05 +0100)] 
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.

2 years agotest: Add sd_booted condition test to TEST macro
Jan Janssen [Thu, 25 Nov 2021 09:45:15 +0000 (10:45 +0100)] 
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();

2 years agotest: Add TEST_RET macro
Jan Janssen [Thu, 25 Nov 2021 09:27:51 +0000 (10:27 +0100)] 
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.

2 years agonetwork/netdev: generate persistent MAC address for batadv and bridge 21549/head
Yu Watanabe [Mon, 8 Nov 2021 02:36:09 +0000 (11:36 +0900)] 
network/netdev: generate persistent MAC address for batadv and bridge

This mostly reverts 489f01f806f865eabb55458c98182b06a6c53a62 and
deb2cfa4c6885d448eb1f17e5ef1b139106b7e86.

As now MACAddress=none is supported. So, users can still disable MAC
address assignment.

2 years agonetwork/netdev: make MACAddress= take 'none' to suppress generating persistent hardwa...
Yu Watanabe [Sun, 28 Nov 2021 02:51:08 +0000 (11:51 +0900)] 
network/netdev: make MACAddress= take 'none' to suppress generating persistent hardware address

This is mostly equivalent to .link file's MACAddressPolicy=none.

2 years agonetwork/netdev: move config_parse_netdev_kind() at the end
Yu Watanabe [Sun, 28 Nov 2021 02:23:42 +0000 (11:23 +0900)] 
network/netdev: move config_parse_netdev_kind() at the end

2 years agonamespace: allow ProcSubset=pid with some ProtectKernel options
Topi Miettinen [Sat, 27 Nov 2021 10:51:39 +0000 (12:51 +0200)] 
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.

2 years agoMerge pull request #21535 from yuwata/network-netdev-verify-mac
Luca Boccassi [Sat, 27 Nov 2021 13:48:56 +0000 (13:48 +0000)] 
Merge pull request #21535 from yuwata/network-netdev-verify-mac

network/netdev: verify MAC address

2 years agonetwork: route: route->link may be NULL
Yu Watanabe [Sat, 27 Nov 2021 12:01:27 +0000 (21:01 +0900)] 
network: route: route->link may be NULL

Fixes #21544.

2 years agodocs: fix descriptions in discoverable partitions
Alyssa Ross [Sat, 27 Nov 2021 12:10:38 +0000 (12:10 +0000)] 
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.

2 years agoMerge pull request #21533 from yuwata/network-trivial-follow-ups
Yu Watanabe [Fri, 26 Nov 2021 21:42:19 +0000 (06:42 +0900)] 
Merge pull request #21533 from yuwata/network-trivial-follow-ups

network: trivial follow-ups

2 years agoMerge pull request #21530 from keszybz/strv-cleanup
Yu Watanabe [Fri, 26 Nov 2021 21:41:56 +0000 (06:41 +0900)] 
Merge pull request #21530 from keszybz/strv-cleanup

Modernize style and drop strv_free_free

2 years agonetwork/netdev: verify specified MAC address 21535/head
Yu Watanabe [Mon, 8 Nov 2021 03:41:47 +0000 (12:41 +0900)] 
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.

2 years agonetwork/netdev: use "struct hw_addr_data" to store MAC address
Yu Watanabe [Sun, 7 Nov 2021 02:23:14 +0000 (11:23 +0900)] 
network/netdev: use "struct hw_addr_data" to store MAC address

2 years agonetwork/netdev: introduce .iftype to netdev vtable
Yu Watanabe [Sun, 7 Nov 2021 07:27:33 +0000 (16:27 +0900)] 
network/netdev: introduce .iftype to netdev vtable

And disable .generate_mac flag for non-ether interfaces.

2 years agonetwork: veth: use SYNTHETIC_ERRNO() macro or use real error cause
Yu Watanabe [Thu, 25 Nov 2021 11:59:48 +0000 (20:59 +0900)] 
network: veth: use SYNTHETIC_ERRNO() macro or use real error cause

2 years agoanalyze: add --profile switch to security verb 21541/head
Luca Boccassi [Fri, 26 Nov 2021 15:46:40 +0000 (15:46 +0000)] 
analyze: add --profile switch to security verb

Allows to pass a portable profile when doing offline analysis of
units. Especially useful for analyzing portable images, since a
lot of the security-relevant settings in those cases come from
the profiles, but they are not shipped in the portable images.

2 years agotest: create a dummy LSan suppression file in the minimal image
Frantisek Sumsal [Fri, 26 Nov 2021 15:21:51 +0000 (16:21 +0100)] 
test: create a dummy LSan suppression file in the minimal image

otherwise gcc's ASan complains (unlike clang's) when the image is used -
e.g. in TEST-29 or TEST-50.

```
[   17.328705] testsuite-29.sh[361]: + portablectl --profile=trusted attach --now --runtime /usr/share/minimal_0.raw app0
...
[   20.978649] systemd[1]: Starting app0-foo.service...
[   21.104844] kernel: loop0: detected capacity change from 0 to 24960
[   20.999559] systemd[1]: Starting app0.service...
[   21.126022] kernel: loop1: detected capacity change from 0 to 24960
...
[   21.861087] cat[422]: AddressSanitizer: failed to read suppressions file '/systemd-lsan.supp'
[   21.868634] cat[421]: AddressSanitizer: failed to read suppressions file '/systemd-lsan.supp'
[   21.877941] systemd[1]: app0.service: Control process exited, code=exited, status=1/FAILURE
[   21.878836] systemd[1]: app0.service: Failed with result 'exit-code'.
[   21.905712] systemd[1]: Failed to start app0.service.
```

Follow-up to f201f3447796a5424372d32b338bc3b907516c28.