Sandbox Process Creation

This commit is contained in:
pixeebot[bot]
2025-03-18 03:41:40 +00:00
committed by GitHub
parent 2e7ed15038
commit aed629068f
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