Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hack/generate-versioninfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function os::build::generate_windows_versioninfo() {
}
}
EOF
goversioninfo -o ${OS_ROOT}/cmd/oc/oc.syso ${windows_versioninfo_file}
goversioninfo -64 -o ${OS_ROOT}/cmd/oc/oc.syso ${windows_versioninfo_file}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Quote goversioninfo arguments to avoid shell word-splitting.

Line 58 leaves ${OS_ROOT} and ${windows_versioninfo_file} unquoted; this can break the build if either contains spaces or glob characters.

Suggested patch
-  goversioninfo -64 -o ${OS_ROOT}/cmd/oc/oc.syso ${windows_versioninfo_file}
+  goversioninfo -64 -o "${OS_ROOT}/cmd/oc/oc.syso" "${windows_versioninfo_file}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
goversioninfo -64 -o ${OS_ROOT}/cmd/oc/oc.syso ${windows_versioninfo_file}
goversioninfo -64 -o "${OS_ROOT}/cmd/oc/oc.syso" "${windows_versioninfo_file}"
🧰 Tools
🪛 Shellcheck (0.11.0)

[info] 58-58: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 58-58: Double quote to prevent globbing and word splitting.

(SC2086)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hack/generate-versioninfo.sh` at line 58, The goversioninfo invocation leaves
${OS_ROOT} and ${windows_versioninfo_file} unquoted which can break builds when
paths contain spaces or glob chars; update the call to quote both arguments
passed to goversioninfo (the output path and the input versioninfo file) so that
the command uses "${OS_ROOT}/cmd/oc/oc.syso" and "${windows_versioninfo_file}"
when invoking goversioninfo to prevent shell word-splitting and globbing.

}
readonly -f os::build::generate_windows_versioninfo

Expand Down