develooper Front page | perl.perl5.porters | Postings from December 2008

Re: [perl #61362] bug report: "perl -c foo" always reports "foosyntax OK" if foo is a directory

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
December 15, 2008 07:11
Subject:
Re: [perl #61362] bug report: "perl -c foo" always reports "foosyntax OK" if foo is a directory
Message ID:
20081215151058.GE23737@iabyn.com
On Sun, Dec 14, 2008 at 09:28:39PM -0500, Eric Brine wrote:
> FYI, it could be one of ActivePerl's patches, but Windows actually gets it
> right. Tested with both 5.8.8 and 5.10.0. (perl -v below)
> 
> >perl -c foo
> Can't open perl script "foo": Permission denied

With bleed on linux, I get silent "success":

$ ./perl -c /tmp
/tmp syntax OK

An strace shows that it is ignoring a read error while trying to
read the directory:

    open("/tmp", O_RDONLY|O_LARGEFILE)      = 3
    ...
    read(3, 0x851973c, 4096)                = -1 EISDIR (Is a directory)
    close(3)                                = 0
    write(2, "/tmp syntax OK\n", 15)        = 15


-- 
My Dad used to say 'always fight fire with fire', which is probably why
he got thrown out of the fire brigade.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About