fixes for bandit

This commit is contained in:
edoapra 2026-06-29 14:53:32 -07:00
parent 11a42ddab8
commit 4e2d7deb94
No known key found for this signature in database
GPG key ID: 9E6A0B70826967BA

View file

@ -18,7 +18,7 @@ Optimizations applied:
import os
import sys
import re
import subprocess
import subprocess # nosec B404
debug = False
@ -168,8 +168,9 @@ def process_file(file_path, patterns):
print(f"Backup file: {filebak}")
# Runs the Linux 'file' command
result = subprocess.run(['file', file_path], capture_output=True, text=True)
result = subprocess.run(['file', file_path], shell=False, capture_output=True, text=True) # nosec
# DOS files output contains "with CRLF line terminators"
if "CRLF" in result.stdout:
print(f"ERROR: DOS file with CRLF {file_path}", file=sys.stderr)