summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2000-09-18 18:03:49 +0000
committerrwatson <rwatson@FreeBSD.org>2000-09-18 18:03:49 +0000
commit3546d27e15a39f4124334ef712228133bb974bb8 (patch)
tree752de379b6b12ee2b5415fbbd3fcb3a3713a761b /sys/ufs
parentb324dcbd3d4209d0d74487538081082dbf904bed (diff)
downloadFreeBSD-src-3546d27e15a39f4124334ef712228133bb974bb8.zip
FreeBSD-src-3546d27e15a39f4124334ef712228133bb974bb8.tar.gz
o Allow privileged processes in jail() to override sticky bit behavior
on directories. o Allow privileged processes in jail() to create inodes with the setgid bit set even if they are not a member of the group denoted by the file creation gid. This occurs due to inherited gid's from parent directories on file creation, allowing a user to create a file with a gid that is not in the creating process's credentials. Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/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 c214b4c..2b34d3c 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1099,7 +1099,7 @@ abortit:
* root). This implements append-only directories.
*/
if ((dp->i_mode & S_ISTXT) &&
- suser_xxx(tcnp->cn_cred, NULL, 0) &&
+ suser_xxx(tcnp->cn_cred, NULL, PRISON_ROOT) &&
tcnp->cn_cred->cr_uid != dp->i_uid &&
xp->i_uid != tcnp->cn_cred->cr_uid) {
error = EPERM;
@@ -2128,7 +2128,7 @@ ufs_makeinode(mode, dvp, vpp, cnp)
if (DOINGSOFTDEP(tvp))
softdep_change_linkcnt(ip);
if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) &&
- suser_xxx(cnp->cn_cred, 0, 0))
+ suser_xxx(cnp->cn_cred, NULL, PRISON_ROOT))
ip->i_mode &= ~ISGID;
if (cnp->cn_flags & ISWHITEOUT)
OpenPOWER on IntegriCloud