* grub-core/fs/cpio.c (canonicalize): Handle "..".
(grub_cpio_find_file) [MODE_USTAR]: Handle hardlinks.
This commit is contained in:
parent
f3250e5f1f
commit
fc977f485f
2 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-05-27 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/fs/cpio.c (canonicalize): Handle "..".
|
||||
(grub_cpio_find_file) [MODE_USTAR]: Handle hardlinks.
|
||||
|
||||
2012-05-27 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/fs/btrfs.c (GRUB_BTRFS_ITEM_TYPE_INODE_REF): New enum value.
|
||||
|
|
|
@ -142,6 +142,15 @@ canonicalize (char *name)
|
|||
iptr += 2;
|
||||
continue;
|
||||
}
|
||||
if (iptr[0] == '.' && iptr[1] == '.' && (iptr[2] == '/' || iptr[2] == 0))
|
||||
{
|
||||
iptr += 3;
|
||||
if (optr == name)
|
||||
continue;
|
||||
for (optr -= 2; optr >= name && *optr != '/'; optr--);
|
||||
optr++;
|
||||
continue;
|
||||
}
|
||||
while (*iptr && *iptr != '/')
|
||||
*optr++ = *iptr++;
|
||||
if (*iptr)
|
||||
|
@ -341,6 +350,9 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name,
|
|||
*mode = read_number (hd.mode, sizeof (hd.mode));
|
||||
switch (hd.typeflag)
|
||||
{
|
||||
/* Hardlink. */
|
||||
case '1':
|
||||
/* Symlink. */
|
||||
case '2':
|
||||
*mode |= ATTR_LNK;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue