]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
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/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 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: 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 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 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 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 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 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 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 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 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 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.

4 years agoshared: bpf_attach_type {from,to} string
Julia Kartseva [Thu, 4 Feb 2021 08:02:07 +0000 (00:02 -0800)] 
shared: bpf_attach_type {from,to} string

Introduce bpf_cgroup_attach_type_table with accustomed attached type
names also used in bpftool.
Add bpf_cgroup_attach_type_{from|to}_string helpers to convert from|to
string representation of pinned bpf program, e.g.
"egress:/sys/fs/bpf/egress-hook" for
/sys/fs/bpf/egress-hook path and BPF_CGROUP_INET_EGRESS attach type.

4 years agoshared: add bpf-program helpers
Julia Kartseva [Wed, 16 Sep 2020 22:58:04 +0000 (15:58 -0700)] 
shared: add bpf-program helpers

Add helpers to:
- Create new BPFProgram instance from a path in bpf
filesystem and bpf attach type;
- Pin a program to bpf fs;
- Get BPF program ID by BPF program FD.

4 years agobpf-firewall: attach with BPF_F_ALLOW_MULTI if kernel supports
Julia Kartseva [Thu, 4 Feb 2021 06:15:27 +0000 (22:15 -0800)] 
bpf-firewall: attach with BPF_F_ALLOW_MULTI if kernel supports

Reduced version of [0].
Use BPF_F_ALLOW_MULTI attach flag for bpf-firewall if kernel supports
it.

Aside from addressing security issue in [0] attaching with 'multi'
allows further attaching of cgroup egress, ingress hooks specified by
BPFProgram=.

[0] https://github.com/systemd/systemd/pull/17495/commits/4e42210d40f96e185a55d43041dd6b962ea830dd

4 years agosd-device: fix error code returned by sd_device_get_sysattr_value() for non-existing...
Lennart Poettering [Fri, 9 Apr 2021 13:00:16 +0000 (15:00 +0200)] 
sd-device: fix error code returned by sd_device_get_sysattr_value() for non-existing attributes

lstat() returns the error in errno, not as return value. Let's propagate
this correctly.

This broke the bolt test suite, as @gicmo discovered.

Follow-up for acfc2a1d15560084e077ffb3be472cd117e9020a.

4 years agogpt-auto-generator: don't generate systemd-cryptsetup@.service when --Dlibcryptsetup...
gaoyi [Tue, 6 Apr 2021 02:44:33 +0000 (10:44 +0800)] 
gpt-auto-generator: don't generate systemd-cryptsetup@.service when --Dlibcryptsetup=false

4 years agoMerge pull request #19243 from bluca/lgtm
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 11:12:41 +0000 (13:12 +0200)] 
Merge pull request #19243 from bluca/lgtm

Fix various issues reported by LGTM

4 years agohwdb: 60-keyboard:: Update MSI Modern backslash and hotkeys
Aakash Singh [Tue, 6 Apr 2021 20:13:46 +0000 (01:43 +0530)] 
hwdb: 60-keyboard:: Update MSI Modern backslash and hotkeys

fix typos

4 years agologin: logind-dbus: support scheduled kexec (#19162)
Jérôme Carretero [Fri, 9 Apr 2021 08:55:58 +0000 (04:55 -0400)] 
login: logind-dbus: support scheduled kexec (#19162)

login: logind-dbus: support delayed kexec

4 years agoman: document system-systemd\x2dcryptsetup.slice
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 07:27:42 +0000 (09:27 +0200)] 
man: document system-systemd\x2dcryptsetup.slice

As discussed in
https://github.com/systemd/systemd/pull/14235/commits/1dc85eff1d0dff18aaeaae530c91bf53f34b726e#r606821495,
follow-up for commit 1dc85eff1d0dff18aaeaae530c91bf53f34b726e.

4 years agodocs: use new URL for package-notes
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 08:27:36 +0000 (10:27 +0200)] 
docs: use new URL for package-notes

