GRUB doesn't accept background images with whitespace in filename
Hi,
I've investigated Debian Bug #612417[1]. The problems seems to be /usr/lib/grub/grub-mkconfig_lib. It can't handle arguments with whitespace in it because some variables are not properly quoted.
I've attached three patches:
add-quoting-small.patch:
This patch fixes the bug with a minimal set of changes.
add-quoting-big.patch:
This patch fixes the bug and does also add proper quoting to the rest of the file if it is safe to do so. This means that lines like these have NOT been changed:
for foo in ${list}; do bar; done
I also didn't change lines like this,
${grub_probe} --foo --bar
because ${grub_probe} might contain additional parameters.
add-quoting-really-big.patch:
This patch is identical to the previous one with the exception
of the ${grub_probe} case which is now also quoted.In general it seems to be a good a idea to add proper quoting to grub-mkconfig_lib for additional robustness. I've carefully written and tested all of the attached patches and everything works just fine for me. However, I can not guarantee that
a) I didn't miss any unquoted variables.
b) I didn't break some special use case.
c) I didn't break someones clever hack due to a lack of understanding.
Please review the attached patches and apply the best one. If there are any problems with the patches, don't hesitate to tell me so!
Best regards
Alexander Kurtz
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612417
grub-mkconfig_lib renamed from grub-mkconfig_lib.old +4 -4
@@ -44,20 +44,20 @@ make_system_path_relative_to_its_root () { - ${grub_mkrelpath} $1 + ${grub_mkrelpath} "${1}" } is_path_readable_by_grub () { - path=$1 + path="${1}" # abort if path doesn't exist - if test -e $path ; then : ;else + if test -e "${path}" ; then : ;else return 1 fi # abort if file is in a filesystem we can't read - if ${grub_probe} -t fs $path > /dev/null 2>&1 ; then : ; else + if ${grub_probe} -t fs "${path}" > /dev/null 2>&1 ; then : ; else return 1 fi
grub-mkconfig_lib renamed from grub-mkconfig_lib.old +59 -59
248 lines not on this page · raw message
grub-mkconfig_lib renamed from grub-mkconfig_lib.old +59 -59
248 lines not on this page · raw message