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
This commit is contained in:
Robert Watson 2000-09-18 17:53:22 +00:00
parent cd595ef506
commit ea57890740
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66038

View File

@ -638,7 +638,7 @@ ufs_chown(vp, uid, gid, cred, p)
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);
}