summaryrefslogtreecommitdiffstats
path: root/sys/gnu
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2004-07-26 07:24:04 +0000
committercperciva <cperciva@FreeBSD.org>2004-07-26 07:24:04 +0000
commitd9fecc83c80e01cb4e66d1fd0a02e96b1fcbcbc5 (patch)
treee24e86995427678a1313e8f62cc17f84bdcaf82b /sys/gnu
parent5997e4b6ce7d492b2ccb725239af23a268509c09 (diff)
downloadFreeBSD-src-d9fecc83c80e01cb4e66d1fd0a02e96b1fcbcbc5.zip
FreeBSD-src-d9fecc83c80e01cb4e66d1fd0a02e96b1fcbcbc5.tar.gz
Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This is
somewhat clearer, but more importantly allows for a consistent naming scheme for suser_cred flags. The old name is still defined, but will be removed in a few days (unless I hear any complaints...) Discussed with: rwatson, scottl Requested by: jhb
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/ext2fs/ext2_vnops.c10
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vnops.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c
index 192d510..3964632 100644
--- a/sys/gnu/ext2fs/ext2_vnops.c
+++ b/sys/gnu/ext2fs/ext2_vnops.c
@@ -480,7 +480,7 @@ ext2_setattr(ap)
* Privileged non-jail processes may not modify system flags
* if securelevel > 0 and any existing system flags are set.
*/
- if (!suser_cred(cred, PRISON_ROOT)) {
+ if (!suser_cred(cred, SUSER_ALLOWJAIL)) {
if (ip->i_flags
& (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) {
error = securelevel_gt(cred, 0);
@@ -599,7 +599,7 @@ ext2_chmod(vp, mode, cred, td)
* as well as set the setgid bit on a file with a group that the
* process is not a member of.
*/
- if (suser_cred(cred, PRISON_ROOT)) {
+ if (suser_cred(cred, SUSER_ALLOWJAIL)) {
if (vp->v_type != VDIR && (mode & S_ISTXT))
return (EFTYPE);
if (!groupmember(ip->i_gid, cred) && (mode & ISGID))
@@ -645,14 +645,14 @@ ext2_chown(vp, uid, gid, cred, td)
*/
if ((uid != ip->i_uid ||
(gid != ip->i_gid && !groupmember(gid, cred))) &&
- (error = suser_cred(cred, PRISON_ROOT)))
+ (error = suser_cred(cred, SUSER_ALLOWJAIL)))
return (error);
ogid = ip->i_gid;
ouid = ip->i_uid;
ip->i_gid = gid;
ip->i_uid = uid;
ip->i_flag |= IN_CHANGE;
- if (suser_cred(cred, PRISON_ROOT) && (ouid != uid || ogid != gid))
+ if (suser_cred(cred, SUSER_ALLOWJAIL) && (ouid != uid || ogid != gid))
ip->i_mode &= ~(ISUID | ISGID);
return (0);
}
@@ -1829,7 +1829,7 @@ ext2_makeinode(mode, dvp, vpp, cnp)
tvp->v_type = IFTOVT(mode); /* Rest init'd in getnewvnode(). */
ip->i_nlink = 1;
if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) &&
- suser_cred(cnp->cn_cred, PRISON_ROOT))
+ suser_cred(cnp->cn_cred, SUSER_ALLOWJAIL))
ip->i_mode &= ~ISGID;
if (cnp->cn_flags & ISWHITEOUT)
diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c
index 192d510..3964632 100644
--- a/sys/gnu/fs/ext2fs/ext2_vnops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vnops.c
@@ -480,7 +480,7 @@ ext2_setattr(ap)
* Privileged non-jail processes may not modify system flags
* if securelevel > 0 and any existing system flags are set.
*/
- if (!suser_cred(cred, PRISON_ROOT)) {
+ if (!suser_cred(cred, SUSER_ALLOWJAIL)) {
if (ip->i_flags
& (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) {
error = securelevel_gt(cred, 0);
@@ -599,7 +599,7 @@ ext2_chmod(vp, mode, cred, td)
* as well as set the setgid bit on a file with a group that the
* process is not a member of.
*/
- if (suser_cred(cred, PRISON_ROOT)) {
+ if (suser_cred(cred, SUSER_ALLOWJAIL)) {
if (vp->v_type != VDIR && (mode & S_ISTXT))
return (EFTYPE);
if (!groupmember(ip->i_gid, cred) && (mode & ISGID))
@@ -645,14 +645,14 @@ ext2_chown(vp, uid, gid, cred, td)
*/
if ((uid != ip->i_uid ||
(gid != ip->i_gid && !groupmember(gid, cred))) &&
- (error = suser_cred(cred, PRISON_ROOT)))
+ (error = suser_cred(cred, SUSER_ALLOWJAIL)))
return (error);
ogid = ip->i_gid;
ouid = ip->i_uid;
ip->i_gid = gid;
ip->i_uid = uid;
ip->i_flag |= IN_CHANGE;
- if (suser_cred(cred, PRISON_ROOT) && (ouid != uid || ogid != gid))
+ if (suser_cred(cred, SUSER_ALLOWJAIL) && (ouid != uid || ogid != gid))
ip->i_mode &= ~(ISUID | ISGID);
return (0);
}
@@ -1829,7 +1829,7 @@ ext2_makeinode(mode, dvp, vpp, cnp)
tvp->v_type = IFTOVT(mode); /* Rest init'd in getnewvnode(). */
ip->i_nlink = 1;
if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) &&
- suser_cred(cnp->cn_cred, PRISON_ROOT))
+ suser_cred(cnp->cn_cred, SUSER_ALLOWJAIL))
ip->i_mode &= ~ISGID;
if (cnp->cn_flags & ISWHITEOUT)
OpenPOWER on IntegriCloud