2009-09-06 Felix Zielcke * util/grub-mkconfig.in: Make generated config file mode 400 if it contains a password and print a warning if it fails. Index: util/grub-mkconfig.in =================================================================== --- util/grub-mkconfig.in (revision 2574) +++ util/grub-mkconfig.in (working copy) @@ -260,6 +260,11 @@ for i in ${grub_mkconfig_dir}/* ; do esac done +if [ "x${grub_cfg}" != "x" ] && grep -q "^password " ${grub_cfg}.new ; then + chmod 400 ${grub_cfg}.new || grub_warn "Could not make ${grub_cfg}.new readable by only root.\ + This means your password is readable by everyone" +fi + if test "x${grub_cfg}" != "x" ; then # none of the children aborted with error, install the new grub.cfg mv -f ${grub_cfg}.new ${grub_cfg}