Le Tue, Oct 23, 2012 at 03:06:38PM +0200, Martin Mares a écrit :
> 
> When I run `see' on a file, I get `Error: no read permission for file "XXX"',
> although the file is perfectly readable.
> 
> This happens for example when the file in question is located in a directory
> mounted by sshfs. Permissions reported by stat(2) on such files usually follow
> the remote server, which does not necessarily make any sense when interpreted
> locally.
> 
> But this is exactly what `see' does: it stats the filesystem permissions and
> and dies when it guesses that the file looks unreadable. This can fail under
> lots of circumstances: not only sshfs, but also permissions granted by an ACL.
> 
> I recommended removing the check altogether or at least replacing it by
> trying to open the file.

Dear Martin,

I think that you made a good point, and concomittantly, the perl documentation
for the "-X" functions (http://perldoc.perl.org/functions/-X.html) adds:

  "Note that the use of these six specific operators to verify if some
   operation is possible is usually a mistake, because it may be open to race
   conditions."

That would call for replacing the checks by error handlings, unless the "stat"
functions would perform better ?

Do you think you could prepare a patch ?

Have a nice day,

-- 
Charles Plessy
Tsurumi, Kanagawa, Japan


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to