fs/vfs: fix st_mode mask check
The full mask for st_mode is 0177777 Now modify any file permissions in hostfs and all will fail
This commit is contained in:
parent
8d66dbc068
commit
4b6743591a
|
@ -118,7 +118,7 @@ static int chstat(FAR const char *path,
|
|||
|
||||
/* Adjust and check buf and flags */
|
||||
|
||||
if ((flags & CH_STAT_MODE) && (buf->st_mode & ~07777))
|
||||
if ((flags & CH_STAT_MODE) && (buf->st_mode & ~0177777))
|
||||
{
|
||||
goto errout;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ int file_fchstat(FAR struct file *filep, FAR struct stat *buf, int flags)
|
|||
|
||||
/* Adjust and check buf and flags */
|
||||
|
||||
if ((flags & CH_STAT_MODE) && (buf->st_mode & ~07777))
|
||||
if ((flags & CH_STAT_MODE) && (buf->st_mode & ~0177777))
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue