September 11 2017 | File::Path Security | Back Next |
Internal subroutine _rmtree() underpins all 3 interfaces
my ( $ldev, $lino, $perm ) = ( lstat $root )[ 0, 1, 2 ] or next ROOT_DIR;
First time through, $root is a cleaned-up file path
But _rmtree() is going to call itself recursively
So next time through, it may be a simple filename
Use lstat rather than stat to account for possibility that $root is symlink
If it's a symlink, we want information about the symlink rather than its target
Home Last TOC | Copyright © 2017 James E Keenan | Back Next |