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:
Bart Oldeman 2003-11-16 16:21:29 +00:00
parent 9f2208943c
commit 3232712fae
1 changed files with 4 additions and 2 deletions

View File

@ -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 */