From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf6I2-0007GB-0M for qemu-devel@nongnu.org; Thu, 14 Jun 2012 05:24:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sf6Hv-00053W-OT for qemu-devel@nongnu.org; Thu, 14 Jun 2012 05:24:29 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:51491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf6Hv-00053F-9a for qemu-devel@nongnu.org; Thu, 14 Jun 2012 05:24:23 -0400 Received: by werf3 with SMTP id f3so1257660wer.4 for ; Thu, 14 Jun 2012 02:24:21 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4FD9ADC3.9040905@redhat.com> Date: Thu, 14 Jun 2012 11:24:19 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1339597859-7755-1-git-send-email-root@localhost.localdomain> In-Reply-To: <1339597859-7755-1-git-send-email-root@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-15 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: root Cc: kwolf@redhat.com, aliguori@us.ibm.com, Corey Bryant , qemu-devel@nongnu.org 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