mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
Prefer the vop_rmextattr() vnode operation for removing extended
attributes from objects over vop_setextattr() with a NULL uio; if the file system doesn't support the vop_rmextattr() method, fall back to the vop_setextattr() method. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
This commit is contained in:
parent
77533ed2aa
commit
6b42f0a2eb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116699
@ -4245,8 +4245,10 @@ extattr_delete_vp(struct vnode *vp, int attrnamespace, const char *attrname,
|
||||
goto done;
|
||||
#endif
|
||||
|
||||
error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL, td->td_ucred,
|
||||
td);
|
||||
error = VOP_RMEXTATTR(vp, attrnamespace, attrname, td->td_ucred, td);
|
||||
if (error == EOPNOTSUPP)
|
||||
error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL,
|
||||
td->td_ucred, td);
|
||||
#ifdef MAC
|
||||
done:
|
||||
#endif
|
||||
|
@ -4245,8 +4245,10 @@ extattr_delete_vp(struct vnode *vp, int attrnamespace, const char *attrname,
|
||||
goto done;
|
||||
#endif
|
||||
|
||||
error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL, td->td_ucred,
|
||||
td);
|
||||
error = VOP_RMEXTATTR(vp, attrnamespace, attrname, td->td_ucred, td);
|
||||
if (error == EOPNOTSUPP)
|
||||
error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL,
|
||||
td->td_ucred, td);
|
||||
#ifdef MAC
|
||||
done:
|
||||
#endif
|
||||
|
@ -1150,7 +1150,10 @@ vn_extattr_rm(struct vnode *vp, int ioflg, int attrnamespace,
|
||||
}
|
||||
|
||||
/* authorize attribute removal as kernel */
|
||||
error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL, NULL, td);
|
||||
error = VOP_RMEXTATTR(vp, attrnamespace, attrname, NULL, td);
|
||||
if (error == EOPNOTSUPP)
|
||||
error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL,
|
||||
NULL, td);
|
||||
|
||||
if ((ioflg & IO_NODELOCKED) == 0) {
|
||||
vn_finished_write(mp);
|
||||
|
Loading…
Reference in New Issue
Block a user