I get a `Permission denied` error on my Linux machine when I work on one of my network shares. I believe that Quarto tries to access `_quarto.yml` outside of my share (actually, two folders up), which I don't have permission to read and/or write.

Specifically, my project is located in `/run/user/1000/gvfs/smb-share:server=pers.ad.uni-graz.at,share=fs/home/home_b/brunnerc/quarto-issue`. The Quarto source is in another subfolder, i.e. `test/test.qmd` (but that doesn't seem relevant).

From the folder I mentioned, I run

```
quarto preview test/test.qmd 
```

This results in the following error:

```
ERROR: PermissionDenied: Permission denied (os error 13), stat '/run/user/1000/gvfs/smb-share:server=pers.ad.uni-graz.at,share=fs/home/home_b/_quarto.yml'

PermissionDenied: Permission denied (os error 13), stat '/run/user/1000/gvfs/smb-share:server=pers.ad.uni-graz.at,share=fs/home/home_b/_quarto.yml'
    at Object.lstatSync (deno:runtime/js/30_fs.js:305:9)
    at existsSync (file:///opt/quarto/bin/quarto.js:492:14)
    at Array.find (<anonymous>)
    at projectConfigFile (file:///opt/quarto/bin/quarto.js:58280:37)
    at file:///opt/quarto/bin/quarto.js:82866:28
    at projectContext (file:///opt/quarto/bin/quarto.js:82724:32)
    at async Command.fn (file:///opt/quarto/bin/quarto.js:103696:25)
    at async Command.execute (file:///opt/quarto/bin/quarto.js:8437:13)
    at async quarto (file:///opt/quarto/bin/quarto.js:127540:5)
    at async file:///opt/quarto/bin/quarto.js:127558:9
```

The contents of `test.qmd` does not seem to matter, since the error occurs before even reading it.

This is on Arch Linux.

_Originally posted by @cbrnr in https://github.com/quarto-dev/quarto-cli/issues/4594#issuecomment-1580591702_
cscheid
2023-06-07T16:47:35Z
cbrnr
v1.4
open
Issue with automatic project root discovery
https://github.com/quarto-dev/quarto-cli/issues/5843