Bug#652972: grub-pc: Grep complains input file `/boot/grub/grub.cfg.new' is also the output

Ralph Ulrich eulenreich at gmx.de
Sat Jan 21 17:31:26 UTC 2012


This bug is very confusing for advanced users, because normally there is 
a very bad bug with such an error message. But it is more like a 
security flaw, see later:

Turns out in /usr/sbin/grub-mkconfig:
if [ "x${grub_cfg}" != "x" ] && ! grep -q "^password " ${grub_cfg}.new

grep internally recognizes output is redirected to the same file. A 
workaround would simply be:"grep -q "^password " <${grub_cfg}.new"

Then grep is unable to recognize this fact. But there is perhaps a 
security bug anyway:

If there was no sync after generating grub.cfg.new before this grep, 
then there might not be that "password" keyword yet!





More information about the Pkg-grub-devel mailing list