mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-27 07:44:09 +02:00
bug 1874 fix, do not consider setting DIR bit an error for int 21/4301=set attribute, if really is a directory
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1123 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
bd50aa5d40
commit
4dcdd071e5
@ -1953,8 +1953,13 @@ COUNT dos_setfattr(BYTE * name, UWORD attrp)
|
||||
COUNT fd;
|
||||
f_node_ptr fnp;
|
||||
|
||||
/* JPP-If user tries to set VOLID or DIR bits, return error */
|
||||
if ((attrp & (D_VOLID | D_DIR | 0xC0)) != 0)
|
||||
/* JPP-If user tries to set VOLID or RESERVED bits, return error.
|
||||
We used to also check for D_DIR here, but causes issues with deltree
|
||||
which is trying to work around another issue. So now we check
|
||||
these here, and only report DE_ACCESS if user tries to set directory
|
||||
bit on a non-directory entry.
|
||||
*/
|
||||
if ((attrp & (D_VOLID | 0xC0)) != 0)
|
||||
return DE_ACCESS;
|
||||
|
||||
fd = (short)dos_open(name, O_RDONLY | O_OPEN, 0);
|
||||
@ -1967,6 +1972,10 @@ COUNT dos_setfattr(BYTE * name, UWORD attrp)
|
||||
/* clear all attributes but DIR and VOLID */
|
||||
fnp->f_dir.dir_attrib &= (D_VOLID | D_DIR); /* JPP */
|
||||
|
||||
/* if caller tries to set DIR on non-directory, return error */
|
||||
if (!(fnp->f_dir.dir_attrib & D_DIR) && (attrp & D_DIR))
|
||||
return DE_ACCESS;
|
||||
|
||||
/* set attributes that user requested */
|
||||
fnp->f_dir.dir_attrib |= attrp; /* JPP */
|
||||
fnp->f_flags |= F_DMOD | F_DDATE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user