[components] Set flags and mode when using runners
If we do not set flags, the C++ VFS (in DirectoryConnection::Open())
will filter out the incoming request to the service.
Also set the mode to mark that we are requesting a service.
Bug: 33183
Change-Id: Ic38134bec76437424d78a2db91d81a5ac2b6fc20
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/405176
Testability-Review: Abdulla Kamar <abdulla@google.com>
Reviewed-by: David Greenaway <dgreenaway@google.com>
Commit-Queue: Abdulla Kamar <abdulla@google.com>
diff --git a/src/sys/component_manager/src/model/realm.rs b/src/sys/component_manager/src/model/realm.rs
index 2b5f519..334692c 100644
--- a/src/sys/component_manager/src/model/realm.rs
+++ b/src/sys/component_manager/src/model/realm.rs
@@ -25,7 +25,7 @@
},
fidl::endpoints::{create_endpoints, Proxy, ServerEnd},
fidl_fuchsia_component_runner as fcrunner,
- fidl_fuchsia_io::{self as fio, DirectoryProxy},
+ fidl_fuchsia_io::{self as fio, DirectoryProxy, MODE_TYPE_SERVICE, OPEN_RIGHT_READABLE},
fidl_fuchsia_sys2 as fsys, fuchsia_async as fasync,
fuchsia_zircon::{self as zx, AsHandleRef},
futures::future::TryFutureExt,
@@ -376,8 +376,8 @@
.map_err(|_| ModelError::InsufficientResources)?;
let mut server_channel = server_channel.into_channel();
routing::route_use_capability(
- /*flags=*/ 0,
- /*open_mode=*/ 0,
+ OPEN_RIGHT_READABLE,
+ MODE_TYPE_SERVICE,
String::new(),
&UseDecl::Runner(runner_decl.clone()),
self,