]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
18 months agotest-network: add test for stack overflow in qdisc_drop() and tclass_drop() 32258/head
Yu Watanabe [Sat, 13 Apr 2024 00:02:01 +0000 (09:02 +0900)] 
test-network: add test for stack overflow in qdisc_drop() and tclass_drop()

18 months agonetwork/tc: fix stack overflow when dropping tclass or qdisc
Yu Watanabe [Fri, 12 Apr 2024 23:46:44 +0000 (08:46 +0900)] 
network/tc: fix stack overflow when dropping tclass or qdisc

Fixes a bug introduced by be8e93390003e45acbb318c6e1e48fbc3c772f78 (v255).

Fixes #32247.
Fixes #32254.

18 months agoMerge pull request #32257 from yuwata/tree-wide-trivial-style-fixes
Yu Watanabe [Fri, 12 Apr 2024 23:02:18 +0000 (08:02 +0900)] 
Merge pull request #32257 from yuwata/tree-wide-trivial-style-fixes

tree-wide: trivial style and typo fixes

18 months agovmspawn: check firmware target architecture
Sam Leonard [Thu, 11 Apr 2024 11:26:10 +0000 (12:26 +0100)] 
vmspawn: check firmware target architecture

Fixes issue #32026 by only finding firmwares which explicitly support
the native architecture.

18 months agotree-wide: insert missing space after comma 32257/head
Yu Watanabe [Fri, 12 Apr 2024 20:44:04 +0000 (05:44 +0900)] 
tree-wide: insert missing space after comma

18 months agojournal: drop thousands separator in comment
Yu Watanabe [Fri, 12 Apr 2024 20:43:37 +0000 (05:43 +0900)] 
journal: drop thousands separator in comment

18 months agohome: wrap long line
Yu Watanabe [Fri, 12 Apr 2024 20:42:21 +0000 (05:42 +0900)] 
home: wrap long line

18 months agohomectl: realign table
Yu Watanabe [Fri, 12 Apr 2024 20:41:46 +0000 (05:41 +0900)] 
homectl: realign table

18 months agonetwork/ndisc: fix typo
Yu Watanabe [Fri, 12 Apr 2024 20:21:38 +0000 (05:21 +0900)] 
network/ndisc: fix typo

Follow-up for e42a74803a5a9a8acf0d630dd775736610af4600.

18 months agocore: fix typo
Yu Watanabe [Fri, 12 Apr 2024 20:20:02 +0000 (05:20 +0900)] 
core: fix typo

Follow-up for 21b366121f02aaeba5ba8c7597bba21c450172b5.

18 months agofuzz: check that resource records are serialized successfully
Evgeny Vereshchagin [Fri, 12 Apr 2024 08:59:26 +0000 (08:59 +0000)] 
fuzz: check that resource records are serialized successfully

It shouldn't fail at that point.

It's prompted by the "Structure needs cleaning" thing that keeps popping
up in various places like
https://github.com/systemd/systemd/pull/30952#discussion_r1553181309 and
https://github.com/systemd/systemd/issues/31708.

18 months agoMerge pull request #32255 from YHNdnzj/strextendf
Yu Watanabe [Fri, 12 Apr 2024 20:10:20 +0000 (05:10 +0900)] 
Merge pull request #32255 from YHNdnzj/strextendf

shared/killall: minor modernization

18 months agoMerge pull request #32256 from YHNdnzj/network-close-and-replace
Yu Watanabe [Fri, 12 Apr 2024 20:09:36 +0000 (05:09 +0900)] 
Merge pull request #32256 from YHNdnzj/network-close-and-replace

sd-dhcp-server: use close_and_replace (avoid fd leak)

18 months agosd-dhcp-server: use close_and_replace (avoid fd leak) 32256/head
Mike Yuan [Fri, 12 Apr 2024 18:40:22 +0000 (02:40 +0800)] 
sd-dhcp-server: use close_and_replace (avoid fd leak)

Follow-up for 11b88419ae0004547a0724aa459ddcb5d243f25c

Fixes #32252

18 months agosd-dhcp-server: check dir_fd with assert_return
Mike Yuan [Fri, 12 Apr 2024 18:47:42 +0000 (02:47 +0800)] 
sd-dhcp-server: check dir_fd with assert_return

18 months agoshared/killall: minor modernization 32255/head
Mike Yuan [Thu, 11 Apr 2024 13:50:20 +0000 (21:50 +0800)] 
shared/killall: minor modernization

18 months agostring-util: correct comment in strextendf_with_separator
Mike Yuan [Fri, 12 Apr 2024 18:33:50 +0000 (02:33 +0800)] 
string-util: correct comment in strextendf_with_separator

