[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] file: ignore host disk in blocklist check
From: |
Vladimir 'phcoder' Serbinenko |
Subject: |
Re: [PATCH] file: ignore host disk in blocklist check |
Date: |
Wed, 4 Nov 2015 12:34:37 +0100 |
Le 18 sept. 2015 8:09 PM, "Andrei Borzenkov" <address@hidden> a écrit :
>
> It cannot work anyway because host disk cannot be read. This fixes hostfs access
> on native Windows build where filenames start with '\' or do not have initial
> separator at all (d:\foo).
>
> Issue was observed when running grub-fstest on Windows. On UNIX image name is
> canonicalized to always start with `/' so this was not noticed.
>
> This has side effect of allowing relative path names on host, but this already
> was the case with `ls' command, so it just extends it to all commands.
>
> Reported-By: Arch Stack <address@hidden>
> Also-By: Arch Stack <address@hidden>
>
> ---
> grub-core/kern/file.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/kern/file.c b/grub-core/kern/file.c
> index 24da12b..3367485 100644
> --- a/grub-core/kern/file.c
> +++ b/grub-core/kern/file.c
> @@ -89,7 +89,11 @@ grub_file_open (const char *name)
>
> file->device = device;
>
> - if (device->disk && file_name[0] != '/')
> + if (device->disk && file_name[0] != '/'
> +#if defined(GRUB_UTIL) || defined(GRUB_MACHINE_EMU)
> + && grub_strcmp (device->disk->name, "host")
> +#endif
I don't particularly like this code but have no better idea. So go ahead, just add a comment why it's needed
> + )
> /* This is a block list. */
> file->fs = &grub_fs_blocklist;
> else
> --
> tg: (c93d3e6..) u/hostfs-windows (depends on: master)
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH] file: ignore host disk in blocklist check,
Vladimir 'phcoder' Serbinenko <=