[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 5/7] block: Prevent /dev/fd/X filename from being
From: |
Corey Bryant |
Subject: |
[Qemu-devel] [PATCH v4 5/7] block: Prevent /dev/fd/X filename from being detected as floppy |
Date: |
Fri, 22 Jun 2012 14:36:12 -0400 |
Reported-by: Kevin Wolf <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Corey Bryant <address@hidden>
---
v3:
-This patch is new in v3. It was previously submitted on its
own, and is now being included in this series.
v4
-Moved patch to be earlier in series (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 03fcfcc..0d9be0b 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 = open(filename, O_RDONLY | O_NONBLOCK);
if (fd < 0) {
--
1.7.10.2
- Re: [Qemu-devel] [PATCH v4 1/7] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg, (continued)
[Qemu-devel] [PATCH v4 7/7] osdep: Enable qemu_open to dup pre-opened fd, Corey Bryant, 2012/06/22
[Qemu-devel] [PATCH v4 5/7] block: Prevent /dev/fd/X filename from being detected as floppy,
Corey Bryant <=
[Qemu-devel] [PATCH v4 4/7] qapi: Re-arrange monitor.c functions, Corey Bryant, 2012/06/22
[Qemu-devel] [PATCH v4 6/7] block: Convert open calls to qemu_open, Corey Bryant, 2012/06/22
[Qemu-devel] [PATCH v4 3/7] qapi: Add pass-fd QMP command, Corey Bryant, 2012/06/22