18 months agovmspawn: add --discard-disk= to control handling of disk discard requests
Sam Leonard [Thu, 11 Apr 2024 11:48:00 +0000 (12:48 +0100)] 
vmspawn: add --discard-disk= to control handling of disk discard requests

Fixes issue #32024, using --discard-disk=yes will enable handling of disk
discarding requests, saving space for long running VMs as desired.

18 months agotest: add instructions on how to run Coverity locally
Frantisek Sumsal [Fri, 12 Apr 2024 12:37:25 +0000 (14:37 +0200)] 
test: add instructions on how to run Coverity locally

This requires a Coverity license, so the usefulness of the instructions
is somewhat limited, but at least I won't have to re-discover everything
from scratch when I need to debug something Coverity-related again in the
future.

18 months agovmspawn: update parse_boolean to parse_boolean_argument
Sam Leonard [Fri, 12 Apr 2024 07:36:55 +0000 (08:36 +0100)] 
vmspawn: update parse_boolean to parse_boolean_argument

18 months agobus-polkit: fix return value for `varlink_allow_interactive_authentication()`
Antonio Alvarez Feijoo [Fri, 12 Apr 2024 08:53:40 +0000 (10:53 +0200)] 
bus-polkit: fix return value for `varlink_allow_interactive_authentication()`

Follow-up for d04c1a1c8e7c95daa483d8d52d5fc4c25fbc67f2

18 months agomeson: do not fail build with newer kernel headers
Zbigniew Jędrzejewski-Szmek [Sun, 7 Apr 2024 08:39:20 +0000 (10:39 +0200)] 
meson: do not fail build with newer kernel headers

systemd-255 is failing a build with the latest kernel headers… Let's downgrade
this warning, because it's fine if there's a file system we don't know about
and it makes thing less brittle if we don't treat this as a hard error.

(I initially conditionalized this on BUILD_MODE, but I don't think we need a
hard error there either. A warning will be noticed and fixed.)

18 months agondisc-option: also ignore Prefix Information option with multicast address
Yu Watanabe [Thu, 11 Apr 2024 18:30:01 +0000 (03:30 +0900)] 
ndisc-option: also ignore Prefix Information option with multicast address

Fixes https://github.com/systemd/systemd/pull/32215#issuecomment-2049624693

18 months agoMerge pull request #32240 from yuwata/network-ndisc-fix-on-link-prefix
Daan De Meyer [Fri, 12 Apr 2024 06:46:34 +0000 (08:46 +0200)] 
Merge pull request #32240 from yuwata/network-ndisc-fix-on-link-prefix

network/ndisc: fixlets for on-link prefix

18 months agonetwork/ndisc: drop onlink prefix when valid lifetime is zero 32240/head
Yu Watanabe [Thu, 11 Apr 2024 19:38:42 +0000 (04:38 +0900)] 
network/ndisc: drop onlink prefix when valid lifetime is zero

Replaces 155d7a2c049cf866a0bfde8de371f09dfb3b6f29.

18 months agonetwork/ndisc: do nothing for existing routes if on-link flag is zero
Yu Watanabe [Thu, 11 Apr 2024 19:24:57 +0000 (04:24 +0900)] 
network/ndisc: do nothing for existing routes if on-link flag is zero

This effectively reverts commit 155d7a2c049cf866a0bfde8de371f09dfb3b6f29.

From RFC 4861 section 6.3.4:
> Note, however, that a Prefix Information option with the on-link flag
> set to zero conveys no information concerning on-link determination and
> MUST NOT be interpreted to mean that addresses covered by the prefix
> are off-link.

So, we should not drop previously configured routes when receieved a RA
with Prefix Information option without on-link flag.

Closes #28435.

18 months agoresolved: use NULL to represent an empty answer
Ronan Pigott [Thu, 11 Apr 2024 18:52:57 +0000 (11:52 -0700)] 
resolved: use NULL to represent an empty answer

18 months agovmspawn: enabled free page reporting in qemu by default
Sam Leonard [Thu, 11 Apr 2024 11:54:42 +0000 (12:54 +0100)] 
vmspawn: enabled free page reporting in qemu by default

Fixes issue #32025, I saw no reason not to enable this by default so I
added it to the initial qemu cmdline.

18 months agoMerge pull request #32213 from yuwata/network-ndisc-redirect-fix-sender-address-verif...
Yu Watanabe [Thu, 11 Apr 2024 21:09:44 +0000 (06:09 +0900)] 
Merge pull request #32213 from yuwata/network-ndisc-redirect-fix-sender-address-verification

network/ndisc: fix sender address verification of Redirect message

