Filesys::Virtual::Chroot - Virtual File system Tool
Provide a virtual chroot environment. This module only simulates a chroot environment and only provides a advisory functions for your application. This module is NOT intended to provide application security!!!
#!/usr/bin/perl use strict; use Filesys::Virtual::Chroot; my $cr = Filesys::Virtual::Chroot->new( c => '/tmp', i => 0 ) || die $Filesys::Virtual::Chroot::errstr; print " Root: " . $cr->rroot . "\n"; print " Fake: " . $cr->vpwd . "\n"; if($cr->vchdir($ARGV[0])){ print " Change directory success\r\n"; print " Root: " . $cr->rroot . "\n"; print " Real: " . $cr->rcwd . "\n"; print " Fake: " . $cr->vcwd . "\n"; } else { print $cr->errstr . "\n"; } exit;
Create a new Filesys::Virtual::Chroot object.
chroot - The full path of the directory which will be virtual chroot'd
c - Same as chroot
no_force_case - Don't force case matching, Turn this on, on windows machines.
i - Same as no_force_case
If something happens which results in an error, nothing will be returned and the Filesys::Virtual::Chroot::errstr will be set with the error message.
Return the last error message captured.
Return the real full root path of the virtual chroot'd environment.
Return the last real directory that was changed to with $cr->vchdir()
Change the virtual directory and return the virtual directory that was changed to.
Return the real full path of <file> if <file> is within the virtual chroot environment
Return the virtual current working directory
aliase for the vcwd() command.
Return the real current working directory
aliase for the rcwd() command.
To install Filesys::Virtual::Chroot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Filesys::Virtual::Chroot
CPAN shell
perl -MCPAN -e shell install Filesys::Virtual::Chroot
For more information on module installation, please visit the detailed CPAN module installation guide.