mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-02-07 13:59:01 +00:00
fix: passthrough scan
This commit is contained in:
parent
dd6f225461
commit
b5aa8d0758
@ -627,8 +627,10 @@ self.assertPassthroughScans = async (req, user, infoMap) => {
|
|||||||
for (const info of infoMap) {
|
for (const info of infoMap) {
|
||||||
if (info.data.clamscan) {
|
if (info.data.clamscan) {
|
||||||
if (info.data.clamscan.isInfected) {
|
if (info.data.clamscan.isInfected) {
|
||||||
|
logger.log(`[ClamAV]: ${info.data.filename}: ${info.data.clamscan.viruses.join(', ')}`)
|
||||||
foundThreats.push(...info.data.clamscan.viruses)
|
foundThreats.push(...info.data.clamscan.viruses)
|
||||||
} else if (info.data.clamscan.isInfected === null) {
|
} else if (info.data.clamscan.isInfected === null) {
|
||||||
|
logger.log(`[ClamAV]: ${info.data.filename}: Unable to scan`)
|
||||||
unableToScan.push(info.data.filename)
|
unableToScan.push(info.data.filename)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -26,7 +26,7 @@ DiskStorage.prototype._handleFile = function _handleFile (req, file, cb) {
|
|||||||
let tempError = null
|
let tempError = null
|
||||||
let tempObject = {}
|
let tempObject = {}
|
||||||
let tempWeight = 0
|
let tempWeight = 0
|
||||||
const _cb = (err = null, result = {}, weight = 1) => {
|
const _cb = (err = null, result = {}, weight = 2) => {
|
||||||
tempError = err
|
tempError = err
|
||||||
tempWeight += weight
|
tempWeight += weight
|
||||||
tempObject = Object.assign(result, tempObject)
|
tempObject = Object.assign(result, tempObject)
|
||||||
@ -75,7 +75,7 @@ DiskStorage.prototype._handleFile = function _handleFile (req, file, cb) {
|
|||||||
destination,
|
destination,
|
||||||
filename,
|
filename,
|
||||||
path: finalPath
|
path: finalPath
|
||||||
}, 2)
|
})
|
||||||
})
|
})
|
||||||
file.stream.pipe(outStream, { end: false })
|
file.stream.pipe(outStream, { end: false })
|
||||||
} else {
|
} else {
|
||||||
@ -95,7 +95,7 @@ DiskStorage.prototype._handleFile = function _handleFile (req, file, cb) {
|
|||||||
clamStream.on('scan-complete', result => {
|
clamStream.on('scan-complete', result => {
|
||||||
_cb(null, {
|
_cb(null, {
|
||||||
clamscan: result
|
clamscan: result
|
||||||
})
|
}, 1)
|
||||||
})
|
})
|
||||||
file.stream.pipe(clamStream).pipe(outStream)
|
file.stream.pipe(clamStream).pipe(outStream)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user