From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfAHY-00069K-BG for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:40:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfAHW-0006by-HF for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:40:15 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:44135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfAHW-0006bH-9L for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:40:14 -0400 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Jun 2012 07:40:09 -0600 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 2A1E8C40001 for ; Thu, 14 Jun 2012 13:40:05 +0000 (WET) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5EDduRY194016 for ; Thu, 14 Jun 2012 07:39:57 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5EDdhEQ028678 for ; Thu, 14 Jun 2012 07:39:43 -0600 Message-ID: <4FD9E99D.9060702@linux.vnet.ibm.com> Date: Thu, 14 Jun 2012 09:39:41 -0400 From: Corey Bryant MIME-Version: 1.0 References: <1339597859-7755-1-git-send-email-root@localhost.localdomain> <4FD9ADC3.9040905@redhat.com> In-Reply-To: <4FD9ADC3.9040905@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block: Prevent /dev/fd/X filename from being detected as floppy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, root , aliguori@us.ibm.com, qemu-devel@nongnu.org On 06/14/2012 05:24 AM, Paolo Bonzini wrote: > Il 13/06/2012 16:30, root ha scritto: >> From: Corey Bryant >> >> Reported-by: Kevin Wolf >> Signed-off-by: Corey Bryant >> --- >> 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 > Thanks! -- Regards, Corey