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

Re: [perl #49003] pp_ftrread appears to use the wrong access mode for -x when using "use filetest 'access';"

Thread Previous
From:
Rafael Garcia-Suarez
Date:
January 6, 2008 08:20
Subject:
Re: [perl #49003] pp_ftrread appears to use the wrong access mode for -x when using "use filetest 'access';"
Message ID:
b77c1dce0801060820s1767b9caxb2ecdcd164ac514f@mail.gmail.com
On 21/12/2007, via RT pravus @ cpan. org <perlbug-followup@perl.org> wrote:
> I have found that the '-x' test will fail even when I do have execute
> access to a file if the filetest 'access' pragma is enabled.  Here is
> a short test case:
>
>   {
>     use filetest qw/ access /;
>     print -x '/bin/cat' ? "YES" : "NO", "\n";
>   }
>
>   print -x '/bin/cat' ? "YES" : "NO", "\n";
>
> The first test fails but the second test succeeds (as expected).  I
> looked at pp_sys.c and it appears as though OP_FTEEXEC is using W_OK
> instead of X_OK.  Below is a small patch:
>
> diff -urP perl-5.10.0-orig/pp_sys.c perl-5.10.0/pp_sys.c
> --- perl-5.10.0-orig/pp_sys.c   2007-12-18 04:47:08.000000000 -0600
> +++ perl-5.10.0/pp_sys.c    2007-12-21 11:32:29.000000000 -0600

Thanks, applied as change #32874.

Thread Previous


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