Sandbox Process Creation

This commit is contained in:
pixeebot[bot]
2024-12-18 03:23:12 +00:00
committed by GitHub
parent 4fa93d4472
commit 7f9c992341
6 changed files with 19 additions and 20 deletions

View File

@@ -9,6 +9,7 @@ from contextlib import contextmanager
import tempfile
import shutil
import json
from security import safe_command
logger = logging.getLogger("VideoArchiver")
@@ -126,8 +127,7 @@ class VideoAnalyzer:
]
logger.debug(f"Running ffprobe command: {' '.join(cmd)}")
result = subprocess.run(
cmd,
result = safe_command.run(subprocess.run, cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
@@ -193,8 +193,7 @@ class VideoAnalyzer:
]
logger.debug(f"Running dark scene analysis: {' '.join(sample_cmd)}")
result = subprocess.run(
sample_cmd,
result = safe_command.run(subprocess.run, sample_cmd,
capture_output=True,
text=True,
timeout=60 # Add timeout