systemd/test/testsuite-23.units/testsuite-23-joins-namespace-of-5.service
Yu Watanabe a60f96fcf5 core/unit: make JoinsNamespaceOf= implies the inverse dependency
Previously, even if a.service has JoinsNamespaceOf=b.service, the
inverse direction of reference was not introduced.
Hence, a.service is started earlier than b.service, the namespace will
not shared with b.service.
Also, even if a.service had the reference to b.service, b.service did not.
If b.service is freed earlier, then unit_clear_dependencies() does not clear
the reference from a to b, and will cause use-after-free on unit_free() for
a.service.

Let's make JoinsNamespaceOf=b.service in a.service implies the inverse
dependency, i.e. JoinsNamespaceOf=a.service for b.service. Then, we can safely
free b.service.
2023-05-26 11:50:08 +09:00

7 lines
142 B
Desktop File

# SPDX-License-Identifier: LGPL-2.1-or-later
[Service]
Type=oneshot
MountAPIVFS=yes
PrivateTmp=yes
ExecStart=test -e /tmp/shared-private-file