Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
grub2.1383
grub2-editenv-add-warning-message.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File grub2-editenv-add-warning-message.patch of Package grub2.1383
Index: grub-2.02~beta2/util/editenv.c =================================================================== --- grub-2.02~beta2.orig/util/editenv.c +++ grub-2.02~beta2/util/editenv.c @@ -30,12 +30,14 @@ #include <string.h> #define DEFAULT_ENVBLK_SIZE 1024 +#define GRUB_ENVBLK_MESSAGE "# WARNING: Do not edit this file other than by grub2-editenv\n" void grub_util_create_envblk_file (const char *name) { FILE *fp; char *buf; + char *pbuf; char *namenew; buf = xmalloc (DEFAULT_ENVBLK_SIZE); @@ -46,9 +48,13 @@ grub_util_create_envblk_file (const char grub_util_error (_("cannot open `%s': %s"), namenew, strerror (errno)); - memcpy (buf, GRUB_ENVBLK_SIGNATURE, sizeof (GRUB_ENVBLK_SIGNATURE) - 1); - memset (buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1, '#', - DEFAULT_ENVBLK_SIZE - sizeof (GRUB_ENVBLK_SIGNATURE) + 1); + pbuf = buf; + memcpy (pbuf, GRUB_ENVBLK_SIGNATURE, sizeof (GRUB_ENVBLK_SIGNATURE) - 1); + pbuf += sizeof (GRUB_ENVBLK_SIGNATURE) - 1; + memcpy (pbuf, GRUB_ENVBLK_MESSAGE, sizeof (GRUB_ENVBLK_MESSAGE) - 1); + pbuf += sizeof (GRUB_ENVBLK_MESSAGE) - 1; + memset (pbuf , '#', + DEFAULT_ENVBLK_SIZE - sizeof (GRUB_ENVBLK_SIGNATURE) - sizeof (GRUB_ENVBLK_MESSAGE) + 2); if (fwrite (buf, 1, DEFAULT_ENVBLK_SIZE, fp) != DEFAULT_ENVBLK_SIZE) grub_util_error (_("cannot write to `%s': %s"), namenew,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor