]> git.ipfire.org Git - thirdparty/systemd.git/commit
tmpfiles: check relative L? targets beside the link
authordongshengyuan <545258830@qq.com>
Wed, 15 Jul 2026 05:23:23 +0000 (13:23 +0800)
committerdongshengyuan <545258830@qq.com>
Thu, 23 Jul 2026 08:56:06 +0000 (16:56 +0800)
commit35e9ca257d2fbb545b17fd3dcd89800ba03a0e7d
treedbe43af2878f0979acb6c3f6854c663bb6c24329
parent58496809c0fcfb2364b11b36a76e0d79d4b9dec8
tmpfiles: check relative L? targets beside the link

Relative symlink targets are resolved from the directory containing the
link. Make the L? existence check use the same rule.

Reproducer:
  tmp=$(mktemp -d /tmp/tmpfiles-link.XXXXXX)
  conf=$(mktemp /tmp/tmpfiles-conf.XXXXXX)
  printf data >"$tmp/target"
  printf 'L? %s/link - - - - target\n' "$tmp" >"$conf"
  systemd-tmpfiles --create --dry-run "$conf"

Before:
  The target was checked root-relative, not beside the link.

Follow-up for b5dc805583bbb019c6bf4c73bf0814a396dc0f12.
src/tmpfiles/tmpfiles.c
test/units/TEST-22-TMPFILES.15.sh