Commit Graph

52818 Commits

Author SHA1 Message Date
Yu Watanabe
42867dfeef test-execute: add a testcase for MountAPIVFS=no 2021-08-26 02:54:37 +09:00
Yu Watanabe
aa2727517e test-execute: logs can_share flag 2021-08-24 02:04:24 +09:00
Yu Watanabe
93413acd3e path-util: make find_executable() work without /proc mounted
Follow-up for 888f65ace6.

Hopefully fixes #20514.
2021-08-24 02:04:24 +09:00
Yu Watanabe
ded8039abe path-util: split out common part in find_executable_full() 2021-08-24 02:04:24 +09:00
Yu Watanabe
3a1220eedf Merge pull request #20513 from yuwata/network-allow-deny-list-take-prefix-length
network: dhcp4,ndisc: make addresses in Allow/DenyList= optionally take prefix length
2021-08-24 02:01:51 +09:00
Lennart Poettering
3e4ca3940d json: rework JSON_BUILD_XYZ() macros to use compound literals instead of compound statements
Compound statements is this stuff: ({ … })

Compound literals is this stuff: (type) { … }

We use compound statements a lot in macro definitions: they have one
drawback though: they define a code block of their own, hence if macro
invocations are nested within them that use compound literals their
lifetime is limited to the code block, which might be unexpected.

Thankfully, we can rework things from compound statements to compund
literals in the case of json.h: they don't open a new codeblack, and
hence do not suffer by the problem explained above.

The interesting thing about compound statements is that they also work
for simple types, not just for structs/unions/arrays. We can use this
here for a typechecked implicit conversion: we want to superficially
typecheck arguments to the json_build() varargs function, and we do that
by assigning the specified arguments to our compound literals, which
does the minimal amount of typechecks and ensures that types are
propagated on correctly.

We need one special tweak for this: sd_id128_t is not a simple type but
a union. Using compound literals for initialzing that would mean
specifiying the components of the union, not a complete sd_id128_t. Our
hack around that: instead of passing the object directly via the stack
we now take a pointer (and thus a simple type) instead.

Nice side-effect of all this: compound literals is C99, while compound
statements are a GCC extension, hence we move closer to standard C.

Fixes: #20501
Replaces: #20512
2021-08-23 16:07:28 +01:00
Yu Watanabe
ab47f96041 test-network: add more testcases for *Allow/DenyList= 2021-08-23 20:37:36 +09:00
Yu Watanabe
c995fa02b1 network: dhcp4,ndisc: make addresses in Allow/DenyList= optionally take prefix length
Closes #20505.
2021-08-23 20:36:09 +09:00
Yu Watanabe
f95d1ef5fa Merge pull request #20498 from yuwata/network-fix-gateway
network: fix logic for checking gateway address
2021-08-22 22:58:20 +09:00
Jan Kuparinen
7acedf31e6 po: Added translation using Weblate (Finnish)
Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
2021-08-22 15:20:22 +02:00
Yu Watanabe
d4e30ad1fb tree-wide: fix typo 2021-08-22 09:46:22 +01:00
Yu Watanabe
a353fda224 Merge pull request #20303 from andir/sysconfig-example
{core, login}: respect install_sysconfdir_samples in meson file
2021-08-22 15:40:39 +09:00
Yu Watanabe
180c5116b3 test-network: add testcases that gateway address is IPv6 link local 2021-08-22 15:35:22 +09:00
Yu Watanabe
3333350a0e network: fix logic for checking gateway address is ready
This fixes the followings:
- The corresponding route or address to the gateway address must be in
  the same link.
- IPv6 link local address is not necessary to be reachable.

Fixes an issue reported in https://github.com/systemd/systemd/issues/8686#issuecomment-902562324.
2021-08-22 15:35:22 +09:00
Andreas Rammhold
72964d047a login: respect install_sysconfdir_samples in meson file
The refactoring done in c900d89faa caused the configuration files to be
installed into the pkgsysconfdir regardless of the state of the
install_sysconfdir_samples boolean that indicates whether or not the
sample files should be installed.
2021-08-21 15:09:44 +02:00
Andreas Rammhold
cfd760b6a7 core: respect install_sysconfdir_samples in meson file
The refactoring done in e11a25cadb caused the configuration files to be
installed into the pkgsysconfdir regardless of the state of the
install_sysconfdir_samples boolean that indicates whether or not the
sample files should be installed.
2021-08-21 15:09:44 +02:00
Daan De Meyer
66dc9b4634 docs: Add documentation on how to use VSCode to debug systemd via mkosi 2021-08-21 10:31:32 +01:00
Yu Watanabe
218262c0b1 Merge pull request #20500 from poettering/import-tweaks
a few minor tweaks/bugfixlets to importd backends
2021-08-21 12:50:22 +09:00
Yu Watanabe
455bb37a8b Merge pull request #20499 from poettering/align-to-tweak
ALIGN_TO() tweaks
2021-08-21 12:50:07 +09:00
Yu Watanabe
cc97ef5627 Merge pull request #20494 from bluca/snprintf_voidify
tree-wide: voidify unchecked snprintf calls or use snprintf_ok
2021-08-21 06:45:58 +09:00
Yu Watanabe
0e0e57a484 Merge pull request #20484 from DaanDeMeyer/rx-gro-hw
Add rx-gro-hw support
2021-08-21 06:43:49 +09:00
Frantisek Sumsal
faca95e115 test: make sure test timeout has a higher priority than a pass
otherwise we might mark tests where something crashes during shutdown as
successful, as happened in one of the recent TEST-01-BASIC runs:

