netbsd-bugs@netbsd.org
[Top] [All Lists]

Re: lib/30664: realpath and magic symlinks

Subject: Re: lib/30664: realpath and magic symlinks
From: Jason Thorpe
Date: Fri, 8 Jul 2005 16:03:03 +0000 UTC
The following reply was made to PR lib/30664; it has been noted by GNATS.

From: Jason Thorpe <thorpej@xxxxxxxxxxxxxx>
To: YAMAMOTO Takashi <yamt@xxxxxxxxxxxxxxxxx>
Cc: netbsd-bugs@xxxxxxxxxx, gnats-bugs@xxxxxxxxxx,
        NetBSD Kernel Technical Discussion List <tech-kern@xxxxxxxxxx>
Subject: Re: lib/30664: realpath and magic symlinks
Date: Fri, 8 Jul 2005 09:02:19 -0700

 On Jul 4, 2005, at 4:26 PM, yamt@xxxxxxxxxxxxxxxxx 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".
 
 Thoughts?
 
 
 -- thorpej
 

<Prev in Thread] Current Thread [Next in Thread>