* grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Fix symlink
handling.
This commit is contained in:
parent
3244fe96e7
commit
742d2be63a
2 changed files with 11 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2012-05-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Fix symlink
|
||||||
|
handling.
|
||||||
|
|
||||||
2012-05-10 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-05-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/ufs.c (grub_ufs_find_file): Fix handling of double slash.
|
* grub-core/fs/ufs.c (grub_ufs_find_file): Fix handling of double slash.
|
||||||
|
|
|
@ -533,6 +533,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
|
||||||
enum grub_fshelp_filetype type;
|
enum grub_fshelp_filetype type;
|
||||||
grub_off_t len;
|
grub_off_t len;
|
||||||
char *symlink = 0;
|
char *symlink = 0;
|
||||||
|
int was_continue = 0;
|
||||||
|
|
||||||
/* Extend the symlink. */
|
/* Extend the symlink. */
|
||||||
auto inline void __attribute__ ((always_inline)) add_part (const char *part,
|
auto inline void __attribute__ ((always_inline)) add_part (const char *part,
|
||||||
|
@ -630,11 +631,11 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
|
||||||
/* The data on pos + 2 is the actual data, pos + 1
|
/* The data on pos + 2 is the actual data, pos + 1
|
||||||
is the length. Both are part of the `Component
|
is the length. Both are part of the `Component
|
||||||
Record'. */
|
Record'. */
|
||||||
if (symlink && (entry->data[pos] & 1))
|
if (symlink && !was_continue)
|
||||||
add_part ("/", 1);
|
add_part ("/", 1);
|
||||||
add_part ((char *) &entry->data[pos + 2],
|
add_part ((char *) &entry->data[pos + 2],
|
||||||
entry->data[pos + 1]);
|
entry->data[pos + 1]);
|
||||||
|
was_continue = (entry->data[pos] & 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,6 +669,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
|
||||||
for (; offset < len; offset += dirent.len)
|
for (; offset < len; offset += dirent.len)
|
||||||
{
|
{
|
||||||
symlink = 0;
|
symlink = 0;
|
||||||
|
was_continue = 0;
|
||||||
|
|
||||||
if (read_node (dir, offset, sizeof (dirent), (char *) &dirent))
|
if (read_node (dir, offset, sizeof (dirent), (char *) &dirent))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -817,6 +819,8 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
|
||||||
+ node->have_dirents * sizeof (node->dirents[0])
|
+ node->have_dirents * sizeof (node->dirents[0])
|
||||||
- sizeof (node->dirents), symlink);
|
- sizeof (node->dirents), symlink);
|
||||||
grub_free (symlink);
|
grub_free (symlink);
|
||||||
|
symlink = 0;
|
||||||
|
was_continue = 0;
|
||||||
}
|
}
|
||||||
if (hook (filename, type, node))
|
if (hook (filename, type, node))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue