Closed p5pRT closed 19 years ago
Cwd::abs_path from Cwd 3.01 returns undef even for valid readable paths when . is not readable.
Steps to reproduce:
1) as root\, make a test-directory readable for root only. 2) cd to that dir 3) run the following test-script with 'su user -c script'
---------------------------------------------------------- use strict; use warnings;
use Cwd qw/ &abs_path /;
print $Cwd::VERSION\,"\n";
my $some_dir = abs_path('/var/spool');
print "$some_dir\n"; ----------------------------------------------------------
The result I get is:
# mkdir /tmp/foo # cd /tmp/foo # chmod og-r . # ls -ld . drwx--x--x 2 root bin 96 nov 11 10:44 ./ # ~chrekh/tmp/test.pl 3.01 /var/spool # su chrekh -c ~chrekh/tmp/test.pl 3.01 Use of uninitialized value in concatenation (.) or string at /home/u30003/chrekh/tmp/test.pl line 12.
[chrekh.rsv - Thu Nov 11 02:02:35 2004]:
This is a bug report for perl from chrekh@rsv.se\, generated with the help of perlbug 1.35 running under perl v5.8.5.
----------------------------------------------------------------- [Please enter your report here]
Cwd::abs_path from Cwd 3.01 returns undef even for valid readable paths when . is not readable.
Steps to reproduce:
1) as root\, make a test-directory readable for root only. 2) cd to that dir 3) run the following test-script with 'su user -c script'
---------------------------------------------------------- use strict; use warnings;
use Cwd qw/ &abs_path /;
print $Cwd::VERSION\,"\n";
my $some_dir = abs_path('/var/spool');
print "$some_dir\n"; ----------------------------------------------------------
The result I get is:
# mkdir /tmp/foo # cd /tmp/foo # chmod og-r . # ls -ld . drwx--x--x 2 root bin 96 nov 11 10:44 ./ # ~chrekh/tmp/test.pl 3.01 /var/spool # su chrekh -c ~chrekh/tmp/test.pl 3.01 Use of uninitialized value in concatenation (.) or string at /home/u30003/chrekh/tmp/test.pl line 12.
I am able to replicate this bug with Cwd 3.11.
root@kirk:/tmp/foo # su steve -c perl ../foo.pl 3.11 Use of uninitialized value in concatenation (.) or string at ../foo.pl line 10.
The RT System itself - Status changed from 'new' to 'open'
@rgs - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#32406 (status was 'resolved')
Searchable as RT32406$