4 years agopo: Translated using Weblate (Korean)
simmon [Fri, 9 Apr 2021 07:01:57 +0000 (09:01 +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 agonetwork: do not require DHCPv6 addresses when UseAddress=no
Yu Watanabe [Wed, 7 Apr 2021 17:29:52 +0000 (02:29 +0900)] 
network: do not require DHCPv6 addresses when UseAddress=no

Follow-up for 1536b7b2d00819615bf8eba194de7ccd20c3689f.

Fixes #19196.

4 years agoMerge pull request #19254 from poettering/native-journal-proto-doc
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 06:13:21 +0000 (08:13 +0200)] 
Merge pull request #19254 from poettering/native-journal-proto-doc

document native journal protocol

4 years agoMerge pull request #19255 from poettering/glyph-love
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 06:05:14 +0000 (08:05 +0200)] 
Merge pull request #19255 from poettering/glyph-love

some SpecialGlyph tweaks

4 years agoMerge pull request #19248 from keszybz/make-tests-test
Zbigniew Jędrzejewski-Szmek [Fri, 9 Apr 2021 05:56:04 +0000 (07:56 +0200)] 
Merge pull request #19248 from keszybz/make-tests-test

Make tests test

4 years agocore: rework unit_active_state_to_glyph() to use a translation table 19255/head
Lennart Poettering [Thu, 8 Apr 2021 21:01:25 +0000 (23:01 +0200)] 
core: rework unit_active_state_to_glyph() to use a translation table

Let's make this a bit more readable by implementing this via a
translation table, indexed by the state.

4 years agolocale-util: make SpecialGlyph more like our usual enums
Lennart Poettering [Thu, 8 Apr 2021 20:59:43 +0000 (22:59 +0200)] 
locale-util: make SpecialGlyph more like our usual enums

Let's define both an enum and a typedef named SpecialGlyph, the way we
usually do it.

Also, introduce an "invalid" special glyph, assigned to -EINVAL, also
like we always do it. (And handle it somewhat sanely in special_glyph()

4 years agoman: link up new journal protocol docs 19254/head
Lennart Poettering [Thu, 8 Apr 2021 20:14:57 +0000 (22:14 +0200)] 
man: link up new journal protocol docs

4 years agodocs: document native journal protocol
Lennart Poettering [Thu, 8 Apr 2021 20:07:00 +0000 (22:07 +0200)] 
docs: document native journal protocol

Fixes: #17748
4 years agoMerge pull request #19226 from keszybz/reenable-maybe-unitialized-warning
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 18:29:05 +0000 (20:29 +0200)] 
Merge pull request #19226 from keszybz/reenable-maybe-unitialized-warning

meson: re-enable -Wmaybe-uninitialized

4 years agoMerge pull request #19250 from keszybz/sd-bus-is-ready-simplification
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 18:26:30 +0000 (20:26 +0200)] 
Merge pull request #19250 from keszybz/sd-bus-is-ready-simplification

Simplify how sd_bus_is_ready() is used

4 years agoTEST-17: make the test test 19248/head
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 08:57:40 +0000 (10:57 +0200)] 
TEST-17: make the test test

'! grep -v' does *not* test that there are no matching lines.
Instead, it checks that whether there are any non-matching lines.

And of course, for the test to fail, '! grep' cannot be part of
an expression with &&.

4 years agoTEST-46: simplify lossy diff invocation
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 08:34:53 +0000 (10:34 +0200)] 
TEST-46: simplify lossy diff invocation

4 years agohomectl,TEST-46: fix test and fix homectl return value, update docs
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 08:34:28 +0000 (10:34 +0200)] 
homectl,TEST-46: fix test and fix homectl return value, update docs

The usual: the test wasn't testing, so we didn't notice that the
command wasn't returning as expected.

