From 8267ab45e922838122d5392d64bada5857d99307 Mon Sep 17 00:00:00 2001 From: kbhujbal Date: Mon, 1 Dec 2025 21:37:42 -0800 Subject: [PATCH] shell vulnerabilities fixed --- fileTreeUtilities/matchFrames.py | 7 +++++-- renderUtilities/compressLosslessVideo.py | 10 ++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/fileTreeUtilities/matchFrames.py b/fileTreeUtilities/matchFrames.py index ef123c4..160dfb8 100755 --- a/fileTreeUtilities/matchFrames.py +++ b/fileTreeUtilities/matchFrames.py @@ -10,6 +10,7 @@ import numpy as np import fire, os +from pathlib import Path rgbCameraList = ["Camera_Left_RGB", "Camera_Down_RGB"] @@ -126,8 +127,10 @@ def main(datasetLocation, dryrun=True): datasetLocation = os.path.realpath(datasetLocation) renderFolders = [ f.parent for f in Path(datasetLocation).glob('**/120hzTimestamps.csv')] - ( passed, failedRGBSeg, failedDepth, failedOther ) = [ checkRender() ] - + # Process each render folder + for folder in renderFolders: + checkRender(str(folder), dryrun=dryrun) + if __name__ == '__main__': fire.Fire(checkRender) diff --git a/renderUtilities/compressLosslessVideo.py b/renderUtilities/compressLosslessVideo.py index d05b8a9..f56be74 100755 --- a/renderUtilities/compressLosslessVideo.py +++ b/renderUtilities/compressLosslessVideo.py @@ -10,6 +10,8 @@ import time import numpy as np import fire +from pathlib import Path + ''' Winter Guerra @@ -33,7 +35,9 @@ def compressLosslessVideo(input_folder, file_extension, output_folder=None): output_folder = output_folder.replace(".", "") # Make sure that output folder exists - process = subprocess.Popen("mkdir -p "+output_folder, shell=True) + # process = subprocess.Popen("mkdir -p "+output_folder, shell=True) + Path(output_folder).mkdir(parents=True, exist_ok=True) + process.wait() # Find all raw image files in folder. @@ -130,7 +134,9 @@ def compressVideoTarball(input_folder, file_extension, output_folder=None): output_folder = output_folder.replace(".", "") # Make sure that output folder exists - process = subprocess.Popen("mkdir -p "+output_folder, shell=True) + # process = subprocess.Popen("mkdir -p "+output_folder, shell=True) + Path(output_folder).mkdir(parents=True, exist_ok=True) + process.wait() # Find all raw image files in folder.