]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agonetwork: update log message 19332/head
Yu Watanabe [Fri, 16 Apr 2021 00:54:52 +0000 (09:54 +0900)] 
network: update log message

In some optimization level with gcc, including netdev->ifname in log
message causes error.

4 years agonetwork: make log_netdev_xxx_errno() refuse zero errno
Yu Watanabe [Thu, 15 Apr 2021 23:44:56 +0000 (08:44 +0900)] 
network: make log_netdev_xxx_errno() refuse zero errno

4 years agotimedate: make log_unit_xxx_errno() refuse zero errno
Yu Watanabe [Thu, 15 Apr 2021 23:45:28 +0000 (08:45 +0900)] 
timedate: make log_unit_xxx_errno() refuse zero errno

4 years agocore: make log_unit_xxx_errno() refuse zero errno
Yu Watanabe [Thu, 15 Apr 2021 23:43:59 +0000 (08:43 +0900)] 
core: make log_unit_xxx_errno() refuse zero errno

4 years agocore: use UNIT_TRIGGER at more places
Lennart Poettering [Thu, 15 Apr 2021 09:18:31 +0000 (11:18 +0200)] 
core: use UNIT_TRIGGER at more places

Just some minor simplification.

4 years agoMerge pull request #19326 from keszybz/reorder-meson-status-output
Luca Boccassi [Thu, 15 Apr 2021 19:37:29 +0000 (20:37 +0100)] 
Merge pull request #19326 from keszybz/reorder-meson-status-output

Reorder meson status output

4 years agoMerge pull request #19318 from yuwata/udev-ignore-additional-newline-on-verify-19314
Luca Boccassi [Thu, 15 Apr 2021 19:36:55 +0000 (20:36 +0100)] 
Merge pull request #19318 from yuwata/udev-ignore-additional-newline-on-verify-19314

udev: ignore additional newline at the end on verify

4 years agoMerge pull request #19317 from keszybz/check-return-values-from-log_errno-functions
Luca Boccassi [Thu, 15 Apr 2021 19:33:54 +0000 (20:33 +0100)] 
Merge pull request #19317 from keszybz/check-return-values-from-log_errno-functions

Check return values from log_errno functions

4 years agopo: Translated using Weblate (Korean)
simmon [Thu, 15 Apr 2021 10:02:00 +0000 (12:02 +0200)] 
po: Translated using Weblate (Korean)

Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: simmon <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main

4 years agoAssert zero is not passed to log_{device,rule,token}_*_errno() 19317/head
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 09:56:22 +0000 (11:56 +0200)] 
Assert zero is not passed to log_{device,rule,token}_*_errno()

4 years agoVoidify log_{device,token,rule}_debug()
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 09:22:22 +0000 (11:22 +0200)] 
Voidify log_{device,token,rule}_debug()

See analogous change for log_debug() for discussion.

4 years agocore: drop pointless assert()
Lennart Poettering [Wed, 14 Apr 2021 14:02:35 +0000 (16:02 +0200)] 
core: drop pointless assert()

We checked this literally two lines earlier, no point in checking so
quickly again.

4 years agoupdate TODO
Lennart Poettering [Thu, 15 Apr 2021 09:24:28 +0000 (11:24 +0200)] 
update TODO

4 years agocore/selinux: fix wrong assertion when 0 is passed to log_debug
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 09:18:32 +0000 (11:18 +0200)] 
core/selinux: fix wrong assertion when 0 is passed to log_debug

https://github.com/systemd/systemd/pull/19317#issuecomment-820245680

4 years agomeson: output one "item" for DNS-over-TLS 19326/head
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 09:04:14 +0000 (11:04 +0200)] 
meson: output one "item" for DNS-over-TLS

4 years agomeson: reorder the "features" list
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 08:59:03 +0000 (10:59 +0200)] 
meson: reorder the "features" list

Try to make this more manageable by reording:
- dependencies / inputs
  (with subcategory of compression libraries)
- major components / outputs
- optional features / conditionals that don't fit into the two above categories

