HEX
Server: Apache
System: Linux vmi1259262.contaboserver.net 5.15.0-170-generic #180-Ubuntu SMP Fri Jan 9 16:10:31 UTC 2026 x86_64
User: aqarnomics (1008)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //usr/share/webmin/virtual-server/clamdscan-remote-wrapper.pl
#!/usr/bin/perl
# Emulate the flags of clamdscan-stream-client

my $host;
my $port = 3310;
my $file = "-";
while(@ARGV) {
	my $a = shift(@ARGV);
	if ($a eq "-d") {
		$host = shift(@ARGV);
		}
	elsif ($a eq "-p") {
		$port = shift(@ARGV);
		}
	elsif ($a eq "-" || $a !~ /^\-/) {
		# Input file
		$file = $a;
		}
	else {
		die "Unknown flag $a";
		}
	}

# Create a temporary config file
my $cfile = "/tmp/clamdscan-remote-config-$$.conf";
open(CONF, ">", $cfile);
print CONF "TCPSocket $port\n";
print CONF "TCPAddr $host\n";
close(CONF);
my $rv = system("clamdscan -c $cfile --fdpass --stream $file");
unlink($cfile);
exit($rv);