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:
rwatson 2000-09-18 17:53:22 +00:00
parent 1c37bf6427
commit f193def48e

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);
}