From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfASz-000105-UB for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:52:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfASt-0001Sf-Cc for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:52:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfASt-0001SA-4a for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:51:59 -0400 Message-ID: <4FD9EC79.8090905@redhat.com> Date: Thu, 14 Jun 2012 15:51:53 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1339597859-7755-1-git-send-email-root@localhost.localdomain> <4FD9ADC3.9040905@redhat.com> <4FD9E99D.9060702@linux.vnet.ibm.com> In-Reply-To: <4FD9E99D.9060702@linux.vnet.ibm.com> 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: Corey Bryant Cc: Paolo Bonzini , aliguori@us.ibm.com, qemu-devel@nongnu.org Am 14.06.2012 15:39, schrieb Corey Bryant: > > > 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! I tried to apply this earlier today, but it depends on the other patch series, so I couldn't. Can you just include it as patch 5 when you send the next version? Oh, and you'll probably want to fix your mailing setup to put into From: something different than root@localhost.localdomain... Kevin