Page MenuHomeFreeBSD

D10422.id27526.diff
No OneTemporary

D10422.id27526.diff

Index: sys/boot/common/md.c
===================================================================
--- sys/boot/common/md.c
+++ sys/boot/common/md.c
@@ -106,7 +106,7 @@
if (rsize != NULL)
*rsize = size;
- switch (rw) {
+ switch (rw & F_MASK) {
case F_READ:
bcopy(md_image.start + ofs, buf, size);
return (0);
Index: sys/boot/efi/libefi/efipart.c
===================================================================
--- sys/boot/efi/libefi/efipart.c
+++ sys/boot/efi/libefi/efipart.c
@@ -819,7 +819,7 @@
if ((blk + nblks - 1) > blkio->Media->LastBlock)
return (EIO);
- switch (rw) {
+ switch (rw & F_MASK) {
case F_READ:
status = blkio->ReadBlocks(blkio, blkio->Media->MediaId, blk,
nblks * blkio->Media->BlockSize, buf);
Index: sys/boot/i386/libi386/bioscd.c
===================================================================
--- sys/boot/i386/libi386/bioscd.c
+++ sys/boot/i386/libi386/bioscd.c
@@ -268,7 +268,7 @@
return (EINVAL);
#endif
- if (rw != F_READ)
+ if ((rw & F_MASK) != F_READ)
return(EROFS);
dev = (struct i386_devdesc *)devdata;
unit = dev->d_unit;
Index: sys/boot/i386/libi386/biosdisk.c
===================================================================
--- sys/boot/i386/libi386/biosdisk.c
+++ sys/boot/i386/libi386/biosdisk.c
@@ -618,7 +618,7 @@
DEBUG("short read %d", blks);
}
- switch(rw){
+ switch (rw & F_MASK) {
case F_READ:
DEBUG("read %d from %lld to %p", blks, dblk, buf);
Index: sys/boot/mips/beri/loader/beri_disk_cfi.c
===================================================================
--- sys/boot/mips/beri/loader/beri_disk_cfi.c
+++ sys/boot/mips/beri/loader/beri_disk_cfi.c
@@ -73,6 +73,7 @@
{
int error;
+ flag &= F_MASK;
if (flag == F_WRITE)
return (EROFS);
if (flag != F_READ)
Index: sys/boot/mips/beri/loader/beri_disk_sdcard.c
===================================================================
--- sys/boot/mips/beri/loader/beri_disk_sdcard.c
+++ sys/boot/mips/beri/loader/beri_disk_sdcard.c
@@ -73,6 +73,7 @@
{
int error;
+ flag &= F_MASK;
if (flag == F_WRITE)
return (EROFS);
if (flag != F_READ)
Index: sys/boot/powerpc/ps3/ps3cdrom.c
===================================================================
--- sys/boot/powerpc/ps3/ps3cdrom.c
+++ sys/boot/powerpc/ps3/ps3cdrom.c
@@ -83,6 +83,7 @@
DEBUG("d_unit=%u dblk=%llu size=%u", dev->d_unit, dblk, size);
+ flag &= F_MASK;
if (flag != F_READ) {
dev_printf(dev, "write operation is not supported!");
return EROFS;
Index: sys/boot/powerpc/ps3/ps3disk.c
===================================================================
--- sys/boot/powerpc/ps3/ps3disk.c
+++ sys/boot/powerpc/ps3/ps3disk.c
@@ -115,6 +115,7 @@
struct open_dev *od = (struct open_dev *) dev->d_disk.data;
int err;
+ flag &= F_MASK;
if (flag != F_READ) {
dev_printf(dev, "write operation is not supported!\n");
return EROFS;
Index: sys/boot/uboot/lib/disk.c
===================================================================
--- sys/boot/uboot/lib/disk.c
+++ sys/boot/uboot/lib/disk.c
@@ -149,6 +149,7 @@
daddr_t bcount;
int err;
+ rw &= F_MASK;
if (rw != F_READ) {
stor_printf("write attempt, operation not supported!\n");
return (EROFS);
Index: sys/boot/usb/storage/umass_loader.c
===================================================================
--- sys/boot/usb/storage/umass_loader.c
+++ sys/boot/usb/storage/umass_loader.c
@@ -92,6 +92,7 @@
if (rsizep != NULL)
*rsizep = 0;
+ flag &= F_MASK;
if (flag == F_WRITE) {
if (usb_msc_write_10(umass_uaa.device, 0, dblk, size >> 9, buf) != 0)
return (EINVAL);
Index: sys/boot/userboot/userboot/userboot_disk.c
===================================================================
--- sys/boot/userboot/userboot/userboot_disk.c
+++ sys/boot/userboot/userboot/userboot_disk.c
@@ -211,6 +211,7 @@
size_t resid;
int rc;
+ rw &= F_MASK;
if (rw == F_WRITE)
return (EROFS);
if (rw != F_READ)

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 15, 1:49 PM (11 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31542024
Default Alt Text
D10422.id27526.diff (3 KB)

Event Timeline