The division isn't well defined, because libraries often correspond one-to-one
to feature, but not always.

4 years agomeson: fold static libsystemd and libudev into the generic status line
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 07:56:06 +0000 (09:56 +0200)] 
meson: fold static libsystemd and libudev into the generic status line

It's a very specialized feature and we don't need to devote a separate line to it.

4 years agomeson: reindent
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 07:45:48 +0000 (09:45 +0200)] 
meson: reindent

4 years agotest: use systemd-run --wait in TEST-44-LOG-NAMESPACE
Luca Boccassi [Wed, 14 Apr 2021 20:26:50 +0000 (21:26 +0100)] 
test: use systemd-run --wait in TEST-44-LOG-NAMESPACE

The test appears to be occasionally failing. It uses systemd-run to echo
'hello world' into a namespaced journal and then uses journalctl to look for it,
but it doesn't wait.
In the failed runs it can't find it, but the automated journal dump shows
the message at the end.

Use --wait to avoid races.

4 years agoudev/cdrom_id: drop unnecessary cleanup and simplify loop
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 05:51:58 +0000 (07:51 +0200)] 
udev/cdrom_id: drop unnecessary cleanup and simplify loop

4 years agoudev/cdrom_id: do not pass ioctl return value to log_debug_errno()
Zbigniew Jędrzejewski-Szmek [Thu, 15 Apr 2021 05:49:31 +0000 (07:49 +0200)] 
udev/cdrom_id: do not pass ioctl return value to log_debug_errno()

While at it, let's print the tray status in human readable form.

4 years agolibsystemd-network: fix dhcp option buffer confusion
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 08:55:09 +0000 (04:55 -0400)] 
libsystemd-network: fix dhcp option buffer confusion

We were writing to the wrong buffer with a wrong offset :(
Bug present since the original introduction of the code in
04b28be1a306fd2ba454d3ee333d63df71aa3873.

4 years agomeson.build: typo
Sevan Janiyan [Wed, 14 Apr 2021 23:01:53 +0000 (00:01 +0100)] 
meson.build: typo

4 years agolibsystemd-network: check that errno==0 is not passed to log functions
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 21:30:27 +0000 (23:30 +0200)] 
libsystemd-network: check that errno==0 is not passed to log functions

4 years agolibsystemd-network: use macro for definitions of log_{lldp,dhcp,…}_errno
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 21:12:50 +0000 (23:12 +0200)] 
libsystemd-network: use macro for definitions of log_{lldp,dhcp,…}_errno

No functional change.

4 years agoCheck that errno passed log_{interface,link}_*_errno() is non-zero
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 20:53:49 +0000 (22:53 +0200)] 
Check that errno passed log_{interface,link}_*_errno() is non-zero

4 years agosd-dhcp-client: introduce sd_dhcp_client_is_running()
Yu Watanabe [Sat, 10 Apr 2021 02:10:31 +0000 (11:10 +0900)] 
sd-dhcp-client: introduce sd_dhcp_client_is_running()

4 years agoVoidify log_link_debug
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 20:19:58 +0000 (22:19 +0200)] 
Voidify log_link_debug

See analogous change for log_debug() for discussion.

4 years agoMerge pull request #19315 from yuwata/network-wait-online-address-family-follow-ups
Luca Boccassi [Wed, 14 Apr 2021 20:17:00 +0000 (21:17 +0100)] 
Merge pull request #19315 from yuwata/network-wait-online-address-family-follow-ups

network: several follow-ups for #19069

4 years agojournald: fix %m usage
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 20:06:02 +0000 (22:06 +0200)] 
journald: fix %m usage

4 years agoudev: ignore additional newline in sysfs attribute on verify 19318/head
Yu Watanabe [Wed, 14 Apr 2021 16:44:48 +0000 (01:44 +0900)] 
udev: ignore additional newline in sysfs attribute on verify

Some driver may automatically add additional newline at the end.
E.g., portno attribute for qeth driver.

Fixes #19314.

