Moved open-ATAPI-as-RW check to before open-first-time check.. otherwise
you can open an ATAPI device as RW if it's already opened for read.
This commit is contained in:
parent
c1dd29ba0c
commit
f3500010b7
@ -364,6 +364,14 @@ message *m_ptr;
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLE_ATAPI
|
||||||
|
if ((wn->state & ATAPI) && (m_ptr->COUNT & W_BIT))
|
||||||
|
return(EACCES);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* If it's not an ATAPI device, then don't open with RO_BIT. */
|
||||||
|
if (!(wn->state & ATAPI) && (m_ptr->COUNT & RO_BIT)) return EACCES;
|
||||||
|
|
||||||
/* Partition the drive if it's being opened for the first time,
|
/* Partition the drive if it's being opened for the first time,
|
||||||
* or being opened after being closed.
|
* or being opened after being closed.
|
||||||
*/
|
*/
|
||||||
@ -371,13 +379,9 @@ message *m_ptr;
|
|||||||
#if ENABLE_ATAPI
|
#if ENABLE_ATAPI
|
||||||
if (wn->state & ATAPI) {
|
if (wn->state & ATAPI) {
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (m_ptr->COUNT & W_BIT) return(EACCES);
|
|
||||||
if ((r = atapi_open()) != OK) return(r);
|
if ((r = atapi_open()) != OK) return(r);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* If it's not an ATAPI device, then don't open read-only. */
|
|
||||||
if (!(wn->state & ATAPI) && (m_ptr->COUNT & RO_BIT)) return EACCES;
|
|
||||||
|
|
||||||
/* Partition the disk. */
|
/* Partition the disk. */
|
||||||
partition(&w_dtab, w_drive * DEV_PER_DRIVE, P_PRIMARY, wn->state & ATAPI);
|
partition(&w_dtab, w_drive * DEV_PER_DRIVE, P_PRIMARY, wn->state & ATAPI);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user