NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/47333: stat -L undocumented behavior



The following reply was made to PR bin/47333; it has been noted by GNATS.

From: Tobias Ulmer <tobiasu%tmux.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/47333: stat -L undocumented behavior
Date: Sat, 15 Dec 2012 21:56:37 +0100

 On Sat, Dec 15, 2012 at 08:05:02PM +0000, David Holland wrote:
 > The following reply was made to PR bin/47333; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-bugs%netbsd.org@localhost>
 > To: gnats-bugs%NetBSD.org@localhost
 > Cc: 
 > Subject: Re: bin/47333: stat -L undocumented behavior
 > Date: Sat, 15 Dec 2012 20:02:35 +0000
 > 
 >  On Sat, Dec 15, 2012 at 04:30:13PM +0000, David Laight wrote:
 >   >  On Sat, Dec 15, 2012 at 03:25:01PM +0000, tobiasu%tmux.org@localhost 
 > wrote:
 >   >  > >Number:         47333
 >   >  > >Category:       bin
 >   >  > >Synopsis:       stat -L undocumented behavior
 >   >  ...
 >   >  > "stat -L" claims to "Use stat(2) instead of lstat(2).
 >   >  > The information reported by stat will refer to the target of file,
 >   >  > if file is a symbolic link, and not to file itself."
 >   >  > 
 >   >  > This is fine, and could for example be used to detect broken symlinks.
 >   >  > Except it's not what it does. In case of a broken symlink it will fall
 >   >  > back to lstat(2) and return the symlink info.
 >   >  
 >   >  So you can detect that by noticing that the output of 'stat -L' is
 >   >  still a symlink.
 >   >  
 >   >  The man page needs fixing.
 >  
 >  Please check the standards (since this is where this program came
 >  from, it isn't either native or historical) before proposing things
 >  like this.
 
 After a bit more digging, it turns out that the original stat was
 devised by Michael Meskes. It was later integrated into coreutils.
 
 See here for history:
 http://fossies.org/linux/misc/stat-3.3.tar.gz:a/stat-3.3/README
 
 >  
 >  -- 
 >  David A. Holland
 >  dholland%netbsd.org@localhost
 >  
 


Home | Main Index | Thread Index | Old Index