sub is_safe_file {
my $path = shift;
stat($path) || return; # mysteriously vaporized
my ( $dev, $ino, $mode, $nlink, $uid, $gid ) = stat(_);
return 0 if $uid != 0 && $uid != $<;
return 0 if $mode & 022;
return 1;
} ## end sub is_safe_file
On Windows 7, I'm seeing the same result as
the OP.
The
is_safe_file() sub returns 0, because
$mode & 022 returns a true value of 18.
But the leading
0100 is ignored, and the true value of 18 is obtained simply because the 2nd and 5th bits of $mode are true.
This sub has been (in its current form) in perl5db.pl since perl-5.8.8 (maybe even earlier), and its behaviour has remained the same throughout that period.
I know buggerall about perl5db.pl and file permissions, but it feels to me that this sub should not even be called on a Windows system.
I did however find a file named simply "config_data" in a perl (not Strawberry Perl) bin folder of mine for which
is_safe_file() returned true.
For that file, the value of
$mode, as seen by
is_safe_file(), was 33206 (0100444).
If you can set the perldb.ini permissions to that value then you might get lucky ;-)
PUCKERING, if you want to raise an issue about this with the perl developers, then create a "New Issue" at
https://github.com/Perl/perl5/issues.
Cheers,
Rob