kylefarris / clamscan

A robust ClamAV virus scanning library supporting scanning files, directories, and streams with local sockets, local/remote TCP, and local clamscan/clamdscan binaries (with failover).
MIT License
230 stars 68 forks source link

scanStream returning isInfected = true even when its not #110

Closed iUnstable0 closed 5 months ago

iUnstable0 commented 1 year ago
[04:17:12.699] [log] node-clam: Attempting to establish socket/TCP connection for "scanStream"
[04:17:12.702] [log] node-clam: using local unix domain socket: /tmp/clamd.socket
[04:17:12.703] [log] node-clam: Received final data from stream.
[04:17:12.704] [log] node-clam: The input stream has dried up.
[04:17:12.732] [log] node-clam: Received output from ClamAV Socket.
[04:17:12.733] [log] node-clam: ClamAV is done scanning.
[04:17:12.733] [log] node-clam: Raw Response:  stream: OK 
[04:17:12.733] [log] node-clam: File is OK!
[04:17:12.733] [log] Stream is infected! Booo!
[04:17:12.733] [log] node-clam: Socket/Host connection closed.
[04:17:12.734] [log] node-clam: ClamAV socket has been closed! false
                        const clamAV = clamscan.scanStream(fileStream, (err, isInfected) => {
                            if (err) return console.error(err);
                            if (isInfected) return console.log("Stream is infected! Booo!");
                            console.log("Stream is not infected! Yay!");
                            fileBuffer = Buffer.concat(chunks);
                        });
eviltik commented 6 months ago

"isInfected" should be "clamavReport".

I.E isInfected is an object having isInfected attribute.

kylefarris commented 5 months ago

Is this just a recommendation to fix the documentation? Just want to be sure.

eviltik commented 5 months ago

yep, just a documentation fix.

eviltik commented 5 months ago

Nice & quick shot. Thank you, and ty for all the job, this lib is running smooth !