On Tue, Nov 05, 2019 at 12:49:08PM +0100, Javier Martinez Canillas wrote: > Hello Michael, > > On 11/5/19 10:20 AM, Michael Chang wrote: > > The environment block is a preallocated 1024-byte file serves as persistent > > storage for environment variables. It has its own format which is sensitive > > to > > corruption if using editor doesn't know how to process it. Besides the > > editor > > may inadvertantly change size allocation that could have it sparse the > > filesystem which could lead to unexpected outcome. > > > > Yes, we also get reports about this issue: > https://bugzilla.redhat.com/show_bug.cgi?id=1625124 > > > This patch adds message in grubenv file to warn the user from editing it by > > tools other than grub-editenv. > > > > Agreed that users should be warned that the file should only be edited with > the GRUB tools. > > I also wonder if grub-editenv can't be made more robust and correct a grubenv > file (i.e: filling the missing # characters / removing any extra # character) > if is found to be corrupted and not having the expected size.
IMHO when people trying to read grubenv file they didn't expect the sanitization from happening, as that might be troublesome to describe problem if anyone wants to troubleshoot issue related to malformed grubenv which is just victim of filesystem corruption and like. I personally wouldn't mind if the function is provided as separate command and backup original file somewhere .. > > > Signed-off-by: Michael Chang <mch...@suse.com> > > --- > > util/editenv.c | 12 +++++++++--- > > 1 file changed, 9 insertions(+), 3 deletions(-) > > > > The patch looks good to me. > > Reviewed-by: Javier Martinez Canillas <javi...@redhat.com> Thanks a lot for your feedback and review. :) Regards, Michael > > Best regards, > -- > Javier Martinez Canillas > Software Engineer - Desktop Hardware Enablement > Red Hat _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel