From db0b0b1e97751d4c331e9eb95d69c885b846b952 Mon Sep 17 00:00:00 2001 From: rsora Date: Fri, 21 May 2021 13:40:49 +0200 Subject: [PATCH] Add --fdpass flag to clamdscan command to pass filedescriptor to clamd (useful if clamd is running as a different user) --- libraries/clamav.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/clamav.go b/libraries/clamav.go index 931bee88..9f1062a4 100644 --- a/libraries/clamav.go +++ b/libraries/clamav.go @@ -56,7 +56,7 @@ func modifyEnv(env []string, key, value string) []string { // RunAntiVirus scans the folder for viruses. func RunAntiVirus(folder string) ([]byte, error) { - cmd := exec.Command("clamdscan", "-i", folder) + cmd := exec.Command("clamdscan", "--fdpass", "-i", folder) cmd.Env = modifyEnv(os.Environ(), "LANG", "en") out, err := cmd.CombinedOutput()