-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if we are on OpenBSD and set our dirname to /tmp/fish if we are. #6522
Conversation
…are. OpenBSD uses [unveil(2)](https://man.openbsd.org/unveil) in chromium and firefox. This means that things outside of ~/Downloads are not visible to the browsers.
Is there really no way of passing a file system path into the browser? I worry about this approach causing problems down the line, as it seems like an implementation detail within OpenBSD that might change at any time. |
Does this mean |
I had a typo in the path. Fixed now. @zanchey there is a way to add paths to the list of directories that the browser can access, that said, it requires Also the implementation is not likely to change any time soon. What gave you the impression it would? @ammgws |
@qbit I don't suppose it'd be possible to convince OpenBSD to add ~/.cache (or $XDG_CACHE_HOME) to the list of allowed directories? I don't think we're entirely alone in using that. Or, alternatively, is there a better way of figuring out we can't use it? Uname checks are a bit cheesy, and I prefer avoiding them. Also is ~/Downloads really the best place? We want a directory that:
Downloads seems to match the first two, but it won't be cleaned periodically, and it's quite visible. So users would see our files, and we might get reports that they exist. |
Parts of
|
Definitely better, yes. |
Updated! |
A good point was brought up, this will fail if multiple users run |
Wouldn't it work to use just Or use /tmp/fish.$USER. |
What about using the tempfile.TemporaryDirectory (or just NamedTemporaryFile)? That would let us remove the uname check, and gain this ability:
edit I am proposing using tempfile for all OS, not just OpenBSD. |
TemporaryDirectory is
We do currently still support python 2.7, so we'd have to abandon that. NamedTemporaryFile seems perfect to me, and I'm not sure why we're not using it. |
Updated to use tempfile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok by me!
@faho, thanks for the good reasoning around the Downloads directory.
There's no better time to test it than the beta, so let's do it. |
Description
OpenBSD uses unveil(2) in chromium and
firefox. This means that things outside of ~/Downloads are not visible to the
browsers.