* grub-core/fs/ufs.c (grub_ufs_lookup_symlink): Use proper check for
inline symlinks in addition to workaround.
This commit is contained in:
parent
3b4afb4de1
commit
59fd2aacd0
2 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2012-05-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/fs/ufs.c (grub_ufs_lookup_symlink): Use proper check for
|
||||||
|
inline symlinks in addition to workaround.
|
||||||
|
|
||||||
2012-05-03 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-05-03 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/xfs.c (grub_xfs_iterate_dir): Handle read_inode errors.
|
* grub-core/fs/xfs.c (grub_xfs_iterate_dir): Handle read_inode errors.
|
||||||
|
|
|
@ -401,7 +401,13 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
|
||||||
if (++data->linknest > GRUB_UFS_MAX_SYMLNK_CNT)
|
if (++data->linknest > GRUB_UFS_MAX_SYMLNK_CNT)
|
||||||
return grub_error (GRUB_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks"));
|
return grub_error (GRUB_ERR_SYMLINK_LOOP, N_("too deep nesting of symlinks"));
|
||||||
|
|
||||||
if (INODE_SIZE (data) <= sizeof (data->inode.symlink))
|
/* Normally we should just check that data->inode.nblocks == 0.
|
||||||
|
However old Linux doesn't maintain nblocks correctly and so it's always
|
||||||
|
0. If size is bigger than inline space then the symlink is surely not
|
||||||
|
inline. */
|
||||||
|
/* Check against zero is paylindromic, no need to swap. */
|
||||||
|
if (data->inode.nblocks == 0
|
||||||
|
&& INODE_SIZE (data) <= sizeof (data->inode.symlink))
|
||||||
grub_strcpy (symlink, (char *) INODE (data, symlink));
|
grub_strcpy (symlink, (char *) INODE (data, symlink));
|
||||||
else
|
else
|
||||||
grub_ufs_read_file (data, 0, 0, INODE_SIZE (data), symlink);
|
grub_ufs_read_file (data, 0, 0, INODE_SIZE (data), symlink);
|
||||||
|
|
Loading…
Add table
Reference in a new issue