qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] block: Prevent /dev/fd/X filename from being de


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] block: Prevent /dev/fd/X filename from being detected as floppy
Date: Thu, 14 Jun 2012 11:24:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0

Il 13/06/2012 16:30, root ha scritto:
> From: Corey Bryant <address@hidden>
> 
> Reported-by: Kevin Wolf <address@hidden>
> Signed-off-by: Corey Bryant <address@hidden>
> ---
>  block/raw-posix.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/block/raw-posix.c b/block/raw-posix.c
> index d8eff2f..68886cd 100644
> --- a/block/raw-posix.c
> +++ b/block/raw-posix.c
> @@ -946,9 +946,11 @@ static int floppy_probe_device(const char *filename)
>      int prio = 0;
>      struct floppy_struct fdparam;
>      struct stat st;
> +    const char *p;
>  
> -    if (strstart(filename, "/dev/fd", NULL))
> +    if (strstart(filename, "/dev/fd", &p) && p[0] != '/') {
>          prio = 50;
> +    }
>  
>      fd = qemu_open(filename, O_RDONLY | O_NONBLOCK);
>      if (fd < 0) {
> 

Reviewed-by: Paolo Bonzini <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]