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: David Laight <david%l8s.co.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/47333: stat -L undocumented behavior
Date: Sat, 15 Dec 2012 16:43:47 +0000

 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.
 
        David
 
 -- 
 David Laight: david%l8s.co.uk@localhost
 


Home | Main Index | Thread Index | Old Index