4 years agofileio: introduce a new flag to make write_string_file() ignore trailing newline
Yu Watanabe [Wed, 14 Apr 2021 16:40:49 +0000 (01:40 +0900)] 
fileio: introduce a new flag to make write_string_file() ignore trailing newline

When writing a sysfs attribute, kernel may automatically append newline
at the end, e.g., 'portno' attribute for qeth driver.

4 years agoDo not try to return 0 from log_debug()
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 15:44:47 +0000 (17:44 +0200)] 
Do not try to return 0 from log_debug()

As @yuwata correctly points out, this became broken when log_debug()
started returning -EIO. I wanted to preserve this pattern, but it turns
out it is not very widely used, and preserving it would make the whole
thing, already quite complicated, even more complex.

log_debug() is made like log_info() and friends, and returns void.

4 years agoshared/module-util: fix errno value passed to log function
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 15:10:36 +0000 (17:10 +0200)] 
shared/module-util: fix errno value passed to log function

If r == 0, no harm done. But if r > 0, this would be interpreted as an
errno value, wrongly.

4 years agobasic/log: assert that 0 is not passed as errno, except in test code
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 13:55:16 +0000 (15:55 +0200)] 
basic/log: assert that 0 is not passed as errno, except in test code

Let's assert if we ever happen to pass 0 to one of the log functions.
With the preceding commit to return -EIO from log_*(), passing 0 wouldn't
affect the return value any more, but it is still most likely an error.
The unit test code is an exception: we fairly often pass the return value
to print it, before checking what it is. So let's assert that we're not
passing 0 in non-test code. As with the previous check for %m, this is only
done in developer mode. We are depending on external code setting
errno correctly for us, which might not always be true, and which we can't
test, so we shouldn't assert, but just handle this gracefully.

I did a bunch of greps to try to figure out if there are any places where
we're passing 0 on purpose, and couldn't find any.
The one place that failed in tests is adjusted.

About "zerook" in the name: I wanted the suffix to be unambiguous. It's a
single "word" because each of the words in log_full_errno is also meaningful,
and having one term use two words would be confusing.

4 years agoMerge pull request #19302 from bluca/uninit
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 14:25:35 +0000 (16:25 +0200)] 
Merge pull request #19302 from bluca/uninit

tree-wide: avoid uninitialized warning on _cleanup_ variables

4 years agobasic/log: assert that %m is not used when error is not set
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 11:39:14 +0000 (13:39 +0200)] 
basic/log: assert that %m is not used when error is not set

This is only done in developer mode. It is a pretty rare occurence that we
make this kind of mistake. And even if it happens, the result is just a misleading
error message. So let's only do the check in non-release builds.

4 years agobasic/log: force log_*_errno() to return negative
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 10:05:47 +0000 (06:05 -0400)] 
basic/log: force log_*_errno() to return negative

This silences some warnigns where gcc thinks that some variables are
unitialized. One particular case:

../src/journal/journald-server.c: In function 'ache_space_refresh':
../src/journal/journald-server.c:136:28: error: 'vfs_avail' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  136 |         uint64_t vfs_used, vfs_avail, avail;
      |                            ^~~~~~~~~
../src/journal/journald-server.c:136:18: error: 'vfs_used' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  136 |         uint64_t vfs_used, vfs_avail, avail;
      |                  ^~~~~~~~
cc1: all warnings being treated as errors

which is caused by

   d = opendir(path);
   if (!d)
           return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR,
                                 errno, "Failed to open %s: %m", path);
   if (fstatvfs(dirfd(d), &ss) < 0)
           return log_error_errno(errno, "Failed to fstatvfs(%s): %m", path);

For some reason on aarch64 gcc thinks we might return non-negative here. In
principle errno must be set in both cases, but it's hard to say for certain.
So let's make sure that our code flow is correct, even if somebody forgot to
set the global variable somewhere.

4 years agopartition, random-seed, logind: fix log messages with %m
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 10:14:01 +0000 (06:14 -0400)] 
partition, random-seed, logind: fix log messages with %m

We would print "...: Success", which is not too terrible, but not pretty
either.

