diff options
author | rwatson <rwatson@FreeBSD.org> | 2001-09-26 20:31:37 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2001-09-26 20:31:37 +0000 |
commit | 4e4d85b5d167e3a5f6e0e10c89fef588f6d10152 (patch) | |
tree | e904484d096e7b96e21b8e3dce10c2901e473706 /sys/ufs | |
parent | a8da1b45a247d2e0df5c1915877a966b8ec438ca (diff) | |
download | FreeBSD-src-4e4d85b5d167e3a5f6e0e10c89fef588f6d10152.zip FreeBSD-src-4e4d85b5d167e3a5f6e0e10c89fef588f6d10152.tar.gz |
o Modify ufs_setattr() so that it uses securelevel_gt() instead of
direct variable access.
Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index c47d0f6..ae63a4e 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -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) || |