summaryrefslogtreecommitdiff
path: root/crates/fs-mistrust/src/err.rs
Commit message (Collapse)AuthorAgeFilesLines
* fs-mistrust: Add Group and User types.Nick Mathewson2022-05-241-1/+13
| | | | | This will help make the actual configuration more serializable, I hope.
* fs-mistrust: make Mistrust have a corresponding Builder type.Nick Mathewson2022-05-241-1/+8
| | | | | This is an approximately minimal revision to get Builder in place; subsequent commits will clean up the API.
* fs-mistrust: add various methods.Nick Mathewson2022-05-091-3/+46
| | | | | | | | | | | This includes: * a CachedDir::join method. * functions to read and write from provided filenames in a CachedDir. * a method to tell whether a fs-mistrust error is about bad file permissions, or failure to inspect file permissions or some other kind of IO problem.
* fs-mistrust: Rename SecureDir to CheckedDir.Nick Mathewson2022-05-031-3/+3
|
* Add a SecureDir API for checked access to directoriesNick Mathewson2022-05-031-0/+7
| | | | | | The only way to get a SecureDir is by having checked a directory. Once you have one, it encourages you to open and create files and directories with the right permissions, and checks them for you.
* Add functionality to inspect directory content permissionsNick Mathewson2022-05-031-0/+13
| | | | Also, explain _why_ this is pretty important.
* Support for "create missing directory".Nick Mathewson2022-05-031-0/+5
|
* Second cut at a fs-mistrust crate.Nick Mathewson2022-05-031-0/+173
This crate is meant to solve #315 by giving a way to make sure that a file or directory is only accessible by trusted users. I've tried to explain carefully (in comments and documentation) what this crate is doing and why, under the assumption that it will someday be read by another person like me who does _not_ live and breathe unix file permissions. The crate is still missing some key features, noted in the TODO section. It differs from the first version of the crate by taking a more principled approach to directory checking: it emulates the path lookup process (reading symlinks and all) one path change at a time, thus ensuring that we check every directory which could enable an untrusted user to get to our target file, _or_ which could enable them to get to any symlink that would get them to the target file. The API is also slightly different: It separates the `Mistrust` object (where you configure what you do or do not trust) from the `Verifier` (where you set up a check that you want to perform on a single object). Verifiers are set up to be a bit ephemeral, so that it is hard to accidentally declare that _every_ object is meant to be readable when you only mean that _some_ objects may be readable.