September 11 2017 File::Path Security Back

When and How Did "Traditional" rmtree() Get Its Superpowers? (continued)

        +    if (not -l $root and -d _) {
        +        # notabene: 0777 is for making readable in the first place,
        +        # it's also intended to change it to writable in case we have
        +        # to recurse in which case we are better than rm -rf for 
        +        # subtrees with strange permissions
        +        chmod 0777, $root
        +          or carp "Can't make directory $root read+writeable: $!"
        +        unless $safe;


Home Last TOC Copyright © 2017 James E Keenan Back Next