summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-05-01 18:37:12 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-05-01 18:37:12 +0200
commitdb17f12092b74dec09641ce946f4fb04f37864bf (patch)
tree55a2c19eddfd23eff8f668fe626aed56d5b7a1c6 /src
parente14f6c0c3064cf89daacc3c38d3209c2498b610d (diff)
Report HFS+/HFSX blocksize
Diffstat (limited to 'src')
-rw-r--r--src/hfsp.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/hfsp.c b/src/hfsp.c
index b28f383..1cb2f5b 100644
--- a/src/hfsp.c
+++ b/src/hfsp.c
@@ -36,7 +36,17 @@
#include "fnctdsk.h"
#include "log.h"
-static int set_HFSP_info(partition_t *partition);
+static int set_HFSP_info(partition_t *partition, const struct hfsp_vh *vh)
+{
+ partition->blocksize=be32(vh->blocksize);
+ partition->fsname[0]='\0';
+ if(partition->upart_type==UP_HFSP)
+ snprintf(partition->info, sizeof(partition->info), "HFS+ blocksize=%u", partition->blocksize);
+ else
+ snprintf(partition->info, sizeof(partition->info), "HFSX blocksize=%u", partition->blocksize);
+ return 0;
+}
+
int check_HFSP(disk_t *disk_car,partition_t *partition,const int verbose)
{
@@ -51,7 +61,7 @@ int check_HFSP(disk_t *disk_car,partition_t *partition,const int verbose)
free(buffer);
return 1;
}
- set_HFSP_info(partition);
+ set_HFSP_info(partition, (const struct hfsp_vh *)buffer);
free(buffer);
return 0;
}
@@ -73,7 +83,7 @@ int recover_HFSP(disk_t *disk_car, const struct hfsp_vh *vh,partition_t *partiti
partition->part_offset-=partition->sb_offset;
}
partition->part_size=part_size;
- set_HFSP_info(partition);
+ set_HFSP_info(partition, vh);
partition->part_type_i386=P_HFSP;
partition->part_type_mac=PMAC_HFS;
partition->part_type_gpt=GPT_ENT_TYPE_MAC_HFS;
@@ -122,14 +132,3 @@ int test_HFSP(disk_t *disk_car, const struct hfsp_vh *vh,partition_t *partition,
}
return 0;
}
-
-static int set_HFSP_info(partition_t *partition)
-{
- partition->fsname[0]='\0';
- if(partition->upart_type==UP_HFSP)
- strncpy(partition->info,"HFS+",sizeof(partition->info));
- else
- strncpy(partition->info,"HFSX",sizeof(partition->info));
- return 0;
-}
-