Subject: Re: kern/36227: new emul namei problem with symlinks
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Mark Davies <mark@mcs.vuw.ac.nz>
List: netbsd-bugs
Date: 04/27/2007 22:05:04
The following reply was made to PR kern/36227; it has been noted by GNATS.

From: Mark Davies <mark@mcs.vuw.ac.nz>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/36227: new emul namei problem with symlinks
Date: Sat, 28 Apr 2007 10:00:39 +1200

 On Friday 27 April 2007, David Laight wrote:
 >  So I made it such that absolute symlinks stay inside the emulation
 > root (when found with an absolute pathname) unless the name is
 > "/../foo".
 >
 >  (So you may also want to make /emul/linux/etc/mtab a link to
 > /../proc/mounts)
 
 OK, I'd missed the /.. trick.  That should probably be mentioned in 
 UPDATING or somewhere.
 
 The compat_linux and compat_osf1 manual pages (at least) have the 
 following in their bugs section:
 
      Pathnames pointed to by symbolic links are not looked up in the
      shadow root when running a Linux executable.  This is not
      consistent.
 
 That needs to be updated.
 
 
 Also while playing with this I saw the following which seems odd:
 
   # cd /emul/linux/etc/
   # echo hello > bar
   # echo bye > /etc/bar
   # ln -s /etc/bar foo
   # /emul/linux/bin/cat /etc/foo
   hello
   # /emul/linux/bin/cat foo
   bye
 
 
 cheers
 mark