From 63eae1f4a4e4e98f6c152aed0196fdb46acbacb2 Mon Sep 17 00:00:00 2001 From: Ereth McKnight-MacNeil Date: Wed, 20 Jan 2021 12:52:57 -0800 Subject: [PATCH] Shell quoting in move_widevine_data.sh Add double quotes to prevent globbing and word splitting. Bug: crbug.com/1168550 Test: Create /data/mediadrm files and observe they are moved Change-Id: I8d1cd70971588f903657825ea6e10c019954f403 (cherry picked from commit 8649f7a952b7e4f8edd17edfca0b0962e2fb2662) (cherry picked from commit 84d0d73be533d7c5916830e6559888433c3b19bf) --- libwvdrmengine/move_widevine_data.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libwvdrmengine/move_widevine_data.sh b/libwvdrmengine/move_widevine_data.sh index 56c1e704..dfdd852a 100755 --- a/libwvdrmengine/move_widevine_data.sh +++ b/libwvdrmengine/move_widevine_data.sh @@ -9,8 +9,8 @@ if [ ! -f "$FILES_MOVED" ]; then for i in "$SRC_PATH/IDM"*; do dest_path=$DEST_PATH/"${i#$SRC_PATH/}" if [ -d "$i" ]; then - mkdir -p $dest_path -m 700 - mv $i "$DEST_PATH" + mkdir -p "$dest_path" -m 700 + mv "$i" "$DEST_PATH" for file in ${dest_path}/${L3_FILE_PATTERN}; do [ -e "${file}" ] || continue # We need to move any L3 files in the IDM folder to the L3 subfolder. @@ -18,7 +18,7 @@ if [ ! -f "$FILES_MOVED" ]; then mkdir -p "${l3_dir}" -m 700 mv "${file}" "${l3_dir}" done - find $dest_path -print0 | while IFS= read -r -d '' file + find "$dest_path" -print0 | while IFS= read -r -d '' file do chgrp media "$file" done