18 months agonsresourced: don't redefine of bpf_rdonly_cast
Ludwig Nussel [Mon, 8 Apr 2024 09:07:10 +0000 (11:07 +0200)] 
nsresourced: don't redefine of bpf_rdonly_cast

bpf_rdonly_cast() was introduced in libbpf commit 688879f together with
the definition of a bpf_core_cast macro. So use that one to avoid
defining a prototype for bpf_rdonly_cast;

18 months agosd-ndisc-redirect: fix verification of target address 32213/head
Yu Watanabe [Wed, 10 Apr 2024 06:36:59 +0000 (15:36 +0900)] 
sd-ndisc-redirect: fix verification of target address

See RFC 4861 section 8.1.

18 months agonetwork/ndisc: fix verification of sender of Redirect message
Yu Watanabe [Wed, 10 Apr 2024 06:07:30 +0000 (15:07 +0900)] 
network/ndisc: fix verification of sender of Redirect message

The sender must be the first-hop router of the destination. Previously,
we only accepted Redirect messages whose sender is the current default
router with the highest priority.

See RFC 4861 section 8.1 for more details.

Fixes #31981.

18 months agonetwork/ndisc: split out ndisc_redirect_verify_sender()
Yu Watanabe [Wed, 10 Apr 2024 05:52:57 +0000 (14:52 +0900)] 
network/ndisc: split out ndisc_redirect_verify_sender()

No functional change, preparation for later commits.

18 months agonetwork/ndisc: drop ndisc_request_redirect_route()
Yu Watanabe [Wed, 10 Apr 2024 06:04:11 +0000 (15:04 +0900)] 
network/ndisc: drop ndisc_request_redirect_route()

It is now called by only ndisc_redirect_handler(), and the check in
ndisc_request_redirect_route() is redundant and already done by
ndisc_redirect_verify_sender().

No functional change, just refactoring.

18 months agonetwork/ndisc: redirect routes do not have lifetime
Yu Watanabe [Wed, 10 Apr 2024 05:58:31 +0000 (14:58 +0900)] 
network/ndisc: redirect routes do not have lifetime

Hence, ndisc_router_update_redirect() does nothing. Let's remove it.
Also, ndisc_request_route() does not set lifetime for the route, it is
not necessary to set the third argument.

18 months agonetwork/ndisc: introduce ndisc_request_router_route()
Yu Watanabe [Thu, 11 Apr 2024 01:16:39 +0000 (10:16 +0900)] 
network/ndisc: introduce ndisc_request_router_route()

Then, make ndisc_request_route() generic and usable for configuring
routes based on both Router Advertisement and Redirect messages.

Note, ndisc_request_router() never set lifetime, so the dropped comment
in ndisc_request_redirect_route() is wrong.

No functional change, just refactoring.

18 months agonetwork/ndisc: do not set per-route MTU and hop limit
Yu Watanabe [Thu, 11 Apr 2024 03:05:07 +0000 (12:05 +0900)] 
network/ndisc: do not set per-route MTU and hop limit

Setting MTU announced in RA message to routes is problematic, as the
value may be larger than the device MTU (IFLA_MTU), and in such case the
route cannot be used.

These two properties are now set per-interface, and gracefully handled
such invalid cases. Hence not necessary to set them to each route.

Follow-up for #32195.

18 months agojournal-remote: fix two minor memory leaks
Antonio Alvarez Feijoo [Thu, 11 Apr 2024 15:20:02 +0000 (17:20 +0200)] 
journal-remote: fix two minor memory leaks

18 months agoMerge pull request #32228 from mrc0mmand/more-test-tweaks
Frantisek Sumsal [Thu, 11 Apr 2024 18:35:27 +0000 (20:35 +0200)] 
Merge pull request #32228 from mrc0mmand/more-test-tweaks

A couple of follow-ups for #32189

18 months agotest: make sd-journal-gatewayd tests even more debug-able 32228/head
Frantisek Sumsal [Thu, 11 Apr 2024 12:24:42 +0000 (14:24 +0200)] 
test: make sd-journal-gatewayd tests even more debug-able

Unfortunately bfd30e8af6 is not enough and the test fails, that still
occasionally occur, don't provide enough information to see what's
wrong. Let's rework the test a little to improve this, namely:

  - redirect curl's output into a temporary file instead of piping it
    directly into the "check" expression; that way we can simply dump
    the temporary file when the test fails, providing potentially
    crucial information. We don't want to always dump everything to
    stdout, as some of the tests request an entire system journal (note
    that shell redirection instead of `curl -o file` is used
    intentionally, so the output file is always nuked first)
  - by dropping the pipes in curl commands we can re-enable pipefail
  - also, split some very long commands to multiple lines to (slightly)
    improve readability