4 years agosd-device: improve log message and tweak style
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 09:54:17 +0000 (05:54 -0400)] 
sd-device: improve log message and tweak style

We shouldn't say the attribute is missing right after ruling out ENOENT.

4 years agolibsystemd-network: fix dhcp option buffer confusion
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 08:55:09 +0000 (04:55 -0400)] 
libsystemd-network: fix dhcp option buffer confusion

We were writing to the wrong buffer with a wrong offset :(
Bug present since the original introduction of the code in
04b28be1a306fd2ba454d3ee333d63df71aa3873.

4 years agomeson: simplify the BUILD_MODE conditional
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 11:17:22 +0000 (13:17 +0200)] 
meson: simplify the BUILD_MODE conditional

Using a enum is all nice and generic, but at this point it seems unlikely that
we'll add further build modes. But having an enum means that we need to include
the header file with the enumeration whenerever the conditional is used. I want
to use the conditional in log.h, which makes it hard to avoid circular imports.

4 years agobpf-devices: update comment
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 12:42:39 +0000 (14:42 +0200)] 
bpf-devices: update comment

4 years agowait-online: update debug log messages 19315/head
Yu Watanabe [Wed, 14 Apr 2021 13:17:44 +0000 (22:17 +0900)] 
wait-online: update debug log messages

4 years agonetwork: shorten code a bit
Yu Watanabe [Wed, 14 Apr 2021 13:13:46 +0000 (22:13 +0900)] 
network: shorten code a bit

4 years agoMerge pull request #19266 from mrc0mmand/testsuite-shellcheck
Zbigniew Jędrzejewski-Szmek [Wed, 14 Apr 2021 11:58:01 +0000 (13:58 +0200)] 
Merge pull request #19266 from mrc0mmand/testsuite-shellcheck

test: make the test scripts shellcheck-compliant

4 years agotree-wide: avoid uninitialized warning on _cleanup_ variables 19302/head
Luca Boccassi [Mon, 12 Apr 2021 22:10:21 +0000 (23:10 +0100)] 
tree-wide: avoid uninitialized warning on _cleanup_ variables

With some versions of the compiler, the _cleanup_ attr makes it think
the variable might be freed/closed when uninitialized, even though it
cannot happen. The added cost is small enough to be worth the benefit,
and optimized builds will help reduce it even further.

4 years agomeson: build tests with -Wno-maybe-uninitialized if -O2/-flto are used
Luca Boccassi [Tue, 13 Apr 2021 19:03:39 +0000 (20:03 +0100)] 
meson: build tests with -Wno-maybe-uninitialized if -O2/-flto are used

We intentionally do not inline initializations with definitions for
a bunch of _cleanup_ variables in tests, to ensure valgrind is triggered.
This triggers a lot of maybe-uninitialized false positives when -O2 and
-flto are used. Suppress them.

4 years agoutil: shorten allow_listed_char_for_devnode()
Yu Watanabe [Wed, 14 Apr 2021 06:07:12 +0000 (15:07 +0900)] 
util: shorten allow_listed_char_for_devnode()

4 years agoMerge pull request #19287 from yuwata/network-manage-foreign-routing-policy-rule...
Yu Watanabe [Wed, 14 Apr 2021 10:01:41 +0000 (19:01 +0900)] 
Merge pull request #19287 from yuwata/network-manage-foreign-routing-policy-rule-19106

network: add ManageForeignRoutingPolicyRules= boolean setting

4 years agoMerge pull request #19069 from LetzteInstanz/waiting_for_address_family
Yu Watanabe [Wed, 14 Apr 2021 09:57:39 +0000 (18:57 +0900)] 
Merge pull request #19069 from LetzteInstanz/waiting_for_address_family

systemd-networkd-wait-online: wait for specific address family

4 years agorfkill: add some casts to silence -Werror=sign-compare
Luca Boccassi [Tue, 13 Apr 2021 12:17:53 +0000 (13:17 +0100)] 
rfkill: add some casts to silence -Werror=sign-compare

4 years agotest-network: test waiting for address family 19069/head
LetzteInstanz [Mon, 12 Apr 2021 15:15:33 +0000 (18:15 +0300)] 
test-network: test waiting for address family

4 years agowait-online: wait for address family
LetzteInstanz [Tue, 13 Apr 2021 11:57:19 +0000 (14:57 +0300)] 
wait-online: wait for address family

This introduce -4 and -6 commandline options.

4 years agosd-network: read IPv4/IPv6 address states from state files
LetzteInstanz [Mon, 12 Apr 2021 10:50:32 +0000 (13:50 +0300)] 
sd-network: read IPv4/IPv6 address states from state files

4 years agonetwork: save IPv4/IPv6 address states into state file
LetzteInstanz [Sun, 11 Apr 2021 20:29:11 +0000 (23:29 +0300)] 
network: save IPv4/IPv6 address states into state file

This also introduces RequiredFamilyForOnline= setting to .network file,
and IPv4AddressState/IPv6AddressState DBus properties.

4 years agonetwork: move AddressFamily into network-util for the use by wait-online later
LetzteInstanz [Sun, 21 Mar 2021 07:37:38 +0000 (10:37 +0300)] 
network: move AddressFamily into network-util for the use by wait-online later

4 years agoudev: delete useless codes
gaoyi [Tue, 13 Apr 2021 10:59:46 +0000 (18:59 +0800)] 
udev: delete useless codes

It seems no one will touch queue.bin

4 years agodhcp: Implemented BindToInterface= configuration option
Yegor Alexeyev [Tue, 9 Mar 2021 11:57:37 +0000 (14:57 +0300)] 
dhcp: Implemented BindToInterface= configuration option

4 years agotest: bunch of assorted tweaks to make shellcheck happy 19266/head
Frantisek Sumsal [Fri, 9 Apr 2021 17:56:12 +0000 (19:56 +0200)] 
test: bunch of assorted tweaks to make shellcheck happy

4 years agotest: use arrays to make things a bit cleaner
Frantisek Sumsal [Fri, 9 Apr 2021 17:55:27 +0000 (19:55 +0200)] 
test: use arrays to make things a bit cleaner

4 years agotest: replace the obsolete `` syntax with $()
Frantisek Sumsal [Fri, 9 Apr 2021 17:54:42 +0000 (19:54 +0200)] 
test: replace the obsolete `` syntax with $()

4 years agotest: use an explicit no-op for file truncation
Frantisek Sumsal [Fri, 9 Apr 2021 17:52:46 +0000 (19:52 +0200)] 
test: use an explicit no-op for file truncation

4 years agotest: tidy up arithmetic expressions
Frantisek Sumsal [Fri, 9 Apr 2021 17:50:52 +0000 (19:50 +0200)] 
test: tidy up arithmetic expressions

4 years agotest: use quotes where necessary
Frantisek Sumsal [Fri, 9 Apr 2021 17:49:32 +0000 (19:49 +0200)] 
test: use quotes where necessary

to avoid possible word splitting.

4 years agotest: use set -eux and set -o pipefail everywhere
Frantisek Sumsal [Fri, 9 Apr 2021 17:39:41 +0000 (19:39 +0200)] 
test: use set -eux and set -o pipefail everywhere

This should make the scripts more robust.

4 years agoMerge pull request #19303 from yuwata/fix-typo
Luca Boccassi [Tue, 13 Apr 2021 08:44:33 +0000 (09:44 +0100)] 
Merge pull request #19303 from yuwata/fix-typo

tree-wide: fix typo

4 years agotree-wide: update comment about unnecessary initialization 19303/head
Yu Watanabe [Tue, 13 Apr 2021 03:53:32 +0000 (12:53 +0900)] 
tree-wide: update comment about unnecessary initialization

4 years agoman: fix typo
Yu Watanabe [Tue, 13 Apr 2021 03:52:56 +0000 (12:52 +0900)] 
man: fix typo

4 years agoman: update description for ManageForeignRoutes= 19287/head
Yu Watanabe [Tue, 13 Apr 2021 03:23:31 +0000 (12:23 +0900)] 
man: update description for ManageForeignRoutes=

