* grub-core/fs/jfs.c (grub_jfs_read_file): New parameter ino.

All users updated.
	(grub_jfs_lookup_symlink): Use correct starting inode.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-08-16 23:10:38 +02:00
parent 5c144cc8b2
commit 43526629e5
2 changed files with 12 additions and 9 deletions

View file

@ -1,3 +1,9 @@
2011-08-16 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/jfs.c (grub_jfs_read_file): New parameter ino.
All users updated.
(grub_jfs_lookup_symlink): Use correct starting inode.
2011-08-16 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-setup.c (main): Add missing gcry initialisation.

View file

@ -614,7 +614,8 @@ grub_jfs_read_file (struct grub_jfs_data *data,
/* Find the file with the pathname PATH on the filesystem described by
DATA. */
static grub_err_t
grub_jfs_find_file (struct grub_jfs_data *data, const char *path)
grub_jfs_find_file (struct grub_jfs_data *data, const char *path,
grub_uint32_t start_ino)
{
char fpath[grub_strlen (path)];
char *name = fpath;
@ -623,7 +624,7 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path)
grub_strncpy (fpath, path, grub_strlen (path) + 1);
if (grub_jfs_read_inode (data, GRUB_JFS_AGGR_INODE, &data->currinode))
if (grub_jfs_read_inode (data, start_ino, &data->currinode))
return grub_errno;
/* Skip the first slashes. */
@ -724,11 +725,7 @@ grub_jfs_lookup_symlink (struct grub_jfs_data *data, grub_uint32_t ino)
if (symlink[0] == '/')
ino = 2;
/* Now load in the old inode. */
if (grub_jfs_read_inode (data, ino, &data->currinode))
return grub_errno;
grub_jfs_find_file (data, symlink);
grub_jfs_find_file (data, symlink, ino);
if (grub_errno)
grub_error (grub_errno, "cannot follow symlink `%s'", symlink);
@ -750,7 +747,7 @@ grub_jfs_dir (grub_device_t device, const char *path,
if (!data)
goto fail;
if (grub_jfs_find_file (data, path))
if (grub_jfs_find_file (data, path, GRUB_JFS_AGGR_INODE))
goto fail;
diro = grub_jfs_opendir (data, &data->currinode);
@ -801,7 +798,7 @@ grub_jfs_open (struct grub_file *file, const char *name)
if (!data)
goto fail;
grub_jfs_find_file (data, name);
grub_jfs_find_file (data, name, GRUB_JFS_AGGR_INODE);
if (grub_errno)
goto fail;