The `permissions` field of hfsplus files is only used by Mac OS X. This
causes Grub to skip reading files created by Mac OS 9, since their
file mode is read as unknown. Instead, assume files with zero mode
are regular files.

From Technote 1150: "The traditional Mac OS implementation of HFS Plus
does not use the permissions field. Files created by traditional Mac OS
have the entire field set to 0."
---
 grub-core/fs/hfsplus.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/grub-core/fs/hfsplus.c b/grub-core/fs/hfsplus.c
index 3f203abcc..6799ba278 100644
--- a/grub-core/fs/hfsplus.c
+++ b/grub-core/fs/hfsplus.c
@@ -736,7 +736,9 @@ list_nodes (void *record, void *hook_arg)
        int mode = (grub_be_to_cpu16 (fileinfo->mode)
                    & GRUB_HFSPLUS_FILEMODE_MASK);
 
-       if (mode == GRUB_HFSPLUS_FILEMODE_REG)
+       if (mode == 0) /* created by pre-Mac OS X */
+          type = GRUB_FSHELP_REG;
+        else if (mode == GRUB_HFSPLUS_FILEMODE_REG)
          type = GRUB_FSHELP_REG;
        else if (mode == GRUB_HFSPLUS_FILEMODE_SYMLINK)
          type = GRUB_FSHELP_SYMLINK;
-- 
2.51.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to