Skip to content

fix: quote command substitution in firmware path check - #959

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/nvidia-driver-quote-command-substitution-in-firmware
Open

fix: quote command substitution in firmware path check#959
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:bugfix/nvidia-driver-quote-command-substitution-in-firmware

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

This PR addresses the following issue in ubuntu22.04/nvidia-driver: quote command substitution in firmware path check.

Changes

  • ubuntu22.04/nvidia-driver: quote command substitution in firmware path check.

Details

--- a/ubuntu22.04/nvidia-driver
+++ b/ubuntu22.04/nvidia-driver
@@ -1,1 +1,1 @@
-        if [[ ! -z $(grep '[^[:space:]]' $fw_path_config_file) ]]; then
+        if grep -q '[^[:space:]]' "$fw_path_config_file"; then

Tests

  • tests/test_fw_path_quoting.sh
--- /dev/null
+++ b/tests/test_fw_path_quoting.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+# Regression test: the firmware path occupancy check must quote its command
+# substitution so multi-word contents do not break the [[ ]] test.
+set -euo pipefail
+
+driver_file="ubuntu22.04/nvidia-driver"
+
+if grep -q '\[\[ ! -z $(grep' "$driver_file"; then
+    echo "FAIL: unquoted command substitution in [[ ]] test remains"
+    exit 1
+fi
+
+echo "PASS: firmware path check uses quoted substitution"

Contributor guidelines

Per this repo's CONTRIBUTING.md:

  • All commits are signed off (Signed-off-by trailer, DCO).

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant