Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/policy-guide:master commit in: /
Date: Sun, 19 Jan 2020 20:10:43
Message-Id: 1579464593.acb2659d5d3c67579105d0b297dfda4bc92edf47.mgorny@gentoo
1 commit: acb2659d5d3c67579105d0b297dfda4bc92edf47
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 19 12:39:34 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 19 20:09:53 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/policy-guide.git/commit/?id=acb2659d
7
8 filesystem: Policy against absolute symlink targets
9
10 Closes: https://bugs.gentoo.org/705830
11 Closes: https://github.com/gentoo/policy-guide/pull/5
12 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
13
14 filesystem.rst | 26 ++++++++++++++++++++++++++
15 1 file changed, 26 insertions(+)
16
17 diff --git a/filesystem.rst b/filesystem.rst
18 index 9173042..081ab99 100644
19 --- a/filesystem.rst
20 +++ b/filesystem.rst
21 @@ -154,3 +154,29 @@ inconsistent with the use in other distributions where it was used to
22 share data files. Since the latter implied users must not be added
23 to the games group, a new group (gamestat) needed to be created to
24 fulfill that purpose.
25 +
26 +
27 +.. index:: symbolic link; absolute target
28 +
29 +Absolute symbolic link targets
30 +------------------------------
31 +:Source: QA
32 +:Reported: by repoman and pkgcheck (when ebuild-generated)
33 +
34 +Packages must not install symbolic links with absolute targets.
35 +Instead, relative paths must be used. An exception is granted
36 +for symlinks to specially mounted filesystems (such as /proc, /run)
37 +when symlinks are supposed to always reference the running host system.
38 +
39 +*Example*::
40 +
41 + # BAD:
42 + dosym /usr/lib/frobnicate/frobnicate /usr/bin/frobnicate
43 + # GOOD:
44 + dosym ../lib/frobnicate/frobnicate /usr/bin/frobnicate
45 + # ACCEPTABLE EXCEPTION:
46 + dosym /proc/self/mounts /etc/mtab
47 +
48 +*Rationale*: absolute symlinks work correctly only when the root
49 +filesystem is mounted at /. They point at the wrong location whenever
50 +it is mounted in another location, e.g. for the purposes of recovery.