HEX
Server: Apache/2.4.41 (FreeBSD) OpenSSL/1.0.2s mod_fcgid/2.3.9
System: FreeBSD salazo 12.0-RELEASE-p1303-ZFS hostBSD 12.0-RELEASE-p1303-ZFS DMR amd64
User: admin (1000)
PHP: 7.4.3
Disabled: NONE
Upload Files
File: /usr/local/www/apache24/cgi-bin/easytecc4/get_size_mysql.pl
#!/usr/iports/bin/perl
BEGIN {
	if(-e '/etc/sudoers'){
		
		my $osversion = `/usr/bin/uname -K`;
		chomp $osversion;
		
		my $perl;
		
		if($osversion >= 1300000){
			
			$perl = '5.34';
		
		} elsif($osversion >= 1200000){
			
			$perl = '5.26';
		
		} elsif($osversion >= 1003000){
			
			$perl = '5.24';

		} else {
			
			$perl = '5.20';
			
		}
		
		@INC = (
				"/usr/iports/lib/perl5/site_perl",
				"/usr/iports/lib/perl5/amd64-freebsd-thread-multi",
				"/usr/iports/lib/perl5/$perl",
				"/usr/iports/lib/perl5/$perl/mach",
				"/usr/iports/lib/perl5/site_perl/mach/$perl",
				"/usr/local/lib/perl5/site_perl",
				"/usr/local/lib/perl5/amd64-freebsd-thread-multi",
				"/usr/local/lib/perl5/$perl",
				"/usr/local/lib/perl5/$perl/mach",
				"/usr/local/lib/perl5/site_perl/mach/$perl",
				"/usr/local/www/apache24/cgi-bin/easytecc4"
		);
				
			
	} else {
		push @INC, '/home/httpd/cgi-bin/easytecc4';
	}
}

$< = $>;
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
$ENV{PATH} = '/usr/bin:/usr/sbin:/bin';
my $datadir = $ARGV[0];

my $debug = 1 if(-e '/etc/easytecc');
open(DEBUG, '>>/home/web/log/easytecc4.log') if $debug;
print DEBUG "get_size_mysql\n" if $debug;

exit(0) unless $datadir;
unless ($datadir =~ m#^([\w.-\/]+)$#) {
    die "'$datadir' has invalid characters.\n";
}
$datadir = $1;
#chdir($datadir);
#my $out = `du -s */`;

my $out = '';
if (-e '/etc/sudoers'){
	$out = `/usr/iports/bin/sudo /usr/bin/du -Ask $datadir\/*\/`;
} else {
	$out = `/usr/bin/du -sk $datadir\/*\/`;
}

my @out = split /\n/, $out;

print DEBUG "out=$out\n" if $debug;

foreach(@out){
my @path = split /\//, $_;
my $print = $path[0] . "    " . $path[-1];



print $print . "\n";
}