Properly handle deleted files on UDF.

* grub-core/fs/udf.c (grub_udf_iterate_dir): Skip directory entries
	whose "characteristics" field has the bit GRUB_UDF_FID_CHAR_DELETED
	set.
This commit is contained in:
Giuseppe Caizzone 2010-11-14 16:51:45 +01:00 committed by Vladimir 'phcoder' Serbinenko
parent 406858a8a9
commit cb0229c587
2 changed files with 55 additions and 44 deletions

View file

@ -1,3 +1,11 @@
2010-11-14 Giuseppe Caizzone <acaizzo@gmail.com>
Properly handle deleted files on UDF.
* grub-core/fs/udf.c (grub_udf_iterate_dir): Skip directory entries
whose "characteristics" field has the bit GRUB_UDF_FID_CHAR_DELETED
set.
2010-11-14 Giuseppe Caizzone <acaizzo@gmail.com> 2010-11-14 Giuseppe Caizzone <acaizzo@gmail.com>
Support reading files larger than 2 GiB. Support reading files larger than 2 GiB.

View file

@ -729,6 +729,9 @@ grub_udf_iterate_dir (grub_fshelp_node_t dir,
return 0; return 0;
} }
offset += sizeof (dirent) + U16 (dirent.imp_use_length);
if (!(dirent.characteristics & GRUB_UDF_FID_CHAR_DELETED))
{
child = grub_malloc (sizeof (struct grub_fshelp_node)); child = grub_malloc (sizeof (struct grub_fshelp_node));
if (!child) if (!child)
return 0; return 0;
@ -736,7 +739,6 @@ grub_udf_iterate_dir (grub_fshelp_node_t dir,
if (grub_udf_read_icb (dir->data, &dirent.icb, child)) if (grub_udf_read_icb (dir->data, &dirent.icb, child))
return 0; return 0;
offset += sizeof (dirent) + U16 (dirent.imp_use_length);
if (dirent.characteristics & GRUB_UDF_FID_CHAR_PARENT) if (dirent.characteristics & GRUB_UDF_FID_CHAR_PARENT)
{ {
/* This is the parent directory. */ /* This is the parent directory. */
@ -782,6 +784,7 @@ grub_udf_iterate_dir (grub_fshelp_node_t dir,
return 1; return 1;
} }
} }
}
/* Align to dword boundary. */ /* Align to dword boundary. */
offset = (offset + dirent.file_ident_length + 3) & (~3); offset = (offset + dirent.file_ident_length + 3) & (~3);