o Modify ufs_setattr() so that it uses securelevel_gt() instead of
direct variable access. Obtained from: TrustedBSD Project
This commit is contained in:
parent
8c5d4fe829
commit
6748bcc51e
@ -488,10 +488,12 @@ ufs_setattr(ap)
|
||||
* if securelevel > 0 and any existing system flags are set.
|
||||
*/
|
||||
if (!suser_xxx(cred, NULL, 0)) {
|
||||
if ((ip->i_flags
|
||||
& (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) &&
|
||||
securelevel > 0)
|
||||
return (EPERM);
|
||||
if (ip->i_flags
|
||||
& (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) {
|
||||
error = securelevel_gt(cred, 0);
|
||||
if (error)
|
||||
return (error);
|
||||
}
|
||||
/* Snapshot flag cannot be set or cleared */
|
||||
if (((vap->va_flags & SF_SNAPSHOT) != 0 &&
|
||||
(ip->i_flags & SF_SNAPSHOT) == 0) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user