diff --git a/shell/platform/fuchsia/flutter/component_v1.cc b/shell/platform/fuchsia/flutter/component_v1.cc index 3f21401c361df..b869edbdd97d2 100644 --- a/shell/platform/fuchsia/flutter/component_v1.cc +++ b/shell/platform/fuchsia/flutter/component_v1.cc @@ -217,8 +217,7 @@ ComponentV1::ComponentV1( // Clone and check if client is servicing the directory. directory_ptr_->Clone(fuchsia::io::OpenFlags::DESCRIBE | - fuchsia::io::OpenFlags::RIGHT_READABLE | - fuchsia::io::OpenFlags::RIGHT_WRITABLE, + fuchsia::io::OpenFlags::CLONE_SAME_RIGHTS, cloned_directory_ptr_.NewRequest()); cloned_directory_ptr_.events().OnOpen = [this](zx_status_t status, @@ -234,8 +233,11 @@ ComponentV1::ComponentV1( for (auto& dir_str : other_dirs) { fuchsia::io::DirectoryHandle dir; auto request = dir.NewRequest().TakeChannel(); - auto status = fdio_service_connect_at(directory_ptr_.channel().get(), - dir_str, request.release()); + auto status = fdio_open_at( + directory_ptr_.channel().get(), dir_str, + static_cast(fuchsia::io::OpenFlags::DIRECTORY | + fuchsia::io::OpenFlags::RIGHT_READABLE), + request.release()); if (status == ZX_OK) { outgoing_dir_->AddEntry( dir_str, std::make_unique(dir.TakeChannel())); diff --git a/shell/platform/fuchsia/flutter/component_v2.cc b/shell/platform/fuchsia/flutter/component_v2.cc index fdd577469d70b..9893de69e1765 100644 --- a/shell/platform/fuchsia/flutter/component_v2.cc +++ b/shell/platform/fuchsia/flutter/component_v2.cc @@ -267,8 +267,7 @@ ComponentV2::ComponentV2( // Clone and check if client is servicing the directory. directory_ptr_->Clone(fuchsia::io::OpenFlags::DESCRIBE | - fuchsia::io::OpenFlags::RIGHT_READABLE | - fuchsia::io::OpenFlags::RIGHT_WRITABLE, + fuchsia::io::OpenFlags::CLONE_SAME_RIGHTS, cloned_directory_ptr_.NewRequest()); // Collect our standard set of directories along with directories that are @@ -291,8 +290,11 @@ ComponentV2::ComponentV2( for (auto& dir_str : other_dirs) { fuchsia::io::DirectoryHandle dir; auto request = dir.NewRequest().TakeChannel(); - auto status = fdio_service_connect_at(directory_ptr_.channel().get(), - dir_str.c_str(), request.release()); + auto status = fdio_open_at( + directory_ptr_.channel().get(), dir_str.c_str(), + static_cast(fuchsia::io::OpenFlags::DIRECTORY | + fuchsia::io::OpenFlags::RIGHT_READABLE), + request.release()); if (status == ZX_OK) { outgoing_dir_->AddEntry( dir_str.c_str(),