4 years agonetwork: introduce ManageForeignRoutingPolicyRules= boolean setting in networkd.conf
Yu Watanabe [Sun, 11 Apr 2021 12:33:51 +0000 (21:33 +0900)] 
network: introduce ManageForeignRoutingPolicyRules= boolean setting in networkd.conf

The commit 0b81225e5791f660506f7db0ab88078cf296b771 makes that networkd
remove all foreign rules except those with "proto kernel".

But, in some situation, people may want to manage routing policy rules
with other tools, e.g. 'ip' command. To support such the situation,
this introduce ManageForeignRoutingPolicyRules= boolean setting.

Closes #19106.

4 years agonetwork: add missing default setting in networkd.conf
Yu Watanabe [Sun, 11 Apr 2021 12:25:16 +0000 (21:25 +0900)] 
network: add missing default setting in networkd.conf

4 years agoload-fragment: parse specifiers in CPUAffinity= (#19281)
Francois Gervais [Mon, 12 Apr 2021 22:25:29 +0000 (18:25 -0400)] 
load-fragment: parse specifiers in CPUAffinity= (#19281)

4 years agomeson: do not fail if rsync is not installed with meson 0.57.2
Zbigniew Jędrzejewski-Szmek [Mon, 12 Apr 2021 12:03:32 +0000 (14:03 +0200)] 
meson: do not fail if rsync is not installed with meson 0.57.2

https://github.com/mesonbuild/meson/issues/8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.

4 years agopackit: drop the 'sources' file after cloning the Fedora repo
Frantisek Sumsal [Mon, 12 Apr 2021 15:56:33 +0000 (17:56 +0200)] 
packit: drop the 'sources' file after cloning the Fedora repo

Otherwise rebase-helper thinks we're are a dist-git repository,
replacing the generated git archive with PR changes with the tarball
found in the 'sources' file.

4 years agoMerge pull request #18701 from bugaevc/mdns-unicast
Lennart Poettering [Mon, 12 Apr 2021 15:53:38 +0000 (17:53 +0200)] 
Merge pull request #18701 from bugaevc/mdns-unicast

resolved: reply using unicast mDNS when appropriate

4 years agoMerge pull request #13496 from wat-ze-hex/custom-bpf-progs-parameterized-3
Zbigniew Jędrzejewski-Szmek [Mon, 12 Apr 2021 12:31:42 +0000 (14:31 +0200)] 
Merge pull request #13496 from wat-ze-hex/custom-bpf-progs-parameterized-3

bpf: extend bpf cgroup program support

4 years agoman: fix discriptions for --exec-delay
gaoyi [Mon, 12 Apr 2021 08:09:47 +0000 (16:09 +0800)] 
man: fix discriptions for --exec-delay

There are two ambiguity in the original description:
1. It will delay all RUN instructions, include builtin.
2. It will delay before running RUN, not each of RUN{program} instructions.

4 years agosd-dhcp-client: constify argument in sd_dhcp_lease_get_xxx()
Yu Watanabe [Sun, 11 Apr 2021 08:54:50 +0000 (17:54 +0900)] 
sd-dhcp-client: constify argument in sd_dhcp_lease_get_xxx()

4 years agonetworkctl: drop unused variables
Yu Watanabe [Sun, 11 Apr 2021 15:56:01 +0000 (00:56 +0900)] 
networkctl: drop unused variables

4 years agotest-repart: use cryptsetup and losetup autoclose
Luca Boccassi [Fri, 9 Apr 2021 09:56:13 +0000 (10:56 +0100)] 
test-repart: use cryptsetup and losetup autoclose

The test occasionally fails as the umount is not yet completed when
cryptsetup close is invoked.
Both cryptsetup and losetup have supported deferred cleanup for some
time now, so use it instead to avoid races.

++ losetup -P --show --find /tmp/test-repart.dMOfYQ8UUF/zzz
+ LOOP=/dev/loop6
+ VOLUME=test-repart-11882
+ touch /tmp/test-repart.dMOfYQ8UUF/empty-password
+ cryptsetup open --type=luks2 --key-file=/tmp/test-repart.dMOfYQ8UUF/empty*** test-repart-11882
+ mkdir /tmp/test-repart.dMOfYQ8UUF/mount
+ mount -t ext4 /dev/mapper/test-repart-11882 /tmp/test-repart.dMOfYQ8UUF/mount
+ diff -r /tmp/test-repart.dMOfYQ8UUF/mount/def /tmp/test-repart.dMOfYQ8UUF/definitions
+ umount /tmp/test-repart.dMOfYQ8UUF/mount
+ cryptsetup close test-repart-11882
Device test-repart-11882 is still in use.
+ rm -rf /tmp/test-repart.dMOfYQ8UUF

4 years agoscsi_id: use read_line instead of fgets
Luca Boccassi [Fri, 9 Apr 2021 16:55:57 +0000 (17:55 +0100)] 
scsi_id: use read_line instead of fgets

LGTM warns about it:

"Call to fgets() is potentially dangerous. Use read_line() instead."

4 years agoMerge pull request #19164 from mmatsuya/main
Yu Watanabe [Sun, 11 Apr 2021 07:46:25 +0000 (16:46 +0900)] 
Merge pull request #19164 from mmatsuya/main

tmpfiles: use a entry in hashmap as ItemArray in read_config_file()

4 years agomkosi.arch: add rsync build dependency
Luca Boccassi [Sat, 10 Apr 2021 19:13:02 +0000 (20:13 +0100)] 
mkosi.arch: add rsync build dependency

Program rsync found: NO

man/meson.build:187:0: ERROR: Program 'rsync' not found

4 years agoExtend characters set for PKCS11 URI
Oleg Popov [Sat, 10 Apr 2021 14:21:25 +0000 (17:21 +0300)] 
Extend characters set for PKCS11 URI

There are tokens with dots (and other symbols) in PKCS11 URI:

pkcs11:model=Rutoken%20ECP;manufacturer=Aktiv%20Co.;serial=3xxxxxxb;token=livelace
pkcs11:model=PRO;manufacturer=Aladdin%20R.D.;serial=CC62FB25;token=val%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00;id=%33%32%31%30%33%61%36%37%36%65%32%34%35%62%32%31;type=private

4 years agonetwork: refuse to configure NDISC twice
Yu Watanabe [Sat, 10 Apr 2021 04:37:35 +0000 (13:37 +0900)] 
network: refuse to configure NDISC twice

4 years agoresolved: add RFC 8375 "home.arpa" to list of default NTA
Lennart Poettering [Sat, 10 Apr 2021 12:58:54 +0000 (14:58 +0200)] 
resolved: add RFC 8375 "home.arpa" to list of default NTA

RFC 8375 introduced "home.arpa" as special TLD for home networks. Let's
hence add it to our default list of NTAs.

4 years agoopenssl: make RSA struct const
Lennart Poettering [Sat, 10 Apr 2021 12:59:40 +0000 (14:59 +0200)] 
openssl: make RSA struct const

OpenSSL 3.0 broke API there, but it doesn't hurt to add the "const",
hence add it.

Fixes: #19267
4 years agosd-dhcp6-client: do not use IN_SET() macro when only one target value
Yu Watanabe [Sat, 10 Apr 2021 04:31:08 +0000 (13:31 +0900)] 
sd-dhcp6-client: do not use IN_SET() macro when only one target value

4 years agonetwork: adjust log message
Yu Watanabe [Sat, 10 Apr 2021 04:28:11 +0000 (13:28 +0900)] 
network: adjust log message

4 years agonetwork: drop unnecessary bitfield specifier
Yu Watanabe [Fri, 9 Apr 2021 10:53:40 +0000 (19:53 +0900)] 
network: drop unnecessary bitfield specifier

Manager is allocated only once. It is not necessary to optimize its
size.

4 years agounits: install dbus-org.freedesktop.oom1.service alias
Anita Zhang [Sat, 10 Apr 2021 07:50:50 +0000 (00:50 -0700)] 
units: install dbus-org.freedesktop.oom1.service alias

Fixes: #18469
4 years agofuzz: add BPFProgram= to directives 13496/head
Julia Kartseva [Tue, 22 Dec 2020 17:27:14 +0000 (09:27 -0800)] 
fuzz: add BPFProgram= to directives

4 years agodbus-cgroup: add BPFProgram= dbus support
Julia Kartseva [Wed, 9 Dec 2020 06:07:30 +0000 (22:07 -0800)] 
dbus-cgroup: add BPFProgram= dbus support

- Handle BPFProgram= property in string format
"<bpf_attach_type>:<bpffs_path>", e.g. egress:/sys/fs/bpf/egress-hook.
- Add dbus getter to list foreign bpf programs attached to a cgroup.

4 years agoman: add BPFProgram= documentation
Julia Kartseva [Wed, 9 Dec 2020 06:06:56 +0000 (22:06 -0800)] 
man: add BPFProgram= documentation

4 years agotests: add unit file tests for BPFProgram=
Julia Kartseva [Wed, 4 Sep 2019 02:08:13 +0000 (19:08 -0700)] 
tests: add unit file tests for BPFProgram=

- Pin trivial bpf programs to bpf filesystem, compose BPFProgram= option
string and pass it to a unit. Programs store `0` in r0 BPF register for
denying action, e.g. drop a packet.
- Load trivial BPF programs
- Test is skipped if not run under root or if can not lock enough
memory.
- For egress and ingress hooks, test BPFProgram= option along with
with IP{Egress|Ingress}FilterPath=, expected result should not depend on
which rule is executed first.
Expected results for BPF_CGROUP_INET_INGRESS:
5 packets transmitted, 0 received, 100% packet loss, time 89ms

For BPF_CGROUP_INET_SOCK_CREATE:
ping: socket: Operation not permitted

4 years agocore: add bpf-foreign to fragment parser
Julia Kartseva [Thu, 4 Feb 2021 08:04:19 +0000 (00:04 -0800)] 
core: add bpf-foreign to fragment parser

- Parse a string for bpf attach type
- Simplify bpffs path
- Add foreign bpf program to cgroup context

4 years agocore: add bpf-foreign cgroup mask and harness
Julia Kartseva [Thu, 4 Feb 2021 08:03:08 +0000 (00:03 -0800)] 
core: add bpf-foreign cgroup mask and harness

Add CGROUP_MASK_BPF_FOREIGN to CGROUP_MASK_BPF and standard cgroup
context harness.

4 years agocore: add bpf-foreign unit helpers
Julia Kartseva [Wed, 16 Sep 2020 22:58:04 +0000 (15:58 -0700)] 
core: add bpf-foreign unit helpers

- Introduce support of cgroup-bpf programs managed (i.e. compiled,
loaded to and unloaded from kernel) externally. Systemd is only
responsible for attaching programs to unit cgroup hence the name
'foreign'.

Foreign BPF programs are identified by bpf program ID and attach type.

systemd:
- Gets kernel FD of BPF program;
- Makes a unique identifier of BPF program from BPF attach type and
program ID. Same program IDs mean the same program, i.e the same
chunk of kernel memory. Even if the same program is passed multiple
times, identical (program_id, attach_type) instances are collapsed
into one;
- Attaches programs to unit cgroup.

4 years agocgroup: add foreign program to cgroup context
Julia Kartseva [Tue, 2 Mar 2021 00:56:04 +0000 (16:56 -0800)] 
cgroup: add foreign program to cgroup context

- Store foreign bpf programs in cgroup context. A program is considered
foreign if it was loaded to a kernel by an entity external to systemd,
so systemd is responsible only for attach and detach paths.
- Support the case of pinned bpf programs: pinning to bpffs so a program
is kept loaded to the kernel even when program fd is closed by a user
application is a common way to extend program's lifetime.
- Aadd linked list node struct with attach type and bpffs path
fields.