[prev in list] [next in list] [prev in thread] [next in thread]
List: openbios
Subject: [OpenBIOS] [PATCH] Fix HFS+ wrapper recognition issue
From: Programmingkid <programmingkidx () gmail ! com>
Date: 2012-12-07 15:32:01
Message-ID: F30EB134-B200-49AE-9C7F-89B5509D1608 () gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
This patch fixes a problem with recognizing wrapped HFS+ volumes. This patch will \
eliminate the problem of seeing the file Where_have_all_my_files_gone? when listing \
the contents of a volume.
signed-off-by: John Arbuckle <programmingkidx@gmail.com>
Index: trunk/openbios-devel/fs/hfsplus/hfsp_volume.c
===================================================================
--- trunk/openbios-devel/fs/hfsplus/hfsp_volume.c (revision 1075)
+++ trunk/openbios-devel/fs/hfsplus/hfsp_volume.c (working copy)
@@ -305,13 +305,14 @@
{
UInt16 *vol;
int ret = 0;
+ #define wrapper_offset 0x3e
vol = (UInt16 *)malloc(2 * 1 << HFSP_BLOCKSZ_BITS);
os_seek_offset( fd, 2 * (1 << HFSP_BLOCKSZ_BITS) + offset );
os_read(fd, vol, 2, HFSP_BLOCKSZ_BITS);
if (__be16_to_cpu(vol[0]) == HFS_VOLHEAD_SIG &&
- __be16_to_cpu(vol[0x7c]) == HFSP_VOLHEAD_SIG) {
+ __be16_to_cpu(vol[wrapper_offset]) == HFSP_VOLHEAD_SIG) {
ret = -1;
} else if (__be16_to_cpu(vol[0]) == HFSP_VOLHEAD_SIG) {
ret = -1;
[Attachment #5 (unknown)]
<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: \
0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal \
Menlo; ">This patch fixes a problem with recognizing wrapped HFS+ volumes. This patch \
will eliminate the problem of seeing the file Where_have_all_my_files_gone? when \
listing the contents of a volume.</div><div style="margin-top: 0px; margin-right: \
0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal \
Menlo; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: \
0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div><div \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; \
font: normal normal normal 11px/normal Menlo; ">signed-off-by: John Arbuckle <<a \
href="mailto:programmingkidx@gmail.com">programmingkidx@gmail.com</a>></div><div \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; \
font: normal normal normal 11px/normal Menlo; "><br></div><div style="margin-top: \
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal \
normal 11px/normal Menlo; ">Index: \
trunk/openbios-devel/fs/hfsplus/hfsp_volume.c</div><div style="margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal \
11px/normal Menlo; ">===================================================================</div><div \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; \
font: normal normal normal 11px/normal Menlo; ">--- \
trunk/openbios-devel/fs/hfsplus/hfsp_volume.c<span class="Apple-tab-span" \
style="white-space:pre"> </span>(revision 1075)</div><div style="margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal \
11px/normal Menlo; ">+++ trunk/openbios-devel/fs/hfsplus/hfsp_volume.c<span \
class="Apple-tab-span" style="white-space:pre"> </span>(working copy)</div><div \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; \
font: normal normal normal 11px/normal Menlo; ">@@ -305,13 +305,14 @@</div><div \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; \
font: normal normal normal 11px/normal Menlo; "> {</div><div style="margin-top: \
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal \
normal 11px/normal Menlo; "> <span class="Apple-tab-span" \
style="white-space:pre"> </span>UInt16 *vol;</div><div style="margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal \
11px/normal Menlo; "> <span class="Apple-tab-span" \
style="white-space:pre"> </span>int ret = 0;</div><div style="margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal \
11px/normal Menlo; ">+<span class="Apple-tab-span" \
style="white-space:pre"> </span>#define wrapper_offset 0x3e</div><p style="margin: \
0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"> <br \
class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; \
margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; \
"> <span class="Apple-tab-span" style="white-space:pre"> </span>vol = (UInt16 \
*)malloc(2 * 1 << HFSP_BLOCKSZ_BITS);</div><div style="margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal \
11px/normal Menlo; "> <span class="Apple-tab-span" \
style="white-space:pre"> </span>os_seek_offset( fd, 2 * (1 << \
HFSP_BLOCKSZ_BITS) + offset );</div><div style="margin-top: 0px; margin-right: 0px; \
margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; \
"> <span class="Apple-tab-span" style="white-space:pre"> </span>os_read(fd, vol, \
2, HFSP_BLOCKSZ_BITS);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px \
Menlo; min-height: 13.0px"> <br class="webkit-block-placeholder"></p><div \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; \
font: normal normal normal 11px/normal Menlo; "> <span class="Apple-tab-span" \
style="white-space:pre"> </span>if (__be16_to_cpu(vol[0]) == HFS_VOLHEAD_SIG \
&&</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; \
margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">-<span \
class="Apple-tab-span" style="white-space:pre"> </span>__be16_to_cpu(vol[0x7c]) == \
HFSP_VOLHEAD_SIG) {</div><div style="margin-top: 0px; margin-right: 0px; \
margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; \
">+<span class="Apple-tab-span" \
style="white-space:pre"> </span>__be16_to_cpu(vol[wrapper_offset]) == \
HFSP_VOLHEAD_SIG) {</div><div style="margin-top: 0px; margin-right: 0px; \
margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; \
"> <span class="Apple-tab-span" style="white-space:pre"> </span>ret = \
-1;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; \
margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> <span \
class="Apple-tab-span" style="white-space:pre"> </span>} else if \
(__be16_to_cpu(vol[0]) == HFSP_VOLHEAD_SIG) {</div><div style="margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal \
11px/normal Menlo; "> <span class="Apple-tab-span" \
style="white-space:pre"> </span>ret = -1;</div><div><br></div></body></html>
--
OpenBIOS http://openbios.org/
Mailinglist: http://lists.openbios.org/mailman/listinfo
Free your System - May the Forth be with you
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic