summaryrefslogtreecommitdiff
path: root/lib/File/stat.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/File/stat.pm')
-rw-r--r--lib/File/stat.pm4
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];