4 years agoTEST-44: fix test
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 07:47:04 +0000 (09:47 +0200)] 
TEST-44: fix test

We were grepping for 'hello world', and in the namespace we would
match on 'hello world', and outside, on 'echo "hello world"'. When
the condition check was fixed, the test gave a false positive.

4 years agoTEST-43: fix exit condition testing
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 07:45:28 +0000 (09:45 +0200)] 
TEST-43: fix exit condition testing

We were invoking 'systemd-run bash', but the test invoked by bash
was not effective. When the result of that check is propagated, the
outer command fails.

4 years agoTEST-*: use spacing before redirection operator, but not after
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 22:09:55 +0000 (00:09 +0200)] 
TEST-*: use spacing before redirection operator, but not after

<< EOF → <<EOF
> foo < bar → >foo <bar

4 years agoTEST-*: make failure tests actually fail on failure
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 23:27:33 +0000 (01:27 +0200)] 
TEST-*: make failure tests actually fail on failure

Here the intent was actually correct, and the tests still pass when the check
is made effective.

4 years agoTEST-42-EXECSTOPPOST: un-invert test
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 23:23:49 +0000 (01:23 +0200)] 
TEST-42-EXECSTOPPOST: un-invert test

Since we test for the file right below, it seems we expected the
command to succeed.

4 years agotmpfiles: make handling of existing-but-different targets more consistent
Zbigniew Jędrzejewski-Szmek [Wed, 7 Apr 2021 22:48:35 +0000 (00:48 +0200)] 
tmpfiles: make handling of existing-but-different targets more consistent

create_fifo() was added in a2fc2f8dd30c17ad1e23a31fc6ff2aeba4c6fa27, and
would always ignore failure. The test was trying to fail in this case, but
we actually don't fail, which seems to be correct. We didn't notice before
because the test was ineffective.

To make things consistent, generally log at warning level, but don't propagate
the error. For symlinks, log at debug level, as before.

For 'e', failure is not propagated now. The test is adjusted to match.

I think warning is appropriate in most cases: we do not expect a device node to
be replaced by a different device node or even a non-device file. This would
most likely be an error somewhere. An exception is made for symlinks, which are
mismatched on purpose, for example /etc/resolv.conf. With this patch, we don't
get any warnings with the any of the 74 tmpfiles.d files, which suggests that
increasing the warning levels will not cause too many unexpected warnings. If
it turns out that there are valid cases where people have expected mismatches
for non-symlink types, we can always decrease the log levels again.

4 years agotests: allow for os-release quote variability in TEST-50-DISSECT
Luca Boccassi [Thu, 8 Apr 2021 10:30:33 +0000 (11:30 +0100)] 
tests: allow for os-release quote variability in TEST-50-DISSECT

Quoting of values differs between distros: Fedora doesn't quote the ID_
fields, but CentOS does.
Adjust the test checks to account for this.

Fixes #19242

4 years agonetworkd: simplify sd_bus_is_ready() checks 19250/head
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 13:04:18 +0000 (15:04 +0200)] 
networkd: simplify sd_bus_is_ready() checks

Also add "system" in the messages, because we set the internal value,
and are just skipping the setting of the external value, so the message
could be confusing without that clarification.

4 years agosd-bus: make sd_bus_is_{ready,open} accept NULL
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 12:59:10 +0000 (14:59 +0200)] 
sd-bus: make sd_bus_is_{ready,open} accept NULL

We didn't document this behaviour one way or another, so I think it's
OK to change. All callers do the NULL check before callling this to avoid
the assert warning, so it seems reasonable to do it internally.

sd_bus_can_send() is similar, but there we expressly say that an
error is returned on NULL, so I didn't change it.

4 years agonetwork: do not emit changed properties when bus connection is not ready
Yu Watanabe [Wed, 7 Apr 2021 16:58:55 +0000 (01:58 +0900)] 
network: do not emit changed properties when bus connection is not ready

