Lines Matching refs:mountfd
142 int mountfd = open(mount_path, O_RDONLY | O_DIRECTORY | O_ADMIN); in FmountFunmount() local
143 ASSERT_GT(mountfd, 0, "Couldn't open mount point"); in FmountFunmount()
144 ASSERT_EQ(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options, launch_stdio_async), in FmountFunmount()
147 ASSERT_EQ(fumount(mountfd), ZX_OK); in FmountFunmount()
150 ASSERT_EQ(close(mountfd), 0, "Couldn't close ex-mount point"); in FmountFunmount()
171 int mountfd = open(mount_path, O_RDONLY | O_DIRECTORY | O_ADMIN); in DoMountEvil() local
172 ASSERT_GT(mountfd, 0, "Couldn't open mount point"); in DoMountEvil()
177 ASSERT_EQ(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options, launch_stdio_async), in DoMountEvil()
180 ASSERT_NE(fumount(mountfd), ZX_OK); in DoMountEvil()
181 ASSERT_EQ(close(mountfd), 0, "Couldn't close unlinked not-mount point"); in DoMountEvil()
188 mountfd = open(mount_path, O_CREAT | O_RDWR); in DoMountEvil()
189 ASSERT_GT(mountfd, 0); in DoMountEvil()
191 ASSERT_EQ(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options, launch_stdio_async), in DoMountEvil()
194 ASSERT_NE(fumount(mountfd), ZX_OK); in DoMountEvil()
195 ASSERT_EQ(close(mountfd), 0, "Couldn't close file not-mount point"); in DoMountEvil()
203 mountfd = open(mount_path, O_RDONLY | O_DIRECTORY); in DoMountEvil()
204 ASSERT_GT(mountfd, 0, "Couldn't open mount point"); in DoMountEvil()
205 ASSERT_EQ(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options, launch_stdio_async), in DoMountEvil()
208 ASSERT_EQ(close(mountfd), 0, "Couldn't close the unpriviledged mount point"); in DoMountEvil()
213 mountfd = open(mount_path, O_RDONLY | O_DIRECTORY | O_ADMIN); in DoMountEvil()
214 ASSERT_GT(mountfd, 0, "Couldn't open mount point"); in DoMountEvil()
215 ASSERT_EQ(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options, launch_stdio_async), in DoMountEvil()
220 ASSERT_EQ(fmount(fd, mountfd, DISK_FORMAT_MINFS, &default_mount_options, launch_stdio_async), in DoMountEvil()
251 ASSERT_EQ(fumount(mountfd), ZX_OK); in DoMountEvil()
253 ASSERT_EQ(close(mountfd), 0); in DoMountEvil()
275 int mountfd = open(parent_path, O_RDONLY | O_DIRECTORY | O_ADMIN); in MountEvilMinfs() local
276 ASSERT_GT(mountfd, 0, "Couldn't open mount point"); in MountEvilMinfs()
280 fmount(ramdiskfd, mountfd, DISK_FORMAT_MINFS, &default_mount_options, launch_stdio_async), in MountEvilMinfs()
282 ASSERT_EQ(close(mountfd), 0); in MountEvilMinfs()
451 fbl::unique_fd mountfd(open(mount_path, O_RDONLY | O_ADMIN)); in MountGetDevice() local
452 ASSERT_TRUE(mountfd); in MountGetDevice()
457 fzl::FdioCaller caller(std::move(mountfd)); in MountGetDevice()
470 mountfd.reset(open(mount_path, O_RDONLY | O_ADMIN)); in MountGetDevice()
471 ASSERT_TRUE(mountfd); in MountGetDevice()
472 caller.reset(std::move(mountfd)); in MountGetDevice()
481 mountfd.reset(open(mount_path, O_RDONLY)); in MountGetDevice()
482 ASSERT_TRUE(mountfd); in MountGetDevice()
483 caller.reset(std::move(mountfd)); in MountGetDevice()
493 mountfd.reset(open(mount_path, O_RDONLY | O_ADMIN)); in MountGetDevice()
494 ASSERT_TRUE(mountfd); in MountGetDevice()
495 caller.reset(std::move(mountfd)); in MountGetDevice()