Skip to content

Commit 73c9131

Browse files
author
Nicolas Saenz Julienne
committed
rpi-eeprom-update: Surround [:print:] with quotes
It seems that [:print:] could be substituted by rogue shells[1], so surround it with quotes to make sure it doesn't happen. Use single quotes as they are the most constraining kind. All in all, this change should be harmless. Signed-off-by: Nicolas Saenz Julienne <[email protected]> [1] #298 (comment)
1 parent d642c79 commit 73c9131

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rpi-eeprom-update

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ getBootloaderConfig() {
113113
local blconfig_nvmem_path=""
114114

115115
if [ -f "${blconfig_alias}" ]; then
116-
local blconfig_ofnode_path="/sys/firmware/devicetree/base"$(tr -cd [:print:] < "${blconfig_alias}")""
116+
local blconfig_ofnode_path="/sys/firmware/devicetree/base"$(tr -cd '[:print:]' < "${blconfig_alias}")""
117117
local blconfig_ofnode_link=$(find -L /sys/bus/nvmem -samefile "${blconfig_ofnode_path}" 2>/dev/null)
118118

119119
if [ -e "${blconfig_ofnode_link}" ]; then
@@ -288,7 +288,7 @@ getBootloaderUpdateVersion() {
288288
match=".*/pieeprom-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].bin"
289289
latest="$(find "${FIRMWARE_IMAGE_DIR}/" -maxdepth 1 -type f -size "${EEPROM_SIZE}c" -regex "${match}" | sort -r | head -n1)"
290290
if [ -f "${latest}" ]; then
291-
BOOTLOADER_UPDATE_VERSION=$(tr -c [:print:] "\n" < "${latest}" | sed '/^BUILD_TIMESTAMP=/s/.*=//p;d')
291+
BOOTLOADER_UPDATE_VERSION=$(tr -c '[:print:]' "\n" < "${latest}" | sed '/^BUILD_TIMESTAMP=/s/.*=//p;d')
292292
BOOTLOADER_UPDATE_IMAGE="${latest}"
293293
fi
294294
}

0 commit comments

Comments
 (0)