```
testsuite-01.service: About to execute rm -f /failed /testok
testsuite-01.service: Forked rm as 606
testsuite-01.service: Executing: rm -f /failed /testoktestsuite-01.service: Changed dead -> start-pre
         Starting TEST-01-BASIC...
...
Child 606 (rm) died (code=exited, status=0/SUCCESS)
testsuite-01.service: Child 606 belongs to testsuite-01.service.
testsuite-01.service: Control process exited, code=exited, status=0/SUCCESS (success)
testsuite-01.service: Got final SIGCHLD for state start-pre.
testsuite-01.service: Passing 0 fds to service
testsuite-01.service: About to execute sh -e -x -c "systemctl --state=failed --no-legend --no-pager >/failed ; systemctl daemon-reload ; echo OK >/testok"
testsuite-01.service: Forked sh as 607
testsuite-01.service: Changed start-pre -> start
testsuite-01.service: Executing: sh -e -x -c "systemctl --state=failed --no-legend --no-pager >/failed ; systemctl daemon-reload ; echo OK >/testok"systemd-journald.service: Got notification message from PID 560 (FDSTORE=1)S
...
testsuite-01.service: Child 607 belongs to testsuite-01.service.
testsuite-01.service: Main process exited, code=exited, status=0/SUCCESS (success)
testsuite-01.service: Deactivated successfully.
testsuite-01.service: Service will not restart (restart setting)
testsuite-01.service: Changed start -> dead
testsuite-01.service: Job 207 testsuite-01.service/start finished, result=done
[  OK  ] Finished TEST-01-BASIC.
...
end.service: About to execute /bin/sh -x -c "systemctl poweroff --no-block"
end.service: Forked /bin/sh as 623end.service: Executing: /bin/sh -x -c "systemctl poweroff --no-block"
...
end.service: Job 213 end.service/start finished, result=canceled
Caught <SEGV>, dumped core as pid 624.
Freezing execution.

CentOS Linux 8
Kernel 4.18.0-305.12.1.el8_4.x86_64 on an x86_64 (ttyS0)

H login: qemu-kvm: terminating on signal 15 from pid 80134 (timeout)
E: Test timed out after 600s
Spawning getter /root/systemd/build/journalctl -o export -D /var/tmp/systemd-test.0UYjAS/root/var/log/journal/ca6031c2491543fe8286c748258df8d1...
Finishing after writing 15125 entries
Spawning getter /root/systemd/build/journalctl -o export -D /var/tmp/systemd-test.0UYjAS/root/var/log/journal/remote...
Finishing after writing 0 entries
-rw-r-----. 1 root root 25165824 Aug 20 12:26 /var/tmp/systemd-test.0UYjAS/system.journal
TEST-01-BASIC RUN: Basic systemd setup [OK]
...
2021-08-21 06:40:25 +09:00
Lennart Poettering
c7ed718720 macro: handle overflow in ALIGN_TO() somewhat reasonably
The helper call rounds up to next multiple of specified boundary. If one
passes a very large value as first argument, then there might not be a
next multiple. So far we ignored that. Let's handle this now and return
SIZE_MAX in this case, as special indicator that we reached the end.

Of course, IRL this should not happen. With this new change we at least
do something somewhat reasonable, leaving it to the caller to handle it
further.
2021-08-20 22:00:48 +02:00
Lennart Poettering
eeed637fea test: split out macro tests into own test-macro.c
No changes in code, just a split out of tests for stuff from macro.h
into test-macro.c
2021-08-20 22:00:48 +02:00
Lennart Poettering
983b69c3f5 import-fs: create paren dirs in --direct mode too
There's no reason not to create these in advance if they are missing.
2021-08-20 21:57:08 +02:00