summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ufs
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2000-02-22 03:56:58 +0000
committerrwatson <rwatson@FreeBSD.org>2000-02-22 03:56:58 +0000
commitbaa4395a04d543bb6c3846a0a0de707ce14601af (patch)
treec02469ef53f4acd00337f5823c2190f74dd93fd1 /sys/ufs/ufs
parent0cb88de5b643347b8bbdea698762f0e9cf877e39 (diff)
downloadFreeBSD-src-baa4395a04d543bb6c3846a0a0de707ce14601af.zip
FreeBSD-src-baa4395a04d543bb6c3846a0a0de707ce14601af.tar.gz
After much consulting with bde, concluded that this fix was the best fix
to the current jail/chflags interactions. This fix conditionalizes ``root behavior'' in the chflags() case on not being in jail, so attempts to perform a chflags in a jail are limited to what a normal user could do. For example, this does allow setting of user flags as appropriate, but prohibits changing of system flags. Reviewed by: bde
Diffstat (limited to 'sys/ufs/ufs')
-rw-r--r--sys/ufs/ufs/ufs_vnops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 5696895..c3f6018 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -444,9 +444,9 @@ ufs_setattr(ap)
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
if (cred->cr_uid != ip->i_uid &&
- (error = suser(p)))
+ (error = suser_xxx(cred, p, PRISON_ROOT)))
return (error);
- if (cred->cr_uid == 0) {
+ if ((cred->cr_uid == 0) && (p->p_prison == NULL)) {
if ((ip->i_flags
& (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) &&
securelevel > 0)
OpenPOWER on IntegriCloud