Bug#922674: debian-policy: make symlink requirements consistent
Package: debian-policy
Version: 4.3.0.2
Severity: normal
Policy 10.5 (Symbolic links) currently has two classes of requirements:
Symlinks between /${x} and /${x} (same top-level directory) must use
relative links; symlinks between /${x} and /${y} (different top-level
directories).
The historic reasons[1][2] point out this is to allow /usr (or other
top-level directories) to be a symlink to somewhere else which would
break symlinks using '..' in their target.
It seems strange to treat top-level directories differently: why
should /usr be allowed to be a symlink, but /usr/local, /usr/lib or
/usr/share/doc not? I can't come up with a better idea than that
top-level directories are something like "driver letters".
So I suggest to either:
(a) require *all* symlinks to be relative
(b) forbid using '..' in symlinks
(a) would imply that users would have to use bind-mounts instead of
symlinks; (b) would allow any directory to be a symlink, but require
tools acting on chroots to be aware of symlinks (but they have to be
that already as we sometimes require absolute symlinks already).
Ansgar
[1] https://lists.debian.org/debian-policy/1998/04/msg00110.html
[2] https://lists.debian.org/debian-policy/1998/03/msg00050.html
Reply to: