mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
The functions that set and delete external attributes must check
that the filesystem is not mounted read-only before proceeding. Reported by: Ryan Beasley <ryanb@FreeBSD.org> MFC after: 1 week
This commit is contained in:
parent
2483dd1389
commit
6e6b7d44ef
1 changed files with 9 additions and 0 deletions
|
|
@ -1358,6 +1358,9 @@ struct vop_closeextattr_args {
|
|||
if (ap->a_vp->v_type == VCHR)
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
if (ap->a_commit && (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY))
|
||||
return (EROFS);
|
||||
|
||||
return (ffs_close_ea(ap->a_vp, ap->a_commit, ap->a_cred, ap->a_td));
|
||||
}
|
||||
|
||||
|
|
@ -1392,6 +1395,9 @@ vop_deleteextattr {
|
|||
if (strlen(ap->a_name) == 0)
|
||||
return (EINVAL);
|
||||
|
||||
if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY)
|
||||
return (EROFS);
|
||||
|
||||
error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace,
|
||||
ap->a_cred, ap->a_td, IWRITE);
|
||||
if (error) {
|
||||
|
|
@ -1613,6 +1619,9 @@ vop_setextattr {
|
|||
if (ap->a_uio == NULL)
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY)
|
||||
return (EROFS);
|
||||
|
||||
error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace,
|
||||
ap->a_cred, ap->a_td, IWRITE);
|
||||
if (error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue