Index: sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h =================================================================== --- sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h (revision 182729) +++ sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h (working copy) @@ -489,7 +489,7 @@ * 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 *); Index: sys/kern/kern_exec.c =================================================================== --- sys/kern/kern_exec.c (revision 182729) +++ sys/kern/kern_exec.c (working copy) @@ -62,6 +62,7 @@ #include #include #include +#include #ifdef KTRACE #include #endif @@ -622,9 +623,9 @@ */ 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 @@ * 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) { Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (revision 182729) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (working copy) @@ -1191,8 +1191,8 @@ 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') { /* Index: sys/security/mac_bsdextended/mac_bsdextended.c =================================================================== --- sys/security/mac_bsdextended/mac_bsdextended.c (revision 182729) +++ sys/security/mac_bsdextended/mac_bsdextended.c (working copy) @@ -61,6 +61,7 @@ #include #include #include +#include #include #include @@ -303,7 +304,7 @@ } 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 @@ } 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) Index: sys/sys/vnode.h =================================================================== --- sys/sys/vnode.h (revision 182729) +++ sys/sys/vnode.h (working copy) @@ -314,9 +314,6 @@ #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 */