Errors Launching Program and Saving Settings When Using Double Quotes in kernel parameters

Bug #1888079 reported by Lucas McCarthy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Grub Customizer
New
Undecided
Unassigned

Bug Description

If there are double quotes in the kernel parameters field under General Settings, Grub Customizer encounters an error when saving settings or launching the program.

This appears to be a result of double quotes being interpreted as the start or end of a string literal rather than part of the string literal assigned to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub. There may be similar issues with other special characters (see https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02) and this issue may not be restricted to the kernel parameters field.

If a user does not remedy this before closing Grub Customizer, they will be unable to launch the program - and, by extension, use it to correct the error - essentially locking them out. The error may be resolved, however, by editing /etc/default/grub and prepending the double quotes with a backslash, replacing them with single quotes, or otherwise removing them.

Admittedly, I'm not sure if this qualifies as a bug so much as user error, but it may be worth adding a measure to prevent this from happening, such as some sort of input validation or automatically prepending double quotes with a backslash.

Going into specifics, I encountered this issue after adding the following to the kernel parameters field:
>acpi_os_name="Windows 2001"
For the record, the full contents of the field were as follows:
>loglevel=3 rw rootfstype=ext4 rootflags=rw,errors=remount-ro,noatime acpi_os_name="Windows 2001" pci=nomsi,noaer
On clicking save, Grub Customizer displayed the following error:
>Failed saving grub configuration!
>Please take a look at the command line output below. If you think this is a bug of Grub Customizer, please create one at https://launchpad.net/grub-customizer! Generally Grub Customizer should prevent errors like this.
>
>failed running 'grub-mkconfig -o "/boot/grub/grub.cfg"' output:
>/etc/default/grub: line 6: 2001 pci=nomsi,noaer: command not found
It was late, so I decided to worry about it later and just closed the program. The next day, I tried launching Grub Customizer but was met with a somewhat similar error message:
>grub-mkconfig couldn't be executed successfully. error message:
>/etc/default/grub: line 6: 2001 pci=nomsi,noaer: command not found
Although I was unable to fix the issue via Grub Customizer, I was able to do so by directly editing /etc/default/grub and replacing the double quotes with single quotes.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.