diff options
author | Todd Rinaldo <toddr@cpan.org> | 2010-11-11 17:08:34 -0600 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-11 18:08:46 -0800 |
commit | 3c1f5943e7d7227d005f4786558b7871b89e7a50 (patch) | |
tree | 8f84e6cc228a81c2cd5f2fd1cb9c63f9e0e80896 /lib/File/stat.pm | |
parent | 46787c0e32a676e3fcb60d752d4858316dc1ef77 (diff) | |
download | perl-3c1f5943e7d7227d005f4786558b7871b89e7a50.tar.gz |
RT 79076: fix File::stat overload tests -x and -X when uid is root
Diffstat (limited to 'lib/File/stat.pm')
-rw-r--r-- | lib/File/stat.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/File/stat.pm b/lib/File/stat.pm index a783e08cac..d4030334d8 100644 --- a/lib/File/stat.pm +++ b/lib/File/stat.pm @@ -84,7 +84,9 @@ else { my ($s, $mode, $eff) = @_; my $uid = $eff ? $> : $<; - $^O ne "VMS" and $uid == 0 and return 1; + # If we're root on unix and we are not testing for exectable + # status, then all file tests are true. + $^O ne "VMS" and $uid == 0 and !($mode & 0111) and return 1; my ($stmode, $stuid, $stgid) = @$s[2,4,5]; |