Skip to content

Commit

Permalink
Make newly-created files other than grub.cfg world-readable.
Browse files Browse the repository at this point in the history
  • Loading branch information
phcoder committed Dec 24, 2013
1 parent 569766e commit e5fa26e
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2013-12-24 Vladimir Serbinenko <[email protected]>

Make newly-created files other than grub.cfg world-readable.

2013-12-24 Andrey Borzenkov <[email protected]>

* util/grub.d/00_header.in: Improve compatibility with old config.
Expand Down
4 changes: 2 additions & 2 deletions grub-core/osdep/apple/hostdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ grub_util_fd_open (const char *os_dev, int flags)
flags |= O_BINARY;
#endif

ret = open (os_dev, flags, S_IRUSR | S_IWUSR);
ret = open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);

/* If we can't have exclusive access, try shared access */
if (ret < 0)
ret = open (os_dev, flags | O_SHLOCK, S_IRUSR | S_IWUSR);
ret = open (os_dev, flags | O_SHLOCK, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);

return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion grub-core/osdep/aros/hostdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ grub_util_fd_open (const char *dev, int flg)
if (dev[0] != '/' || dev[1] != '/' || dev[2] != ':')
{
ret->type = GRUB_UTIL_FD_FILE;
ret->fd = open (dev, flg, S_IRUSR | S_IWUSR);
ret->fd = open (dev, flg, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
if (ret->fd < 0)
{
free (ret);
Expand Down
2 changes: 1 addition & 1 deletion grub-core/osdep/bsd/hostdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ grub_util_fd_open (const char *os_dev, int flags)
flags |= O_BINARY;
#endif

ret = open (os_dev, flags, S_IRUSR | S_IWUSR);
ret = open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
if (ret >= 0)
configure_device_driver (fd);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion grub-core/osdep/freebsd/hostdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ grub_util_fd_open (const char *os_dev, int flags)
return GRUB_UTIL_FD_INVALID;
}

ret = open (os_dev, flags, S_IRUSR | S_IWUSR);
ret = open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);

#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
if (! (sysctl_oldflags & 0x10)
Expand Down
2 changes: 1 addition & 1 deletion grub-core/osdep/unix/hostdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ grub_util_fd_open (const char *os_dev, int flags)
flags |= O_BINARY;
#endif

return open (os_dev, flags, S_IRUSR | S_IWUSR);
return open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion include/grub/osdep/hostfile_aros.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ grub_util_rename (const char *from, const char *to)
return rename (from, to);
}

#define grub_util_mkdir(a) mkdir (a, 0700)
#define grub_util_mkdir(a) mkdir ((a), 0755)

struct grub_util_fd
{
Expand Down
2 changes: 1 addition & 1 deletion include/grub/osdep/hostfile_unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ grub_util_rename (const char *from, const char *to)
return rename (from, to);
}

#define grub_util_mkdir(a) mkdir ((a), 0700)
#define grub_util_mkdir(a) mkdir ((a), 0755)

#if defined (__NetBSD__)
/* NetBSD uses /boot for its boot block. */
Expand Down

0 comments on commit e5fa26e

Please sign in to comment.