Skip to content
Snippets Groups Projects
Commit f302160f authored by Brian Carrier's avatar Brian Carrier
Browse files

Addressed issue 2677069 regarding VS type collisions with GPT and the DOS safety partition.

parent 2cd9b9c5
No related branches found
No related tags found
No related merge requests found
......@@ -49,8 +49,13 @@ attributes. Reported and patch by Jamie Butler (Mandiant).
4/8/09: Fixed typo bugs in sorter as reported by Drew Hunt.
4/11/09: Feature. Addressed issue 2734458 regarding slow NTFS listing time by adding a orphan cache map.
4/11/09: Feature. Addressed issue 2734458 regarding slow NTFS listing
time by adding a orphan cache map.
4/11/09: Feature. Addressed issue 2677069 regarding VS type
collisions with GPT and the DOS safety partition table. DOS partition
table ignored if it seems to be the safety partition. Based on a
variation of a patch submitted by Aaron Burghardt.
---------------- VERSION 3.0.0 --------------
0/00/00: Update: Many, many, many API changes.
......
......@@ -76,19 +76,43 @@ tsk_vs_open(TSK_IMG_INFO * img_info, TSK_DADDR_T offset,
tsk_error_reset();
}
if ((vs = tsk_vs_gpt_open(img_info, offset)) != NULL) {
if (set == NULL) {
set = "GPT";
vs_set = vs;
}
else {
vs_set->close(vs_set);
vs->close(vs);
tsk_error_reset();
tsk_errno = TSK_ERR_VS_UNKTYPE;
snprintf(tsk_errstr, TSK_ERRSTR_L,
"GPT or %s at %" PRIuDADDR, set, offset);
return NULL;
if (set != NULL) {
/* GPT drives have a DOS Safety partition table.
* Test to see if we can ignore one */
if ((strcmp(set, "DOS"))
&& (vs_set->part_count == 1)
&& (vs_set->part_list)
&& (vs_set->part_list->start <= 63)
&& (vs_set->part_list->desc)
&& (strncmp(vs_set->part_list->desc, "GPT", 3))) {
TSK_VS_PART_INFO *tmp;
/* see if we can find a GPT partition that ends at the same
* location as the DOS (we should be testing for the last GPT partition...) */
for (tmp = vs->part_list; tmp; tmp = tmp->next) {
if ((vs_set->part_list->start +
vs_set->part_list->len) ==
(tmp->start + tmp->len)) {
if (tsk_verbose)
tsk_fprintf(stderr,
"mm_open: Ignoring DOS Safety GPT Partition\n");
set = NULL;
vs_set = NULL;
}
}
}
if (set != NULL) {
vs_set->close(vs_set);
vs->close(vs);
tsk_error_reset();
tsk_errno = TSK_ERR_VS_UNKTYPE;
snprintf(tsk_errstr, TSK_ERRSTR_L,
"GPT or %s at %" PRIuDADDR, set, offset);
return NULL;
}
}
set = "GPT";
vs_set = vs;
}
else {
tsk_error_reset();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment