Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: perldb.ini permission problem on Windows 11

by syphilis (Archbishop)
on Sep 20, 2022 at 01:41 UTC ( #11147001=note: print w/replies, xml ) Need Help??

in reply to Re: perldb.ini permission problem on Windows 11
in thread perldb.ini permission problem on Windows 11

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 since perl-5.8.8 (maybe even earlier), and its behaviour has remained the same throughout that period.
I know buggerall about 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


Replies are listed 'Best First'.
Re^3: perldb.ini permission problem on Windows 11
by PUCKERING (Sexton) on Sep 20, 2022 at 04:08 UTC
    Thanks Rob.

    Your comments jogged my memory. I used to use ActiveState perl. The reason I was fiddling with perldb.ini is that my .perldb file wasn't working. After some experimentation, I realized it wasn't even being read. When I renamed it to perldb.ini it began being read, but with this error message we've been discussing.

    But at some point in the past it did work and without that message. That's why it was in my home directory. And so it was probably back when I was using ActiveState perl. My guess is they may have fixed this problem in their code, but that fix never made it into Strawberry perl.

    If I find the time I might test that hypothesis by having a peek at the ActiveState code. And I will definitely post an issue per your suggestion.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11147001]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2022-11-26 18:20 GMT
Find Nodes?
    Voting Booth?