September 11 2017 | File::Path Security | Back Next |
What if I had placed a file in each of those 8 third-level subdirectories?
Try create_subdirs() program with different arguments:
@altered = CreateSubdirs::create_subdirs($tdir, $sdir);
In 7 of 8 cases, rm -rf is unable to cleanly remove the third-level subdirectory and file therein
for my $alt (@altered[0..6]) { my $rv = system(qq|rm -rf $alt|); Test::More::is($rv >> 8, 1, "Unable to rm -rf $alt"); }
Only in case where the user has full read-write-execute permissions (0700) is everything removed:
$rv = system(qq|rm -rf $altered[7]|); Test::More::is($rv >> 8, 0, "Able to rm -rf $altered[7]");
Home Last TOC | Copyright © 2017 James E Keenan | Back Next |