Prompted by #19212.

4 years agotest: move check of nat table existence
Yu Watanabe [Wed, 7 Apr 2021 16:47:52 +0000 (01:47 +0900)] 
test: move check of nat table existence

As test_v4() with iptables backend will be called after nftables tests.

Follow-up for afbcd905526111e3a1bd55b0d6d5ee4413734735.

4 years agoMerge pull request #19237 from yuwata/udev-builtin-net-id-follow-ups-for-19017
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 12:37:02 +0000 (14:37 +0200)] 
Merge pull request #19237 from yuwata/udev-builtin-net-id-follow-ups-for-19017

udev: fix several issues around hotplug slot detection

4 years agoin-addr-util: suppress LGTM warning about htobe32 19243/head
Luca Boccassi [Wed, 7 Apr 2021 22:08:34 +0000 (23:08 +0100)] 
in-addr-util: suppress LGTM warning about htobe32

We are not calling it directly, it's coming from a standard library
macro, so just suppress it.

4 years agoerrno-util: suppress LGTM warning about strerror
Luca Boccassi [Wed, 7 Apr 2021 22:06:24 +0000 (23:06 +0100)] 
errno-util: suppress LGTM warning about strerror

4 years agoscsi_id: modernize and use extract_many_words instead of strsep
Luca Boccassi [Wed, 7 Apr 2021 21:58:12 +0000 (22:58 +0100)] 
scsi_id: modernize and use extract_many_words instead of strsep

Also use standard error loggin/return pattern.

Only cursory tested, by checking that with a simple config file
the array is the same before/after. Not tested with actual scsi
rules and devices, due to missing hardware.

4 years agotest-extract-word: add a couple more corner cases
Luca Boccassi [Wed, 7 Apr 2021 21:52:32 +0000 (22:52 +0100)] 
test-extract-word: add a couple more corner cases

4 years agotimedated: use format_timestamp instead of ctime
Luca Boccassi [Sat, 3 Apr 2021 13:46:46 +0000 (14:46 +0100)] 
timedated: use format_timestamp instead of ctime

Some static analyzers (lgtm) warn against using non-re-entrant functions,
even though at the moment this code is not multi-threaded, just switch to
format_timestamp.

4 years agomeson: re-enable -Wmaybe-uninitialized on -O[02] with recent gcc versions 19226/head
Zbigniew Jędrzejewski-Szmek [Wed, 31 Mar 2021 15:05:49 +0000 (17:05 +0200)] 
meson: re-enable -Wmaybe-uninitialized on -O[02] with recent gcc versions

The warning was disabled in 8794164fed5f0142c34358613f92f4f761af4edd to avoid
false positives. But it is useful in finding errors, even if it sometimes
results in untrue warnings (c.f. 77fac974feda46a1bc3c).

After #19168, #19169, and #19175, there are no warnings with
-Dbuildtype=debug-optimized/-O2 and gcc-11.0.1-0.3.fc34.x86_64. Warnings
are reenabled for -O[23]

-O0 is good for development, and -O2 is the default optimization level for
Fedora package builds. -Os, -O3, -O1, and -Og still generate some warnings. In
fact, with -Os the number of warnings seems completely hopeless. Dozens and
dozens.

4 years agohome: use goto to make it clear that variables are initialized
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 10:57:23 +0000 (12:57 +0200)] 
home: use goto to make it clear that variables are initialized

gcc-11.0.1-0.3.fc34.x86_64 with -Og was complaining that 'r' might be
unitialized. It cannot, but let's rework the code to use a goto instead of
conditionalizing on 'call' being unset, which I think is clearer and less error
prone. This silences the warning.

4 years agobasic/strbuf: use _cleanup_
Zbigniew Jędrzejewski-Szmek [Thu, 8 Apr 2021 10:54:55 +0000 (12:54 +0200)] 
basic/strbuf: use _cleanup_