kylefarris/clamscan

get_version() throws ENOENT error

aleksandermanov opened this issue · 1 comments

Hello,

calling get_version() throws

{
cmd: "/usr/bin/clamscan --no-summary --stdout --remove=no --scan-archive=yes -r --version",
code: "ENOENT", 
errno: "ENOENT",
path: "/usr/bin/clamscan --no-summary --stdout --remove=no --scan-archive=yes -r --version",
spawnargs: [],
stderr: "",
stdout: "",
syscall: "spawn /usr/bin/clamscan --no-summary --stdout --remove=no --scan-archive=yes -r --version"
}

After digging in I found out that the error originates in index.js

const {stdout, stderr} = await cp_execfile(command);

I got it to work by changing it to

...
try {
                    const {stdout, stderr} = await cp_exec(command);
...

Is there I am doing something wrong when calling it?

Hmmm... yeah, that is a bug in the code. We need to use execfile for security reasons. Looks like it wasn't updated to work properly, though. I'll see if I can patch it real quick and release v1.3.1