[roll] Roll fuchsia [component] Add helpers to open directories

The `component::Connect()` and `component::ConnectAt()` are frequently
(mis)used to open `fuchsia.io` protocols like files and directories.
This only works right now as in io1, many operations - like directory
enumeration - were unprivileged. In order to start enforcing the new
io2 rights model, we need to require that callers opening directories
(or other node types) explicitly set the flags/rights they want.

To migrate clients more easily, we add helper functions
`component::OpenDirectory()` and `component::OpenDirectoryAt()` which
mirror the equivalents above, but are intended for opening directories.
By default we use the same set of flags/rights used by service
directories (`r*` or `fuchsia.io/PERM_READABLE`).  Very few if any
callers open non-directory protocols, so we leave these use cases out
of //sdk/lib/component to keep things simple.

Once all clients have migrated to these new functions, we can
statically assert that `Connect`/`ConnectAt` do not compile with
fuchsia.io protocols, and provide an error message pointing users to
`OpenDirectory`/`OpenDirectoryAt` (or an equivalent fdio function for
files/symlinks).

Remove `internal::GetGlobalServiceDirectory()` function as it is the
same as `component::GetServiceRoot()` and move flags constant used for
opening service directories in `constants.h`. Make lifetimes of strings
passed to fdio functions explicitly outlive the function calls.

Original-Bug: 324111518
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1197375
Original-Revision: 9830deb75e24e88e74d64d6eaec1b6d86c1ecf34
GitOrigin-RevId: 064d470a971803e0de9ea1ed143d0bc4e4c32c16
Change-Id: I832c71bf7b4d611aa4fdd10a27ac55c71659e3ee
1 file changed
tree: 4c95584341210ddba72e493a88e1de1346ccf028
  1. ctf/
  2. git-hooks/
  3. infra/
  4. third_party/
  5. cts
  6. firmware
  7. flower
  8. jiri.lock
  9. MILESTONE
  10. minimal
  11. prebuilts
  12. README.md
  13. stem
  14. test_durations
  15. toolchain
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance in one of the communication channels documented at get involved.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.