From: Dave Vasilevsky <dave@vasilevsky.ca>
To: grub-devel@gnu.org
Cc: Dave Vasilevsky <dave@vasilevsky.ca>
Subject: [PATCH] hfsplus: Allow reading files created by Mac OS 9
Date: Wed, 1 Oct 2025 17:03:48 -0400 [thread overview]
Message-ID: <20251001210349.802717-1-dave@vasilevsky.ca> (raw)
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
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next reply other threads:[~2025-10-02 0:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 21:03 Dave Vasilevsky [this message]
2025-10-02 12:21 ` [PATCH] hfsplus: Allow reading files created by Mac OS 9 Daniel Kiper
2025-10-02 13:07 ` Dave Vasilevsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251001210349.802717-1-dave@vasilevsky.ca \
--to=dave@vasilevsky.ca \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).