Russ Allbery <r...@debian.org> writes:

> The wording of section 10.5, where it says whether symlinks should be
> absolute or relative, is not particularly clear if the symlink is to a
> top-level file or directory rather than into one (such as a link from
> /var/run to /run).  The intent was to require that these be absolute
> links so that, were /var a symlink to some other location, the /var/run
> symlink would still work properly.

> The rationale should be mentioned in a non-normative footnote.

I've applied the following informative change to make this clearer.  (Yes,
Policy allows top-level directories to be symlinks but not substantial
second-level directories like /usr/share, but that's a different
discussion.)

diff --git a/policy.sgml b/policy.sgml
index 4aeae36..bfb7cf5 100644
--- a/policy.sgml
+++ b/policy.sgml
@@ -7917,11 +7917,23 @@ fname () {
        <heading>Symbolic links</heading>
 
        <p>
-         In general, symbolic links within a top-level directory
-         should be relative, and symbolic links pointing from one
-         top-level directory into another should be absolute. (A
-         top-level directory is a sub-directory of the root
-         directory <file>/</file>.)
+         In general, symbolic links within a top-level directory should
+         be relative, and symbolic links pointing from one top-level
+         directory to or into another should be absolute. (A top-level
+         directory is a sub-directory of the root
+         directory <file>/</file>.)  For example, a symbolic link
+         from <file>/usr/lib/foo</file> to <file>/usr/share/bar</file>
+         should be relative (<file>../share/bar</file>), but a symbolic
+         link from <file>/var/run</file> to <file>/run</file> should be
+         absolute.<footnote>
+           This is necessary to allow top-level directories to be
+           symlinks.  If linking <file>/var/run</file>
+           to <file>/run</file> were done with the relative symbolic
+           link <file>../run</file>, but <file>/var</file> were a
+           symbolic link to <file>/srv/disk1</file>, the symbolic link
+           would point to <file>/srv/run</file> rather than the intended
+           target.
+         </footnote>
        </p>
 
        <p>

-- 
Russ Allbery (r...@debian.org)               <http://www.eyrie.org/~eagle/>



-- 
To UNSUBSCRIBE, email to debian-policy-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/8739c86033....@windlord.stanford.edu

Reply via email to