Subject: Re: lib/30664: realpath and magic symlinks
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 07/09/2005 15:17:04
The following reply was made to PR lib/30664; it has been noted by GNATS.

From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
To: christos@zoulas.com
Cc: gnats-bugs@netbsd.org, lib-bug-people@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, tech-kern@netbsd.org
Subject: Re: lib/30664: realpath and magic symlinks
Date: Sun, 10 Jul 2005 00:16:02 +0900

 > | > 2. Create sysctl to turn on/off readlink() return behavior. This sysctl
 > | >    "proc.pid.magiclinks" (or something) defaults to 0, and is inherited
 > | >    across fork and exec. If proc.pid.magiclinks==0, readlink returns the
 > | >    translated path; if ==1 then it returns the raw path.
 > | 
 > | who is expected to toggle this sysctl?
 > | users, or applications?
 > 
 > Users. The point is not to make the whole tinh visible to applications.
 
 i don't think it's reasonable to expect users to know
 how each applications resolve links (by readlink or not).
 it's the reason i filed this PR.
 
 besides, it likely depends on application, not user, which behaviour is
 expected.  eg. backup tools likely always want to see raw contents.
 
 > | > 3. In the long term, move the whole mess to namei(), deprecate magiclinks.
 > | >    and rename the magiclinks mount option magicnames.
 > | 
 > | i guess magicnames have its own weirdness...
 > | foreign filesystem/tarballs, remote files, etc.
 > | good luck. :-)
 > 
 > Why? The pathnames have @var's but they are otherwise valid.
 
 eg. if you have a file named "@var", you will see weird ENOENT on "ls -l".
 
 YAMAMOTO Takashi