• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.5.8/xnu-1228.15.4/bsd/vfs/

Lines Matching defs:vap

4457  *		vap			Pointer to the vnode_attr structure
4470 * *vap May be modified by the underlying VFS.
4477 * Notes: The kauth_filesec_t in 'vap', if any, is in host byte order.
4479 * Modification of '*cnp' and '*vap' by the underlying VFS is
4488 vn_create(vnode_t dvp, vnode_t *vpp, struct componentname *cnp, struct vnode_attr *vap, int flags, vfs_context_t ctx)
4506 if (VATTR_IS_ACTIVE(vap, va_acl)) {
4508 oacl = vap->va_acl;
4511 vap->va_acl = NULL;
4515 vap->va_type == VDIR,
4526 VATTR_CLEAR_ACTIVE(vap, va_acl);
4528 VATTR_SET(vap, va_acl, nacl);
4537 if ((error = vnode_authattr_new(dvp, vap, flags & VN_CREATE_NOAUTH, ctx)) != 0) {
4546 switch(vap->va_type) {
4548 error = VNOP_CREATE(dvp, vpp, cnp, vap, ctx);
4551 error = VNOP_MKDIR(dvp, vpp, cnp, vap, ctx);
4557 error = VNOP_MKNOD(dvp, vpp, cnp, vap, ctx);
4560 panic("vnode_create: unknown vtype %d", vap->va_type);
4581 if (!VATTR_ALL_SUPPORTED(vap) && *vpp) {
4582 KAUTH_DEBUG(" CREATE - doing fallback with ACL %p", vap->va_acl);
4583 error = vnode_setattr_fallback(*vpp, vap, ctx);
4595 * If the caller supplied a filesec in vap, it has been replaced
4600 VATTR_SET(vap, va_acl, oacl);
4602 VATTR_CLEAR_ACTIVE(vap, va_acl);
4618 struct vnode_attr *vap;
4688 vnode_immutable(struct vnode_attr *vap, int append, int ignore)
4709 KAUTH_DEBUG("IMMUTABLE - file flags 0x%x mask 0x%x append = %d ignore = %d", vap->va_flags, mask, append, ignore);
4710 if ((vap->va_flags & mask) != 0)
4716 vauth_node_owner(struct vnode_attr *vap, kauth_cred_t cred)
4726 if (vap && VATTR_IS_SUPPORTED(vap, va_uid)) {
4727 result = (vap->va_uid == kauth_cred_getuid(cred)) ? 1 : 0;
4735 vauth_node_group(struct vnode_attr *vap, kauth_cred_t cred, int *ismember)
4744 if (vap && VATTR_IS_SUPPORTED(vap, va_gid)) {
4745 error = kauth_cred_ismember_gid(cred, vap->va_gid, &result);
4762 result = vauth_node_owner(vcp->vap, vcp->ctx->vc_ucred);
4784 error = vauth_node_group(vcp->vap, vcp->ctx->vc_ucred, ismember);
4846 * Test the posix permissions in (vap) to determine whether (credential)
4852 struct vnode_attr *vap;
4863 vap = vcp->dvap;
4865 vap = vcp->vap;
4884 owner_ok = (needed & vap->va_mode) == needed;
4894 group_ok = (needed & vap->va_mode) == needed;
4904 world_ok = (needed & vap->va_mode) == needed;
4967 (vap->va_mode & S_IRUSR) ? "r" : "-",
4968 (vap->va_mode & S_IWUSR) ? "w" : "-",
4969 (vap->va_mode & S_IXUSR) ? "x" : "-",
4970 (vap->va_mode & S_IRGRP) ? "r" : "-",
4971 (vap->va_mode & S_IWGRP) ? "w" : "-",
4972 (vap->va_mode & S_IXGRP) ? "x" : "-",
4973 (vap->va_mode & S_IROTH) ? "r" : "-",
4974 (vap->va_mode & S_IWOTH) ? "w" : "-",
4975 (vap->va_mode & S_IXOTH) ? "x" : "-",
4977 on_dir ? vcp->dvap->va_uid : vcp->vap->va_uid,
4978 on_dir ? vcp->dvap->va_gid : vcp->vap->va_gid);
5005 struct vnode_attr *vap = vcp->vap;
5045 if (VATTR_IS_NOT(vap, va_acl, NULL)) {
5047 eval.ae_acl = &vap->va_acl->acl_ace[0];
5048 eval.ae_count = vap->va_acl->acl_entrycount;
5087 vcp->vp, cred->cr_uid, vap->va_uid, dvap->va_uid);
5108 struct vnode_attr *vap = vcp->vap;
5140 if (VATTR_IS_NOT(vap, va_acl, NULL)) {
5142 eval.ae_acl = &vap->va_acl->acl_ace[0];
5143 eval.ae_count = vap->va_acl->acl_entrycount;
5278 vnode_authorize_checkimmutable(vnode_t vp, struct vnode_attr *vap, int rights, int ignore)
5329 if ((error = vnode_immutable(vap, append, ignore)) != 0) {
5506 vcp->vap = &va;
5760 vnode_authattr_new(vnode_t dvp, struct vnode_attr *vap, int noauth, vfs_context_t ctx)
5775 (VATTR_IS_ACTIVE(vap, va_acl) || VATTR_IS_ACTIVE(vap, va_uuuid) || VATTR_IS_ACTIVE(vap, va_guuid))) {
5790 VATTR_SET(vap, va_uid, dmp->mnt_fsowner);
5793 if (!VATTR_IS_ACTIVE(vap, va_uid)) {
5795 VATTR_SET(vap, va_uid, kauth_cred_getuid(vfs_context_ucred(ctx)));
5805 VATTR_SET(vap, va_gid, dmp->mnt_fsgroup);
5808 if (!VATTR_IS_ACTIVE(vap, va_gid)) {
5816 VATTR_SET(vap, va_gid, dva.va_gid);
5818 VATTR_SET(vap, va_gid, kauth_cred_getgid(vfs_context_ucred(ctx)));
5824 if (!VATTR_IS_ACTIVE(vap, va_flags))
5825 VATTR_SET(vap, va_flags, 0);
5828 if (!VATTR_IS_ACTIVE(vap, va_mode)) {
5829 VATTR_SET(vap, va_mode, ACCESSPERMS & ~vfs_context_proc(ctx)->p_fd->fd_cmask);
5830 KAUTH_DEBUG("ATTR - defaulting new file mode to %o from umask %o", vap->va_mode, vfs_context_proc(ctx)->p_fd->fd_cmask);
5834 if (!VATTR_IS_ACTIVE(vap, va_create_time)) {
5835 nanotime(&vap->va_create_time);
5836 VATTR_SET_ACTIVE(vap, va_create_time);
5842 if (vap->va_active & ~VNODE_ATTR_NEWOBJ) {
5845 vap->va_active & ~VNODE_ATTR_NEWOBJ);
5869 if (VATTR_IS_ACTIVE(vap, va_flags)) {
5871 if ((vap->va_flags & (UF_SETTABLE | SF_SETTABLE)) != vap->va_flags) {
5877 if ((vap->va_flags & UF_SETTABLE) != vap->va_flags) {
5887 if (!defaulted_mode && VATTR_IS_ACTIVE(vap, va_mode)) {
5889 if (vap->va_mode & S_ISGID) {
5890 if ((error = kauth_cred_ismember_gid(cred, vap->va_gid, &ismember)) != 0) {
5891 KAUTH_DEBUG("ATTR - ERROR: got %d checking for membership in %d", error, vap->va_gid);
5895 KAUTH_DEBUG(" DENIED - can't set SGID bit, not a member of %d", vap->va_gid);
5902 if ((vap->va_mode & S_ISUID) && (vap->va_uid != kauth_cred_getuid(cred))) {
5908 if (!defaulted_owner && (vap->va_uid != kauth_cred_getuid(cred))) {
5909 KAUTH_DEBUG(" DENIED - cannot create new item owned by %d", vap->va_uid);
5914 if ((error = kauth_cred_ismember_gid(cred, vap->va_gid, &ismember)) != 0) {
5915 KAUTH_DEBUG(" ERROR - got %d checking for membership in %d", error, vap->va_gid);
5919 KAUTH_DEBUG(" DENIED - cannot create new item with group %d - not a member", vap->va_gid);
5926 if (VATTR_IS_ACTIVE(vap, va_uuuid)) {
5932 if (!kauth_guid_equal(&vap->va_uuuid, &changer)) {
5938 if (VATTR_IS_ACTIVE(vap, va_guuid)) {
5939 if ((error = kauth_cred_ismember_guid(cred, &vap->va_guuid, &ismember)) != 0) {
5955 * Check that the attribute information in vap can be legally written by the
5965 vnode_authattr(vnode_t vp, struct vnode_attr *vap, kauth_action_t *actionp, vfs_context_t ctx)
5990 if (vap->va_active & VNODE_ATTR_RDONLY) {
6010 if (VATTR_IS_ACTIVE(vap, va_uid) ||
6011 VATTR_IS_ACTIVE(vap, va_gid) ||
6012 VATTR_IS_ACTIVE(vap, va_mode) ||
6013 VATTR_IS_ACTIVE(vap, va_uuuid) ||
6014 VATTR_IS_ACTIVE(vap, va_guuid)) {
6027 if (VATTR_IS_ACTIVE(vap, va_create_time) ||
6028 VATTR_IS_ACTIVE(vap, va_change_time) ||
6029 VATTR_IS_ACTIVE(vap, va_modify_time) ||
6030 VATTR_IS_ACTIVE(vap, va_access_time) ||
6031 VATTR_IS_ACTIVE(vap, va_backup_time)) {
6043 if (VATTR_IS_ACTIVE(vap, va_flags)) {
6051 if (VATTR_IS_ACTIVE(vap, va_data_size)) {
6072 if (VATTR_IS_ACTIVE(vap, va_data_size)) {
6088 if (VATTR_IS_ACTIVE(vap, va_create_time) ||
6089 VATTR_IS_ACTIVE(vap, va_change_time) ||
6090 VATTR_IS_ACTIVE(vap, va_modify_time) ||
6091 VATTR_IS_ACTIVE(vap, va_access_time) ||
6092 VATTR_IS_ACTIVE(vap, va_backup_time)) {
6103 if (vap->va_vaflags & VA_UTIMES_NULL) {
6117 if (VATTR_IS_ACTIVE(vap, va_mode) && VATTR_IS_SUPPORTED(&ova, va_mode) && (ova.va_mode != vap->va_mode)) {
6118 KAUTH_DEBUG("ATTR - mode change from %06o to %06o", ova.va_mode, vap->va_mode);
6136 if (vap->va_mode & S_ISGID) {
6139 if (VATTR_IS_ACTIVE(vap, va_gid)) {
6140 group = vap->va_gid;
6153 KAUTH_DEBUG("ATTR - ERROR: got %d checking for membership in %d", error, vap->va_gid);
6167 if (vap->va_mode & S_ISUID) {
6170 if (VATTR_IS_ACTIVE(vap, va_uid)) {
6171 owner = vap->va_uid;
6201 if (VATTR_IS_ACTIVE(vap, va_flags)) {
6204 fdelta = vap->va_flags ^ ova.va_flags;
6206 fdelta = vap->va_flags;
6259 * We might want to clear the uid out of vap completely here.
6261 if (VATTR_IS_ACTIVE(vap, va_uid)) {
6262 if (VATTR_IS_SUPPORTED(&ova, va_uid) && (vap->va_uid != ova.va_uid)) {
6263 if (!has_priv_suser && (kauth_cred_getuid(cred) != vap->va_uid)) {
6277 * We might want to clear the gid out of vap completely here.
6279 if (VATTR_IS_ACTIVE(vap, va_gid)) {
6280 if (VATTR_IS_SUPPORTED(&ova, va_gid) && (vap->va_gid != ova.va_gid)) {
6282 if ((error = kauth_cred_ismember_gid(cred, vap->va_gid, &ismember)) != 0) {
6283 KAUTH_DEBUG(" ERROR - got %d checking for membership in %d", error, vap->va_gid);
6288 ova.va_gid, vap->va_gid);
6301 if (VATTR_IS_ACTIVE(vap, va_uuuid)) {
6303 if (VATTR_IS_SUPPORTED(&ova, va_uuuid) && kauth_guid_equal(&vap->va_uuuid, &ova.va_uuuid))
6316 if (!kauth_guid_equal(&vap->va_uuuid, &changer)) {
6329 if (VATTR_IS_ACTIVE(vap, va_guuid)) {
6331 if (VATTR_IS_SUPPORTED(&ova, va_guuid) && kauth_guid_equal(&vap->va_guuid, &ova.va_guuid))
6339 if ((error = kauth_cred_ismember_guid(cred, &vap->va_guuid, &ismember)) != 0) {
6371 if (VATTR_IS_ACTIVE(vap, va_mode)) {
6372 newmode = vap->va_mode;
6380 VATTR_SET(vap, va_mode, newmode & ~(S_ISUID | S_ISGID));
6381 KAUTH_DEBUG("CHOWN - masking setugid bits from mode %o to %o", newmode, vap->va_mode);
6389 if (VATTR_IS_ACTIVE(vap, va_acl)) {
6395 if (vap->va_acl != NULL) {
6401 } else if (vap->va_acl == NULL) {
6407 if (vap->va_acl->acl_entrycount != ova.va_acl->acl_entrycount) {
6411 } else if (vap->va_acl->acl_entrycount > 0) {
6413 if (!memcmp(&vap->va_acl->acl_ace[0], &ova.va_acl->acl_ace[0],
6414 sizeof(struct kauth_ace) * vap->va_acl->acl_entrycount)) {
6425 if (VATTR_IS_ACTIVE(vap, va_encoding))