block: Prevent /dev/fd/X filename from being detected as floppy
PATCH 1/1 block: Prevent /dev/fd/X filename from being detected as floppy
From: Corey Bryant <[email protected]>
--- block/raw-posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
block/raw-posix.c +3 -1
@@ -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 ) {
Signature · 1 line
1.7.10.2
Il 13/06/2012 16:30, root ha scritto:
Quoted 16 lines
From: Corey Bryant <[email protected]>
Reported-by Kevin Wolf <[email protected]>Signed-off-by Corey Bryant <[email protected]>--- block/raw-posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)block/raw-posix.c +0
-0@@ -946,9 +946,11 @@ static int floppy_probe_device(const char *filename)int prio =0 ;struct floppy_struct fdparam;
block/raw-posix.c static int floppy_probe_device(const char *filename) · line 956
Quoted 10 lines
block/raw-posix.c +3
-1struct 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 ) {
Quoted 24 lines · Paolo Bonzini
Il 13/06/2012 16:30, root ha scritto:
Quoted 23 lines
From: Corey Bryant <[email protected]>
Reported-by Kevin Wolf <[email protected]>Signed-off-by Corey Bryant <[email protected]>--- block/raw-posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)block/raw-posix.c +3
-1@@ -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 ; + }
Quoted 6 lines
block/raw-posix.c static int floppy_probe_device(const char *filename) · line 956
Quoted 3 lines
block/raw-posix.c +0
-0fd =qemu_open (filename,O_RDONLY |O_NONBLOCK );if (fd <0 ) {Reviewed-by Paolo Bonzini <[email protected]>
Thanks!
Signature · 2 lines
Regards, Corey
Am 14.06.2012 15:39, schrieb Corey Bryant:
Quoted 27 lines · Paolo Bonzini
Quoted 24 lines
Il 13/06/2012 16:30, root ha scritto:
Quoted 23 lines
From: Corey Bryant <[email protected]>
Reported-by Kevin Wolf <[email protected]>Signed-off-by Corey Bryant <[email protected]>--- block/raw-posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)block/raw-posix.c +3
-1@@ -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 ; + }
Quoted 8 lines
Quoted 6 lines
block/raw-posix.c static int floppy_probe_device(const char *filename) · line 956
Quoted 3 lines
block/raw-posix.c +0
-0fd =qemu_open (filename,O_RDONLY |O_NONBLOCK );if (fd <0 ) {Reviewed-by Paolo Bonzini <[email protected]>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 [email protected]...
Kevin
Quoted 35 lines · Kevin Wolf
Am 14.06.2012 15:39, schrieb Corey Bryant:
Quoted 34 lines · Paolo Bonzini
Quoted 30 lines
Il 13/06/2012 16:30, root ha scritto:
Quoted 16 lines
From: Corey Bryant <[email protected]>
Reported-by Kevin Wolf <[email protected]>Signed-off-by Corey Bryant <[email protected]>--- block/raw-posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)block/raw-posix.c +0
-0@@ -946,9 +946,11 @@ static int floppy_probe_device(const char *filename)int prio =0 ;struct floppy_struct fdparam;block/raw-posix.c static int floppy_probe_device(const char *filename) · line 956
Quoted 10 lines
block/raw-posix.c +3
-1struct 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 <[email protected]>
Quoted 5 lines
Quoted 1 line
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?
Ok sure I'll do that.
Quoted 3 lines
Oh, and you'll probably want to fix your mailing setup to put into From:
something different than [email protected]...
Ugh.. I'm sorry about that.
Quoted 3 lines
Kevin
Signature · 2 lines
Regards, Corey