From 634d11af0dd1aee0cf1cb55af224b0b597857a68 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 00:59:42 +0000 Subject: [PATCH] Fix shell variable quoting for security Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- scripts/docker-image-download-kernel.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/docker-image-download-kernel.sh b/scripts/docker-image-download-kernel.sh index 62e207e..4ece0b8 100755 --- a/scripts/docker-image-download-kernel.sh +++ b/scripts/docker-image-download-kernel.sh @@ -43,23 +43,23 @@ fi echo "Kernel extracted successfully: $KERNEL_FILE" # Extract kernel version from the kernel filename -KERNEL_VERSION=$(basename $KERNEL_FILE | sed 's/vmlinuz-//') +KERNEL_VERSION=$(basename "$KERNEL_FILE" | sed 's/vmlinuz-//') echo "Kernel version: $KERNEL_VERSION" # Copy kernel modules to system location so mkinitramfs can find them echo "Copying kernel modules to system location..." -if [ -d /kernel/lib/modules/${KERNEL_VERSION} ]; then - cp -r /kernel/lib/modules/${KERNEL_VERSION} /lib/modules/ +if [ -d "/kernel/lib/modules/${KERNEL_VERSION}" ]; then + cp -r "/kernel/lib/modules/${KERNEL_VERSION}" /lib/modules/ else echo "WARNING: No modules found for kernel ${KERNEL_VERSION}" fi # Generate initrd using mkinitramfs echo "Generating initrd for kernel version $KERNEL_VERSION..." -mkinitramfs -o /kernel/boot/initrd.img-${KERNEL_VERSION} ${KERNEL_VERSION} +mkinitramfs -o "/kernel/boot/initrd.img-${KERNEL_VERSION}" "${KERNEL_VERSION}" # Verify initrd was created -if [ ! -f /kernel/boot/initrd.img-${KERNEL_VERSION} ]; then +if [ ! -f "/kernel/boot/initrd.img-${KERNEL_VERSION}" ]; then echo "ERROR: Failed to generate initrd" exit 1 fi