Follow-up for bfd30e8af64a0d39ad110258dca69be919f6df34.

18 months agoMerge pull request #32215 from yuwata/network-ndisc-address-lifetime
Luca Boccassi [Thu, 11 Apr 2024 11:16:31 +0000 (12:16 +0100)] 
Merge pull request #32215 from yuwata/network-ndisc-address-lifetime

network/ndisc: fix assignment of valid lifetime

18 months agocreds: allow null when decrypting
Ludwig Nussel [Thu, 4 Apr 2024 15:05:18 +0000 (17:05 +0200)] 
creds: allow null when decrypting

pcrlock writes a credential file using null key. Make sure systemd-creds
can show the file

18 months agoMerge pull request #32216 from DaanDeMeyer/fix
Daan De Meyer [Thu, 11 Apr 2024 11:01:46 +0000 (13:01 +0200)] 
Merge pull request #32216 from DaanDeMeyer/fix

journal-remote: Use sd_event_set_signal_exit()

18 months agoREADME.md: link bug bounty program
Luca Boccassi [Thu, 11 Apr 2024 10:02:18 +0000 (11:02 +0100)] 
README.md: link bug bounty program

18 months agobuild(deps): bump pkg/fedora from `2822a03` to `3f8c38e`
dependabot[bot] [Thu, 11 Apr 2024 09:57:37 +0000 (09:57 +0000)] 
build(deps): bump pkg/fedora from `2822a03` to `3f8c38e`

Bumps pkg/fedora from `2822a03` to `3f8c38e`.

---
updated-dependencies:
- dependency-name: pkg/fedora
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
18 months agotest: make the output of TEST-69 less painful to read
Frantisek Sumsal [Thu, 11 Apr 2024 09:35:17 +0000 (11:35 +0200)] 
test: make the output of TEST-69 less painful to read

The logs from TEST-69 still contain a lot of unnecessary shell
metacharacters, so to make the output more readable let's just set
TERM=dumb, instead of having to strip everything semi-manually. Also,
move the related --background= tweak to TEST-69, since it's relevant
only for that particular test.

Follow-up for 8d4bfd38ed941aa8003d7007145eccc01f52a5f6.

18 months agojournal-remote: Use "event" instead of "events" 32216/head
Daan De Meyer [Thu, 11 Apr 2024 07:58:58 +0000 (09:58 +0200)] 
journal-remote: Use "event" instead of "events"

We use singular "event" everywhere else, so let's use it here as well.

18 months agojournal-remote: Use sd_event_set_signal_exit()
Daan De Meyer [Thu, 11 Apr 2024 07:51:23 +0000 (09:51 +0200)] 
journal-remote: Use sd_event_set_signal_exit()

This also fixes bugs in the previous code where we pass the server
object as userdata to sd_event_add_signal which means that sd-event
tries to use the value of the server pointer as its exit code when
a signal is triggered.

18 months agotest: PROJECT_FILE macro cannot be used in generated code
Yu Watanabe [Thu, 11 Apr 2024 02:27:18 +0000 (11:27 +0900)] 
test: PROJECT_FILE macro cannot be used in generated code

If the build directory is outside of the source tree, ASSERT_XYZ()
triggers the following warning:
===
[20/569] Compiling C object test-hashmap.p/meson-generated_.._src_test_test-hashmap-ordered.c.o
In file included from ../../home/watanabe/git/systemd/src/basic/macro.h:399,
                 from ../../home/watanabe/git/systemd/src/basic/alloc-util.h:10,
                 from src/test/test-hashmap-ordered.c:5:
src/test/test-hashmap-ordered.c: In function ‘test_ordered_hashmap_get’:
../../home/watanabe/git/systemd/src/basic/log.h:216:27: warning: offset ‘32’ outside bounds of constant string [-Warray-bounds=]
  216 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../home/watanabe/git/systemd/src/basic/log.h:238:24: note: in expansion of macro ‘log_full_errno_zerook’
  238 |                 (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
      |                        ^~~~~~~~~~~~~~~~~~~~~
../../home/watanabe/git/systemd/src/basic/log.h:248:28: note: in expansion of macro ‘log_full’
  248 | #define log_error(...)     log_full(LOG_ERR,     __VA_ARGS__)
      |                            ^~~~~~~~
../../home/watanabe/git/systemd/src/shared/tests.h:251:25: note: in expansion of macro ‘log_error’
  251 |                         log_error("%s:%i: Assertion failed: expected \"%s\" to be NULL, but \"%p\" != NULL",    \
      |                         ^~~~~~~~~
src/test/test-hashmap-ordered.c:614:9: note: in expansion of macro ‘ASSERT_NULL’
  614 |         ASSERT_NULL(r);
      |         ^~~~~~~~~~~
===

18 months agoMerge pull request #32210 from YHNdnzj/execcommand-done
Daan De Meyer [Thu, 11 Apr 2024 07:26:37 +0000 (09:26 +0200)] 
Merge pull request #32210 from YHNdnzj/execcommand-done

core: modernize ExecCommand parsing and fix one memory leak

18 months agonetwork/ndisc: fix updating valid lifetime of configured address 32215/head
Yu Watanabe [Thu, 11 Apr 2024 05:02:21 +0000 (14:02 +0900)] 
network/ndisc: fix updating valid lifetime of configured address

This makes the logic mostly follows RFC 4862 section 5.5.3 (e),
as draft-ietf-6man-slaac-renum-07 is deprecated.

Fixes #31449.

18 months agonetwork/ndisc: set provider address in caller
Yu Watanabe [Thu, 11 Apr 2024 03:00:52 +0000 (12:00 +0900)] 
network/ndisc: set provider address in caller

Follow-up for 43d184682d640e438ad140b0743e2fd258455b12.

No functional change, just refactoring.

18 months agoMerge pull request #32202 from DaanDeMeyer/assert
Yu Watanabe [Thu, 11 Apr 2024 00:51:49 +0000 (09:51 +0900)] 
Merge pull request #32202 from DaanDeMeyer/assert

tests: Improve assertion error messages

18 months agoMerge pull request #32181 from YHNdnzj/open-file
Luca Boccassi [Wed, 10 Apr 2024 22:15:56 +0000 (23:15 +0100)] 
Merge pull request #32181 from YHNdnzj/open-file

Some fixes/improvements for OpenFile=

18 months agoMerge pull request #32195 from yuwata/network-ndisc-mtu
Luca Boccassi [Wed, 10 Apr 2024 22:12:21 +0000 (23:12 +0100)] 
Merge pull request #32195 from yuwata/network-ndisc-mtu

network: several cleanups for IPv6 MTU

18 months agoMerge pull request #32166 from yuwata/network-rfc7217-dad
Luca Boccassi [Wed, 10 Apr 2024 21:59:01 +0000 (22:59 +0100)] 
Merge pull request #32166 from yuwata/network-rfc7217-dad

network: generate another address on conflict

18 months agolibsystemd-network: do not trigger assertion by sd_*_is_running() with NULL
Yu Watanabe [Tue, 9 Apr 2024 19:03:46 +0000 (04:03 +0900)] 
libsystemd-network: do not trigger assertion by sd_*_is_running() with NULL

If systemd is built with developer mode, previously they trigger
hard assertions. Even built with release mode, we should not log about
that. Let's silently accept NULL and return false.

Prompted by https://github.com/systemd/systemd/pull/32166#issuecomment-2044710151.

18 months agoMerge pull request #32204 from DaanDeMeyer/post-rewrite
Luca Boccassi [Wed, 10 Apr 2024 21:52:45 +0000 (22:52 +0100)] 
Merge pull request #32204 from DaanDeMeyer/post-rewrite

git: Add post-rewrite hook that invokes git submodule update

18 months agoMerge pull request #32205 from YHNdnzj/bless-boot
Luca Boccassi [Wed, 10 Apr 2024 21:52:11 +0000 (22:52 +0100)] 
Merge pull request #32205 from YHNdnzj/bless-boot

Minor cleanup for bless-boot

18 months agocore/dbus-execute: fix potential memory leak 32210/head
Mike Yuan [Wed, 10 Apr 2024 19:57:34 +0000 (03:57 +0800)] 
core/dbus-execute: fix potential memory leak

18 months agocore/execute: introduce exec_command_free
Mike Yuan [Wed, 10 Apr 2024 20:10:36 +0000 (04:10 +0800)] 
core/execute: introduce exec_command_free

18 months agocore/dbus-execute: modernize a bit
Mike Yuan [Wed, 10 Apr 2024 19:56:48 +0000 (03:56 +0800)] 
core/dbus-execute: modernize a bit

18 months agocore/load-fragment: modernize config_parse_exec
Mike Yuan [Wed, 10 Apr 2024 19:21:41 +0000 (03:21 +0800)] 
core/load-fragment: modernize config_parse_exec

18 months agodocs: Add Tests section to coding style doc 32202/head
Daan De Meyer [Wed, 10 Apr 2024 11:40:16 +0000 (13:40 +0200)] 
docs: Add Tests section to coding style doc

18 months agoIntroduce ASSERT_OK_ERRNO()
Daan De Meyer [Wed, 10 Apr 2024 11:31:58 +0000 (13:31 +0200)] 
Introduce ASSERT_OK_ERRNO()

ASSERT_OK() is for functions that return negative errno. Let's
introduce ASSERT_OK_ERRNO() for syscalls that return -1 and store
the error in errno.

18 months agotests: Improve assertion error messages
Daan De Meyer [Wed, 10 Apr 2024 11:23:53 +0000 (13:23 +0200)] 
tests: Improve assertion error messages

18 months agounits/systemd-boot-check-no-failures.service: drop unneeded dep on shutdown.target 32205/head
Mike Yuan [Wed, 10 Apr 2024 15:02:01 +0000 (23:02 +0800)] 
units/systemd-boot-check-no-failures.service: drop unneeded dep on shutdown.target

18 months agobless-boot-generator: use generator_add_symlink
Mike Yuan [Wed, 10 Apr 2024 14:51:31 +0000 (22:51 +0800)] 
bless-boot-generator: use generator_add_symlink

18 months agocore: use FOREACH_ARRAY at 3 more places
Mike Yuan [Wed, 10 Apr 2024 15:01:47 +0000 (23:01 +0800)] 
core: use FOREACH_ARRAY at 3 more places

18 months agoASSERT_NULL/ASSERT_NOT_NULL
Ivan Kruglov [Mon, 8 Apr 2024 15:12:48 +0000 (17:12 +0200)] 
ASSERT_NULL/ASSERT_NOT_NULL

18 months agoMerge pull request #32201 from aafeijoo-suse/test-minor-fixes
Frantisek Sumsal [Wed, 10 Apr 2024 14:54:37 +0000 (16:54 +0200)] 
Merge pull request #32201 from aafeijoo-suse/test-minor-fixes

test: minor fixes

18 months agotest: merge TEST-77-OPENFILE into TEST-23-UNIT-FILE 32181/head
Mike Yuan [Wed, 10 Apr 2024 11:04:50 +0000 (19:04 +0800)] 
test: merge TEST-77-OPENFILE into TEST-23-UNIT-FILE

And add coverage for #32179

18 months agogit: Add post-rewrite hook that invokes git submodule update 32204/head
Daan De Meyer [Wed, 10 Apr 2024 12:35:20 +0000 (14:35 +0200)] 
git: Add post-rewrite hook that invokes git submodule update

git rebase does not support a --recurse-submodules switch to automatically
check out the submodules at their registered commits during or after a rebase.

Instead, let's use the post-rewrite git hook to do this ourselves.

18 months agoUpdate submodules
Daan De Meyer [Wed, 10 Apr 2024 12:36:59 +0000 (14:36 +0200)] 
Update submodules

18 months agoshared/open-file: use xescape to escape ':'
Mike Yuan [Tue, 9 Apr 2024 13:54:30 +0000 (21:54 +0800)] 
shared/open-file: use xescape to escape ':'

Fixes #32179

18 months agoshared/open-file: make open_file_free_many static inline
Mike Yuan [Wed, 10 Apr 2024 11:18:19 +0000 (19:18 +0800)] 
shared/open-file: make open_file_free_many static inline

18 months agocore/exec-invoke: modernize get_open_file_fd a bit
Mike Yuan [Tue, 9 Apr 2024 13:48:01 +0000 (21:48 +0800)] 
core/exec-invoke: modernize get_open_file_fd a bit

18 months agocore/exec-invoke: modernize connect_unix_harder
Mike Yuan [Tue, 9 Apr 2024 13:38:16 +0000 (21:38 +0800)] 
core/exec-invoke: modernize connect_unix_harder

18 months agoman/journald: Add missing configuration files
Pablo Méndez Hernández [Wed, 10 Apr 2024 08:55:53 +0000 (10:55 +0200)] 
man/journald: Add missing configuration files

The man page was missing:

-  `/run/systemd/journald.conf`
-  `/usr/lib/systemd/journald.conf`

as valid configuration files.

Fixes: https://github.com/systemd/systemd/issues/32199
18 months agotools/check-version-history: skip test if lxml is not installed 32201/head
Antonio Alvarez Feijoo [Wed, 10 Apr 2024 09:08:25 +0000 (11:08 +0200)] 
tools/check-version-history: skip test if lxml is not installed

```
================================= 1070/1408 ==================================
test:         systemd:dist / check-version-history
start time:   07:55:05
duration:     0.03s
result:       exit status 1
...
----------------------------------- stderr -----------------------------------
Traceback (most recent call last):
  File "/mnt/work/systemd/upstream-fork/main/tools/check-version-history.py", line 6, in <module>
    import lxml.etree as tree
ModuleNotFoundError: No module named 'lxml'
==============================================================================
```

Follow-up for 3691e7fce70149ed19edc5d3003e2d7c936c147a

18 months agotest: add missing header to test.h
Antonio Alvarez Feijoo [Wed, 10 Apr 2024 09:07:32 +0000 (11:07 +0200)] 
test: add missing header to test.h

```
../src/shared/tests.h:361:28: error: implicit declaration of function ‘fork’ [-Werror=implicit-function-declaration]
  361 |                 int _pid = fork();                                                                              \
      |                            ^~~~
../src/test/test-macro.c:1114:9: note: in expansion of macro ‘ASSERT_SIGNAL’
 1114 |         ASSERT_SIGNAL(ASSERT_OK(-1), SIGABRT);
      |         ^~~~~~~~~~~~~
../src/shared/tests.h:369:25: error: implicit declaration of function ‘_exit’ [-Werror=implicit-function-declaration]
  369 |                         _exit(EXIT_SUCCESS);                                                                    \
      |                         ^~~~~
../src/test/test-macro.c:1114:9: note: in expansion of macro ‘ASSERT_SIGNAL’
 1114 |         ASSERT_SIGNAL(ASSERT_OK(-1), SIGABRT);
      |         ^~~~~~~~~~~~~
../src/shared/tests.h:369:25: warning: incompatible implicit declaration of built-in function ‘_exit’ [-Wbuiltin-declaration-mismatch]
  369 |                         _exit(EXIT_SUCCESS);                                                                    \
      |                         ^~~~~
../src/test/test-macro.c:1114:9: note: in expansion of macro ‘ASSERT_SIGNAL’
 1114 |         ASSERT_SIGNAL(ASSERT_OK(-1), SIGABRT);
      |         ^~~~~~~~~~~~~
../src/shared/tests.h:369:25: warning: incompatible implicit declaration of built-in function ‘_exit’ [-Wbuiltin-declaration-mismatch]
  369 |                         _exit(EXIT_SUCCESS);                                                                    \
      |                         ^~~~~
../src/test/test-macro.c:1115:9: note: in expansion of macro ‘ASSERT_SIGNAL’
 1115 |         ASSERT_SIGNAL(ASSERT_OK(-ENOANO), SIGABRT);
      |         ^~~~~~~~~~~~~
../src/test/test-macro.c:1119:21: error: implicit declaration of function ‘getpid’; did you mean ‘getpt’? [-Werror=implicit-function-declaration]
 1119 |         ASSERT_TRUE(getpid());
      |                     ^~~~~~
```

Follow-up for #32189

18 months agosecure-boot: tighten enrollment logic a bit regarding file sizes
Lennart Poettering [Tue, 9 Apr 2024 10:39:28 +0000 (12:39 +0200)] 
secure-boot: tighten enrollment logic a bit regarding file sizes

It's OK the dbx file is not loaded, but let's explicitly check for that
(i.e. if the buffer is actually non-NULL), rather than the size of the
bufer, since empty files actually do exist.

Or in other words, let's not magically suppress enrollment of empty
files, but let uefi firmware handle these on their own.

Follow-up for: 57ea8012d6f0b9a3622d4a84d93020020a3aca3c

18 months agoboot: re-align table
Lennart Poettering [Tue, 9 Apr 2024 10:39:01 +0000 (12:39 +0200)] 
boot: re-align table

We like our tables aligned.

(Also suppres the final two fields, which are all zeroes anyway, to
declutter a bit)

18 months agoresolved: dns_name_equal() can fail, handle that reasonably
Lennart Poettering [Tue, 9 Apr 2024 15:29:33 +0000 (17:29 +0200)] 
resolved: dns_name_equal() can fail, handle that reasonably

Ignoring errors can be OK sometimes, but we should make this explicit.

18 months agoMerge pull request #32189 from mrc0mmand/test-tweaks
Yu Watanabe [Wed, 10 Apr 2024 07:57:00 +0000 (16:57 +0900)] 
Merge pull request #32189 from mrc0mmand/test-tweaks

Another batch of assorted test tweaks

18 months agoMerge pull request #32191 from yuwata/network-persistent-storage-follow-ups
Yu Watanabe [Wed, 10 Apr 2024 07:54:39 +0000 (16:54 +0900)] 
Merge pull request #32191 from yuwata/network-persistent-storage-follow-ups

network: follow-ups for persistent storage

18 months agondisc: use memzero() where appropriate
Lennart Poettering [Tue, 9 Apr 2024 16:45:56 +0000 (18:45 +0200)] 
ndisc: use memzero() where appropriate

18 months agosd-journal: make sure sd_journal_add_match() also accepts SIZE_MAX as size
Lennart Poettering [Tue, 9 Apr 2024 15:51:54 +0000 (17:51 +0200)] 
sd-journal: make sure sd_journal_add_match() also accepts SIZE_MAX as size

In many of our internal functions that take a pointer + a size we have
introduced the rule that SIZE_MAX as size means: take strlen().

sd_journal_add_match() has something similar, but the special value is
0, not SIZE_MAX. This is a bit ugly, since a zero size data block is
theoretically fine. The only reason sd_journal_add_match() gets away
with using this special value is because valid matches must consist of
at least 2 chars, hence cannot be zero.

But let's make this more robust and less surprising when compared to the
rest of our code, and *also* accept SIZE_MAX to mean strlen().

No actual code changes, just some clean-up.

18 months agocore: Serialize both pid and pidfd
Daan De Meyer [Fri, 5 Apr 2024 13:21:49 +0000 (15:21 +0200)] 
core: Serialize both pid and pidfd

If we try to deserialize only a pidfd that points to a process that
has been reaped, creating the pidref object will fail, which means that
we'll try to create a pidref object from the serialized pid that comes
next. If the pid has already been reused, this will succeed and we'll
now have a pidref that points to a different process.

Let's avoid this issue by serializing both the pidfd and the pid and
creating the pidref object directly from both. This means we'll reuse
the deserialized pidfd instead of opening a new one. We'll then immediately
notice the pidfd is dead and do the appropriate follow up depending on
the unit type.

18 months agotest-network: add test case for ndisc MTU option 32195/head
Yu Watanabe [Wed, 10 Apr 2024 02:14:13 +0000 (11:14 +0900)] 
test-network: add test case for ndisc MTU option

18 months agonetwork/ndisc: set IPv6 MTU through sysctl
Yu Watanabe [Wed, 10 Apr 2024 01:13:07 +0000 (10:13 +0900)] 
network/ndisc: set IPv6 MTU through sysctl

Closes #31496.

18 months agonetwork/sysctl: round IPv6 MTU with the current device MTU rather than the maximum MTU
Yu Watanabe [Wed, 10 Apr 2024 01:07:50 +0000 (10:07 +0900)] 
network/sysctl: round IPv6 MTU with the current device MTU rather than the maximum MTU

Otherwise, writing IPv6 MTU may fail.

This also makes link_set_ipv6_mtu() take log level about rounding IPv6 MTU,
and downgrade the log level from LOG_WARNING -> LOG_INFO, as we usually
use LOG_WARNING for per-interface critical failure.

18 months agonetwork: always set IPv6 MTU when we detect the device MTU is changed
Yu Watanabe [Wed, 10 Apr 2024 02:47:09 +0000 (11:47 +0900)] 
network: always set IPv6 MTU when we detect the device MTU is changed

Then, we can keep the IPv6 MTU even if the device MTU is changed by an
external tool, e.g. 'ip link set' command.

18 months agonetwork/setlink: adjust requested MTU when it is ready to set
Yu Watanabe [Wed, 10 Apr 2024 02:35:21 +0000 (11:35 +0900)] 
network/setlink: adjust requested MTU when it is ready to set

This should not change any effective behavior.
Just for safety, and making the logic consistent with others, e.g.
setting master ifindex.

18 months agopo: update Japanese translation
Yu Watanabe [Tue, 9 Apr 2024 22:07:34 +0000 (07:07 +0900)] 
po: update Japanese translation

18 months agonetwork/varlink: fix error cause 32191/head
Yu Watanabe [Tue, 9 Apr 2024 19:55:59 +0000 (04:55 +0900)] 
network/varlink: fix error cause

Follow-up for e1254d0616f812d22753421bd791c4486c0a9128.

Addresses https://github.com/systemd/systemd/pull/31811#discussion_r1557552244.

18 months agonetwork: open persistent directory without O_PATH
Yu Watanabe [Tue, 9 Apr 2024 19:51:27 +0000 (04:51 +0900)] 
network: open persistent directory without O_PATH

Addresses https://github.com/systemd/systemd/pull/31811#discussion_r1557549629.

18 months agotest: wait until the test container is fully booted up 32189/head
Frantisek Sumsal [Tue, 9 Apr 2024 19:16:41 +0000 (21:16 +0200)] 
test: wait until the test container is fully booted up

TEST-69 still occasionally times out in CI and appears to be stuck on
boot, so let's see if this helps the situation a bit.

18 months agotest: disable background color for nspawn containers
Frantisek Sumsal [Tue, 9 Apr 2024 19:11:26 +0000 (21:11 +0200)] 
test: disable background color for nspawn containers

As it makes the logs really messy in certain tests.

18 months agotest: set pexpect's logfile early
Frantisek Sumsal [Tue, 9 Apr 2024 18:55:48 +0000 (20:55 +0200)] 
test: set pexpect's logfile early

So we capture the container's boot as well.