summaryrefslogtreecommitdiff
path: root/crates/fs-mistrust/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* fs-mistrust: Treat "" as a NotFound Path.Nick Mathewson2025-11-241-0/+10
| | | | | | | | | This makes fs-mistrust consistent with stat() and mkdir() and friends, which consider "" to be an invalid path. Previously, "" was accepted whenever mistrust was enabled, but rejected whenever mistrust was disabled. Closes #2265.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-2/+2
| | | | Run maint/add_warning
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* fix compiling fs-misstrust on tvOSyaucp2025-03-261-6/+12
|
* fix: fix typosDimitris Apostolou2025-01-301-1/+1
|
* fs-mistrust: Add FileAccess for Verifier (and Mistrust).Nick Mathewson2025-01-141-0/+12
|
* fs-mistrust: Have Verifier check methods take self by reference.Nick Mathewson2025-01-141-2/+2
| | | | There is no reason for these to consume self.
* fs-mistrust: Define a (stub) FileAccess type.Nick Mathewson2025-01-141-0/+2
| | | | | We're going to move functionality and configuration functions here to implement #1746.
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* fs-mistrust: trim whitespace in env var valuesSteven Engler2024-12-181-1/+2
|
* fs-mistrust: commit to stable env var handlingSteven Engler2024-12-181-4/+32
| | | | | | | | Since these environment variables become part of the stable API for applications that use fs-mistrust, we should be explicit about how these environment variables are interpreted so that applications can show the values in their documentation or help text, and so that we don't accidentally change the behaviour and break applications.
* fs-mistrust: (docs) fix incomplete list of env variable valuesSteven Engler2024-12-181-2/+2
|
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* fs-mistrust: Decorate some items with missing walkdir cfgIan Jackson2024-08-191-0/+1
|
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* fs-mistrust: Explain where a Verifier comes fromIan Jackson2023-12-131-0/+2
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* fs-mistrust: forbid unsafe codeIan Jackson2023-07-141-0/+8
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+2
|
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* add opaque ErrorHint API, impl ErrorHint from BadPermissionsShady Katy2023-01-271-1/+1
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-239/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* Merge branch 'compact_home_2' into 'main'Nick Mathewson2022-08-311-0/+2
|\ | | | | | | | | | | | | Represent the home directory as ${HOME} or %UserProfile% Closes #555 See merge request tpo/core/arti!700
| * Use anonymize_home() when displaying various messages.Nick Mathewson2022-08-311-2/+2
| | | | | | | | Closes #555
| * fs-mistrust: Add a `anonymize_home` extension fn for Path.Nick Mathewson2022-08-311-0/+2
| | | | | | | | | | | | This function transforms `/home/nickm/.config` to `${HOME}/.config/`, so that we can expose the username less in our logs.
* | Comment out docstring as it fails to compile on Windows.Alexander Færøy2022-08-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | This patch comments out a method call to `trust_group()` as this method is not available on all platforms that Arti builds on right now and thus fails to compile there. I have added a comment that the given call is not available on non-Unix like platforms. See: tpo/core/arti#557.
* | Disable 3 tests in fs-mistrust.Alexander Færøy2022-08-301-0/+3
| | | | | | | | | | | | | | | | This patch disables `readable_ok()`, `multiple_errors()`, and `check_contents()` as they all rely on permission issues on groups being detected properly which is not the case on Windows right now. See: tpo/core/arti#557.
* | Refactor the construction of the `Mistrust` type in tests.Alexander Færøy2022-08-291-97/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactors how we construct the `Mistrust` type in the tests found in the fs-mistrust crate such that it is possible to construct an instance of the `Mistrust` type using a set of operations available via the `MistrustBuilder`'s methods. We handle some of the portability issues found while testing this code on Windows in the convenience function `mistrust_build()` instead of having duplicated code in multiple test cases. See: tpo/core/arti#557.
* | Disable fs-mistrust's simple_cases() unit test on non-Unix.Alexander Færøy2022-08-261-1/+5
| | | | | | | | | | | | | | | | This patch disables the simple_cases() test on non-Unix platforms and hides the LinkType type import on non-Unix where we won't be testing symbolic link features. See: tpo/core/arti#557.
* | Fix compilation of tests for Windows.Alexander Færøy2022-08-261-13/+49
|/ | | | | | | This patch allows us to compile the fs-mistrust tests on Windows where the `trust_no_group_id()` method is unavailable. See: tpo/core/arti#557.
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* fix fs-misstrust on androidtrinity-1686a2022-08-081-6/+30
| | | | | | it would fail to link at runtime due to missing getgrnam_r in bionic and then it would fail again because some directory is group writeable
* remove dependancy 'users' on iOStrinity-1686a2022-07-301-6/+6
|
* fix nighly clippytrinity-1686a2022-07-231-3/+2
|
* fs-mistrust: API to disable based on environmentNick Mathewson2022-07-191-3/+93
| | | | | | | By default we look at `$FS_MISTRUST_DISABLE_PERMISSIONS_CHECKS`. Optionally, the user can provide another variable as well, or disable looking at the environment entirely.
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* Merge branch 'better-fs-mistrust-badpermissions-string' into 'main'Ian Jackson2022-06-021-7/+7
|\ | | | | | | | | fs-mistrust: Improve BadPermission string See merge request tpo/core/arti!554
| * fs-mistrust: Improve BadPermission stringAlex Xu (Hello71)2022-05-311-1/+1
| | | | | | | | | | | | | | | | | | To me, "Incorrect permissions on file or directory /path: g=w o=w" implies that the current permissions on /path are 022. Change the message to "Incorrect permissions: /path is u=rwx,g=rwx,o=rwx; need g-w,o-w", which is closer to chmod syntax and is more useful in non-interactive environments such as CI and support.