Bug#612417: GRUB doesn't accept background images with whitespace in filename

Alexander Kurtz kurtz.alex at googlemail.com
Tue Feb 8 13:01:49 UTC 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-quoting-small.patch
Type: text/x-patch
Size: 668 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20110208/a96e6c9a/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-quoting-big.patch
Type: text/x-patch
Size: 7615 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20110208/a96e6c9a/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-quoting-really-big.patch
Type: text/x-patch
Size: 7635 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20110208/a96e6c9a/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20110208/a96e6c9a/attachment-0001.pgp>


More information about the Pkg-grub-devel mailing list