Skip to content

[Bug]: Windows — terminal file links on a mapped network drive fail silently (fs:stat "Access denied: path resolves outside allowed directories") #23018

Closed

Description

@Sota311

Operating system

Windows

Orca version

1.4.211

Details

Summary: clicking a terminal file link that lives on a mapped network drive (X: = SMB share mapped with net use) shows the link popover, but both "Open file" and "Open with default app" do nothing. No toast, nothing in the console. Text files sometimes open; images/PDFs never do.

Calling the same steps the click handler runs, from DevTools, shows where it stops:

step X:/share/…/page-1.png X:/share/…/README.md //nas/share/…/page-1.png (UNC, forward slashes) local C:/…/x.png
window.api.fs.authorizeExternalPath ok ok ok ok
window.api.fs.stat Access denied: path resolves outside allowed directories Access denied ok ok
window.api.shell.openFilePath (called directly) true (opens) true true (opens) true

So the main-process open path works fine for the drive-letter spelling; only the allow-list check in fs:stat rejects it, and the renderer's terminal-link handler swallows the error (try { authorize; stat } catch { return }), which is why the click is a silent no-op.

Likely cause: authorizeExternalPath records path.resolve(p) and fs.realpathSync(p) (the JS implementation, which does not resolve drive mappings, so both are X:\…), while the allow-list check canonicalizes with the native fs.promises.realpath, which on Windows resolves a mapped drive to its UNC form \nas\share\…. The canonical path is then not in the allow-list. A local symlink pointing at the share fails the same way (its realpath is also UNC).

Related: #11183 (mapped drives canonicalized to UNC), #21172 (same "Access denied" from NFD/NFC mismatch on macOS — same class of canonicalization mismatch), #18268.

Steps to reproduce

  1. net use X: \server\share on Windows.
  2. In an Orca terminal, print X:\share\some\image.png.
  3. Click the link → choose either popover action. Nothing happens.
  4. DevTools console: await window.api.fs.authorizeExternalPath({targetPath:'X:/share/some/image.png'}); await window.api.fs.stat({filePath:'X:/share/some/image.png'}) → Access denied. Same with //server/share/some/image.png → ok.

Expected
Either accept the drive-letter form (add the native-realpath canonical form to the allow-list when authorizing), or surface the error instead of silently ignoring it.

Workaround
Print NAS paths as forward-slash UNC: //server/share/…. That spelling is linkified and opens. (\server\share\… with backslashes is not linkified at all.)

Activity

  1. AmethystLiang commented on Sep 27, 2026

    @AmethystLiang
    Contributor

    thanks for reporting. looking into it

  2. brennanb2025 commented on Oct 12, 2026

    @brennanb2025
    Contributor

    This should be fixed in v1.4.221 and later, by #24489.

    The failure came from the old permission check. When you clicked the link, Orca granted the X:\… path. Then fs:stat resolved the mapped drive to its \\server\share\… form and didn't find that among the granted paths, so the stat was refused and the click did nothing.

    #24489 removed that grant system. A terminal link you click is now checked as a file you opened yourself: it's read where it is, by the path you clicked, with no lookup against a list of granted paths. A drive-letter path on a mapped network drive should therefore open the same way a local file does. Images and PDFs included.

    We haven't tested this on a real mapped drive yet. Could you try it on v1.4.221 or later? If it still fails, please leave a comment with the Orca version and anything shown in DevTools, and we'll dig back in.

  3. Sota311 commented on Oct 12, 2026

    @Sota311
    Author

    Confirmed fixed on v1.4.224 — a PDF on a mapped network drive (X:\…) now opens from a terminal link. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions