diff options
author | trasz <trasz@FreeBSD.org> | 2008-09-10 13:16:41 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2008-09-10 13:16:41 +0000 |
commit | 9303940ffeb9f2f1fa70ff3cd8ea2c8fbabda10b (patch) | |
tree | ed7bf9cb2d91f45bd6197c9711c035069d33b3df | |
parent | 11fabd36c2894e56ba1ac22dce018446ffe1e7c5 (diff) | |
download | FreeBSD-src-9303940ffeb9f2f1fa70ff3cd8ea2c8fbabda10b.zip FreeBSD-src-9303940ffeb9f2f1fa70ff3cd8ea2c8fbabda10b.tar.gz |
Remove VSVTX, VSGID and VSUID. This should be a no-op,
as VSVTX == S_ISVTX, VSGID == S_ISGID and VSUID == S_ISUID.
Approved by: rwatson (mentor)
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 4 | ||||
-rw-r--r-- | sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h | 2 | ||||
-rw-r--r-- | sys/kern/kern_exec.c | 9 | ||||
-rw-r--r-- | sys/security/mac_bsdextended/mac_bsdextended.c | 5 | ||||
-rw-r--r-- | sys/sys/param.h | 2 | ||||
-rw-r--r-- | sys/sys/vnode.h | 3 |
6 files changed, 12 insertions, 13 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index bb02a27..7fd9a81 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -1191,8 +1191,8 @@ zfs_create(vnode_t *dvp, char *name, vattr_t *vap, int excl, int mode, top: *vpp = NULL; - if ((vap->va_mode & VSVTX) && secpolicy_vnode_stky_modify(cr)) - vap->va_mode &= ~VSVTX; + if ((vap->va_mode & S_ISVTX) && secpolicy_vnode_stky_modify(cr)) + vap->va_mode &= ~S_ISVTX; if (*name == '\0') { /* diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h b/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h index b173442..c4483ea 100644 --- a/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h +++ b/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h @@ -489,7 +489,7 @@ typedef struct xfs_vattr { * Check whether mandatory file locking is enabled. */ #define MANDLOCK(vp, mode) \ - ((vp)->v_vnode->v_type == VREG && ((mode) & (VSGID|(VEXEC>>3))) == VSGID) + ((vp)->v_vnode->v_type == VREG && ((mode) & (S_ISGID|(VEXEC>>3))) == S_ISGID) extern void vn_init(void); extern int vn_wait(struct xfs_vnode *); diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index ab972f1..9ca2f96 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include <sys/shm.h> #include <sys/sysctl.h> #include <sys/vnode.h> +#include <sys/stat.h> #ifdef KTRACE #include <sys/ktrace.h> #endif @@ -622,9 +623,9 @@ interpret: */ oldcred = p->p_ucred; credential_changing = 0; - credential_changing |= (attr.va_mode & VSUID) && oldcred->cr_uid != + credential_changing |= (attr.va_mode & S_ISUID) && oldcred->cr_uid != attr.va_uid; - credential_changing |= (attr.va_mode & VSGID) && oldcred->cr_gid != + credential_changing |= (attr.va_mode & S_ISGID) && oldcred->cr_gid != attr.va_gid; #ifdef MAC will_transition = mac_vnode_execve_will_transition(oldcred, imgp->vp, @@ -675,9 +676,9 @@ interpret: * Set the new credentials. */ crcopy(newcred, oldcred); - if (attr.va_mode & VSUID) + if (attr.va_mode & S_ISUID) change_euid(newcred, euip); - if (attr.va_mode & VSGID) + if (attr.va_mode & S_ISGID) change_egid(newcred, attr.va_gid); #ifdef MAC if (will_transition) { diff --git a/sys/security/mac_bsdextended/mac_bsdextended.c b/sys/security/mac_bsdextended/mac_bsdextended.c index b55056c..cb993db 100644 --- a/sys/security/mac_bsdextended/mac_bsdextended.c +++ b/sys/security/mac_bsdextended/mac_bsdextended.c @@ -61,6 +61,7 @@ #include <sys/vnode.h> #include <sys/sysctl.h> #include <sys/syslog.h> +#include <sys/stat.h> #include <security/mac/mac_policy.h> #include <security/mac_bsdextended/mac_bsdextended.h> @@ -303,7 +304,7 @@ ugidfw_rulecheck(struct mac_bsdextended_rule *rule, } if (rule->mbr_object.mbo_flags & MBO_SUID) { - match = (vap->va_mode & VSUID); + match = (vap->va_mode & S_ISUID); if (rule->mbr_object.mbo_neg & MBO_SUID) match = !match; if (!match) @@ -311,7 +312,7 @@ ugidfw_rulecheck(struct mac_bsdextended_rule *rule, } if (rule->mbr_object.mbo_flags & MBO_SGID) { - match = (vap->va_mode & VSGID); + match = (vap->va_mode & S_ISGID); if (rule->mbr_object.mbo_neg & MBO_SGID) match = !match; if (!match) diff --git a/sys/sys/param.h b/sys/sys/param.h index 4b1062b..b211274 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800046 /* Master, propagated to newvers */ +#define __FreeBSD_version 800047 /* Master, propagated to newvers */ #ifndef LOCORE #include <sys/types.h> diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index b523bf5..990b5df 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -314,9 +314,6 @@ struct vattr { #define VEXEC 000100 /* execute/search permission */ #define VWRITE 000200 /* write permission */ #define VREAD 000400 /* read permission */ -#define VSVTX 001000 /* save swapped text even after use */ -#define VSGID 002000 /* set group id on execution */ -#define VSUID 004000 /* set user id on execution */ #define VADMIN 010000 /* permission to administer */ #define VSTAT 020000 /* permission to retrieve attrs */ #define VAPPEND 040000 /* permission to write/append */ |