mirror of https://github.com/FDOS/kernel.git
force r/o open for FCB and legacy creat if the file is read-only
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@726 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
9f2208943c
commit
3232712fae
|
@ -216,8 +216,10 @@ long dos_open(char *path, unsigned flags, unsigned attrib)
|
|||
}
|
||||
}
|
||||
|
||||
/* force r/o open for FCBs if the file is read-only */
|
||||
if ((flags & O_FCB) && (fnp->f_dir.dir_attrib & D_RDONLY))
|
||||
/* force r/o open for FCB and legacy creat if the file is read-only */
|
||||
if (((flags & O_FCB)
|
||||
|| (flags & (O_CREAT | O_LEGACY)) == (O_CREAT | O_LEGACY))
|
||||
&& (fnp->f_dir.dir_attrib & D_RDONLY))
|
||||
fnp->f_mode = O_RDONLY;
|
||||
|
||||
/* Check permissions. -- JPP */
|
||||
|
|
Loading…
Reference in New Issue