mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-18 21:09:41 +02:00
max file size + documentation
This commit is contained in:
parent
678cf77d32
commit
1386e6d5a5
2 changed files with 29 additions and 8 deletions
|
@ -58,6 +58,7 @@ quarantine_folder = None
|
|||
has_curses = None
|
||||
maxThreads = None
|
||||
boxname = socket.gethostname()
|
||||
maxFileSize = None
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Curses
|
||||
|
@ -100,7 +101,7 @@ class scanThread(threading.Thread):
|
|||
time.sleep(1)
|
||||
|
||||
def scan(self, file):
|
||||
global infected_files, scanned, file_count, f_used
|
||||
global infected_files, scanned, file_count, f_used, maxFileSize
|
||||
logging.info(f'{"Start scan."}')
|
||||
try:
|
||||
# get file information
|
||||
|
@ -120,7 +121,7 @@ class scanThread(threading.Thread):
|
|||
logging.info(f'{"Fake scan - skipped."}')
|
||||
else:
|
||||
# do not scan files bigger than 1G
|
||||
if file_size > (1024 * 1024 * 1024):
|
||||
if file_size > maxFileSize :
|
||||
status = "TOO BIG"
|
||||
logging.info(f'{"File too big."}')
|
||||
else:
|
||||
|
@ -225,6 +226,8 @@ def config():
|
|||
has_curses = config_parser["DEFAULT"]["CURSES"].lower() == "true"
|
||||
# MaxThreads
|
||||
maxThreads = int(config_parser["DEFAULT"]["THREADS"])
|
||||
# MaxFileSize
|
||||
maxFileSize = int(config_parser["DEFAULT"]["MAX_FILE_SIZE"])
|
||||
|
||||
|
||||
# ----------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue