Subject: Re: lib/30664: realpath and magic symlinks
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Hisashi T Fujinaka <htodd@twofifty.com>
List: netbsd-bugs
Date: 07/08/2005 16:24:02
The following reply was made to PR lib/30664; it has been noted by GNATS.

From: Hisashi T Fujinaka <htodd@twofifty.com>
To: Jason Thorpe <thorpej@shagadelic.org>
Cc: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>,
	netbsd-bugs@NetBSD.org, gnats-bugs@NetBSD.org,
	NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.org>
Subject: Re: lib/30664: realpath and magic symlinks
Date: Fri, 8 Jul 2005 09:23:06 -0700 (PDT)

 On Fri, 8 Jul 2005, Jason Thorpe wrote:
 
 >
 > On Jul 4, 2005, at 4:26 PM, yamt@mwd.biglobe.ne.jp wrote:
 >
 >>> Description:
 >>> 
 >>     realpath(3) (or, more generally, userland code which resolves
 >>     symlinks by itsself using readlink(2)) doesn't handle
 >>     magic symlinks and can cause problems.
 >>     it's subtle because it isn't obvious which of userland or kernel
 >>     resolves a symlink for a given application.
 >
 > Perhaps readlink(2) should translate the magic symlink?  But that would break 
 > ls(1).  Perhaps we could add a readlink2(2) that takes a flags argument, 
 > allowing us to specify "raw" or "translated".  readlink(2) would default to 
 > "translated", and ls(1) would be changed to use "raw".
 
 Could this be my problem with toolchain/30682?
 
 -- 
 Hisashi T Fujinaka - htodd@twofifty.com
 BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte