From ea57890740237f1576d84e9506fc1586bd529498 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Mon, 18 Sep 2000 17:53:22 +0000 Subject: [PATCH] o Add missing PRISON_ROOT allowing a privileged process in a jail() to not remove the setuid/setgid bits by virtue of a change to a file with those bits set, even if the process doesn't own the file, or isn't a group member of the file's gid. Obtained from: TrustedBSD Project --- sys/ufs/ufs/ufs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index f355080613e..1ac7dd0b524 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -638,7 +638,7 @@ good: panic("ufs_chown: lost quota"); #endif /* QUOTA */ ip->i_flag |= IN_CHANGE; - if (suser_xxx(cred, NULL, 0) && (ouid != uid || ogid != gid)) + if (suser_xxx(cred, NULL, PRISON_ROOT) && (ouid != uid || ogid != gid)) ip->i_mode &= ~(ISUID | ISGID); return (0); }