Lines Matching defs:ctx
577 setattrlist_setfinderinfo(vnode_t vp, char *fndrinfo, struct vfs_context *ctx)
587 error = vn_setxattr(vp, XATTR_FINDERINFO_NAME, auio, XATTR_NOSECURITY, ctx);
593 add_fsevent(FSE_FINDER_INFO_CHANGED, ctx, FSE_ARG_VNODE, vp, FSE_ARG_DONE);
640 vfs_context_t ctx, int is_64bit)
682 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: volume attributes requested but not the root of a filesystem");
690 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: setup for request failed");
699 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: could not allocate f_vol_name buffer");
705 error = mac_mount_check_getattr(ctx, mnt, &vs);
709 VFS_DEBUG(ctx, vp, "ATTRLIST - calling to get %016llx with supported %016llx", vs.f_active, vs.f_supported);
710 if ((error = vfs_getattr(mnt, &vs, ctx)) != 0) {
711 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: filesystem returned %d", error);
810 if ((error = vnode_getattr(vp, &va, ctx)) != 0) {
811 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: could not fetch attributes from root vnode", vp);
872 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: buffer size too large (%d limit %d)", ab.allocated, ATTR_MAX_BUFFER);
878 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: could not allocate %d for copy buffer", ab.allocated);
963 error = VNOP_IOCTL(vp, HFS_GET_BOOT_INFO, (caddr_t)&f, 0, ctx);
996 KAUTH_VNODE_ACCESS | KAUTH_VNODE_ADD_FILE | KAUTH_VNODE_ADD_SUBDIRECTORY | KAUTH_VNODE_DELETE_CHILD, ctx) == 0)
998 if (vnode_authorize(vp, NULL, KAUTH_VNODE_ACCESS | KAUTH_VNODE_LIST_DIRECTORY, ctx) == 0)
1000 if (vnode_authorize(vp, NULL, KAUTH_VNODE_ACCESS | KAUTH_VNODE_SEARCH, ctx) == 0)
1003 if (vnode_authorize(vp, NULL, KAUTH_VNODE_ACCESS | KAUTH_VNODE_WRITE_DATA, ctx) == 0)
1005 if (vnode_authorize(vp, NULL, KAUTH_VNODE_ACCESS | KAUTH_VNODE_READ_DATA, ctx) == 0)
1007 if (vnode_authorize(vp, NULL, KAUTH_VNODE_ACCESS | KAUTH_VNODE_EXECUTE, ctx) == 0)
1017 if (mac_vnode_check_access(ctx, vp, W_OK) != 0)
1020 if (mac_vnode_check_access(ctx, vp, R_OK) != 0)
1023 if (mac_vnode_check_access(ctx, vp, X_OK) != 0)
1187 VFS_DEBUG(ctx, vp, "ATTRLIST - returning %d", error);
1196 getattrlist_internal(vnode_t vp, struct getattrlist_args *uap, proc_t p, vfs_context_t ctx)
1234 VFS_DEBUG(ctx, vp, "%p ATTRLIST - %s request common %08x vol %08x file %08x dir %08x fork %08x %sfollow on '%s'",
1239 error = mac_vnode_check_getattrlist(ctx, vp, &al);
1251 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: mixed volume/file/directory/fork attributes");
1255 error = getvolattrlist(vp, uap, &al, ctx, proc_is64);
1284 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: setup for request failed");
1287 if ((error = vnode_authorize(vp, NULL, action, ctx)) != 0) {
1288 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: authorisation failed/denied");
1299 VFS_DEBUG(ctx,vp, "ATTRLIST - ERROR: cannot allocate fullpath buffer");
1313 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: cannot allocate va_name buffer");
1321 if ((error = vnode_getattr(vp, &va, ctx)) != 0) {
1322 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: filesystem returned %d", error);
1349 if (vnode_getattr(dvp, &lva, ctx) == 0 &&
1488 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: buffer size too large (%d limit %d)", ab.allocated, ATTR_MAX_BUFFER);
1494 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: could not allocate %d for copy buffer", ab.allocated);
1638 KAUTH_VNODE_ACCESS | KAUTH_VNODE_ADD_FILE | KAUTH_VNODE_ADD_SUBDIRECTORY | KAUTH_VNODE_DELETE_CHILD, ctx) == 0)
1640 if (vnode_authorize(vp, NULL, KAUTH_VNODE_ACCESS | KAUTH_VNODE_LIST_DIRECTORY, ctx) == 0)
1642 if (vnode_authorize(vp, NULL, KAUTH_VNODE_ACCESS | KAUTH_VNODE_SEARCH, ctx) == 0)
1645 if (vnode_authorize(vp, NULL, KAUTH_VNODE_ACCESS | KAUTH_VNODE_WRITE_DATA, ctx) == 0)
1647 if (vnode_authorize(vp, NULL, KAUTH_VNODE_ACCESS | KAUTH_VNODE_READ_DATA, ctx) == 0)
1649 if (vnode_authorize(vp, NULL, KAUTH_VNODE_ACCESS | KAUTH_VNODE_EXECUTE, ctx) == 0)
1666 &fisize, XATTR_NOSECURITY, ctx);
1676 VFS_DEBUG(ctx, vp, "ATTRLIST - No system.finderinfo attribute, returning zeroes");
1684 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: reading system.finderinfo attribute");
1713 if (mac_vnode_check_access(ctx, vp, W_OK) != 0)
1716 if (mac_vnode_check_access(ctx, vp, R_OK) != 0)
1719 if (mac_vnode_check_access(ctx, vp, X_OK) != 0)
1722 VFS_DEBUG(ctx, vp, "ATTRLIST - granting perms %d", perms);
1816 if ((error = vn_getxattr(vp, XATTR_RESOURCEFORK_NAME, NULL, &rsize, XATTR_NOSECURITY, ctx)) != 0) {
1982 VFS_DEBUG(ctx, vp, "ATTRLIST - returning %d", error);
1989 struct vfs_context *ctx;
1994 ctx = vfs_context_current();
2011 error = getattrlist_internal(vp, &ap, p, ctx);
2023 struct vfs_context *ctx;
2029 ctx = vfs_context_current();
2038 NDINIT(&nd, LOOKUP, OP_GETATTR, nameiflags, UIO_USERSPACE, uap->path, ctx);
2045 error = getattrlist_internal(vp, uap, p, ctx);
2086 setattrlist_internal(vnode_t vp, struct setattrlist_args *uap, proc_t p, vfs_context_t ctx)
2114 VFS_DEBUG(ctx, vp, "%p ATTRLIST - %s set common %08x vol %08x file %08x dir %08x fork %08x %sfollow on '%s'",
2124 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: attempt to set invalid volume attributes");
2133 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: attempt to set invalid file/folder attributes");
2163 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: buffer size %d too large", uap->bufferSize);
2169 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: could not allocate %d bytes for buffer", uap->bufferSize);
2174 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: buffer copyin failed");
2177 VFS_DEBUG(ctx, vp, "ATTRLIST - copied in %d bytes of user attributes to %p", uap->bufferSize, user_buf);
2180 error = mac_vnode_check_setattrlist(ctx, vp, &al);
2219 VFS_DEBUG(ctx, vp, "ATTRLIST - not enough data supplied for FINDERINFO");
2256 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: bad ACL supplied", ar.attr_length);
2264 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: bad ACL supplied");
2275 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: supplied ACL is too large");
2298 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: volume name too big for caller buffer");
2310 VFS_DEBUG(ctx, vp, "ATTRLIST - XXX device type change not implemented");
2318 if ((va.va_active != 0LL) && ((error = vnode_authattr(vp, &va, &action, ctx)) != 0)) {
2319 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: attribute changes refused: %d", error);
2337 if ((action != 0) && ((error = vnode_authorize(vp, NULL, action, ctx)) != 0)) {
2338 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: authorization failed");
2354 if ((error = setattrlist_setfinderinfo(vp, fndrinfo, ctx)) != 0) {
2363 if ((va.va_active != 0LL) && ((error = vnode_setattr(vp, &va, ctx)) != 0)) {
2364 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: filesystem returned %d", error);
2374 error = VNOP_IOCTL(vp, HFS_SET_BOOT_INFO, (caddr_t)fndrinfo, 0, ctx);
2380 } else if ((error = setattrlist_setfinderinfo(vp, fndrinfo, ctx)) != 0) {
2398 error = mac_mount_check_setattr(ctx, vp->v_mount, &vs);
2403 if ((error = vfs_setattr(vp->v_mount, &vs, ctx)) != 0) {
2404 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: setting volume name failed");
2410 VFS_DEBUG(ctx, vp, "ATTRLIST - ERROR: could not set volume name");
2420 VFS_DEBUG(ctx, vp, "ATTRLIST - set returning %d", error);
2427 struct vfs_context *ctx;
2433 ctx = vfs_context_current();
2441 NDINIT(&nd, LOOKUP, OP_SETATTR, nameiflags, UIO_USERSPACE, uap->path, ctx);
2447 error = setattrlist_internal(vp, uap, p, ctx);
2457 struct vfs_context *ctx;
2462 ctx = vfs_context_current();
2478 error = setattrlist_internal(vp, &ap, p, ctx);