summaryrefslogtreecommitdiff
path: root/crates/fs-mistrust/src
Commit message (Collapse)AuthorAgeFilesLines
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* fs-mistrust: Quote filenames in error messages.Nick Mathewson2025-11-241-9/+9
| | | | | | | | | | | This will help a lot when people try to create files with names like `""` and `" "` and `"foo "` and `"foo! Unless"`. It won't help as much with files that have names like `"filename\". To solve this problem, run install-trojan-now ; \""`. Fortunately, we don't let adversaries choose filenames. Closes #2266.
* fs-mistrust: Treat "" as a NotFound Path.Nick Mathewson2025-11-242-0/+13
| | | | | | | | | 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-069-10/+10
| | | | 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-074-7/+7
| | | | | | | | | | | | | | 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.
* Update code for Edition 2024Nick Mathewson2025-08-071-2/+5
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* Fix Windows compile warningsTobias Stoeckmann2025-08-051-0/+3
| | | | | Use unix-specific crates only if needed and suppress clippy warnings of unused variables if their usage is unix-specific.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* fs-mistrust: Removed dependency on `once_cell`hashcatHitman2025-06-142-5/+5
| | | | | | - Replaced `once_cell::sync::Lazy` with `std::sync::LazyLock`. Signed-off-by: hashcatHitman <[email protected]>
* *: use std::io::Error::other in many placesNick Mathewson2025-05-152-8/+3
| | | | | | | The `IoError::other` function is an easier way to say `IoError::new(IoErrorKind::Other, ...)`. It's been around since 1.74, but clippy started warning about the more verbose version in 1.87.
* fs-mistrust: fix build on non-unix systemsTobias Stoeckmann2025-04-251-0/+1
| | | | | | The TrustAdminOnly enum value is only defined for unix systems. Consider this fact in mistrust_build function to fix build on e.g. Windows systems.
* Merge branch 'android-build' into 'main'wesleyac2025-04-032-3/+29
|\ | | | | | | | | fix builds for Android See merge request tpo/core/arti!2824
| * fix builds for AndroidYaksh Bariya2025-03-032-3/+29
| | | | | | | | | | | | | | This does fix builds for both the arti binary and the tests. Most tests seem to be passing, some are failing. I will try to investigate them and send fixes/create issue to highlight them. Hopefully this helps arti in being production ready fast.
* | fix compiling fs-misstrust on tvOSyaucp2025-03-263-11/+27
|/
* fix: fix typosDimitris Apostolou2025-01-301-1/+1
|
* fs-mistrust: document that follow_final_links is not insecureNick Mathewson2025-01-281-0/+4
| | | | | Since it makes an exception, we need to be clear about the exceptions that it _doesn't_ make.
* fs-mistrust: link to documentation about "obeying constraints"Nick Mathewson2025-01-281-5/+5
| | | | | | Since "obeying the constraints of a FileAccess" is a term of art, this commit introduces links from the places where it is used to the place where it is defined.
* fs-mistrust: Fix test compilation on windows.Nick Mathewson2025-01-161-1/+2
| | | | | | | | | `std::os::unix::fs::MetadataExt` was indeed the right trait to import, but it doesn't exist on non-unix platforms. This is another bugfix on !2707. It should retain the fix of !2717. I've confirmed that it builds on Windows and passes tests on Linux and Mac.
* Fix: Tests fails to run on macoshhamud2025-01-161-5/+5
|
* file_access: Refactor APIs to consume self.Nick Mathewson2025-01-141-7/+16
| | | | | This approach makes it even less likely for people to store a FileAccess for repeated use.
* file_access: Make link-following behavior explicitly controlled.Nick Mathewson2025-01-141-8/+38
|
* Documentation fixes from GabiNick Mathewson2025-01-141-5/+3
|
* fs-mistrust: Try more to explain what FileAccess is for.Nick Mathewson2025-01-141-3/+7
|
* fs-mistrust: Follow symlinks when using file-access outside a CheckedDir.Nick Mathewson2025-01-141-9/+98
| | | | | | When we're not bound to a CheckedDir, it doesn't make sense to forbid following symlinks, so long as their targets are also sensible.
* fs-mistrust: Add FileAccess for Verifier (and Mistrust).Nick Mathewson2025-01-142-9/+42
|
* 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: Add ability to create files with chosen mode.Nick Mathewson2025-01-141-10/+117
|
* fs-mistrust: Clean up documentation.Nick Mathewson2025-01-141-15/+13
|
* fs-mistrust: Move file access methods on CheckedDir to FileAccess.Nick Mathewson2025-01-142-69/+168
| | | | | These are the methods which we'd like to give new options in #1746; we can move other methods later if we want to.
* fs-mistrust: Define a (stub) FileAccess type.Nick Mathewson2025-01-143-0/+38
| | | | | We're going to move functionality and configuration functions here to implement #1746.
* fs-mistrust::CheckedDir: Refactor some common code.Nick Mathewson2025-01-141-22/+32
|
* fs-mistrust: Add test for (not) opening symlink from CheckedDir.Nick Mathewson2025-01-141-1/+10
|
* fs-mistrust: clarify doc for a private function.Nick Mathewson2025-01-141-0/+2
|
* 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-182-4/+8
|
* fs-mistrust: commit to stable env var handlingSteven Engler2024-12-182-4/+43
| | | | | | | | 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
|
* Resolve clippy::empty_line_after_doc_comments warnings.Nick Mathewson2024-12-031-1/+0
| | | | These are new in Rust 1.83.
* 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: Remove outdated thiserror syntaxClara Engler2024-11-121-1/+1
| | | | | | This commit removes an outdated syntax in a `thiserror` macro which will be removed in `thiserror` version 2. The change this commit makes is backwards compatible in itself.
* Replace _ => panic!() elsewhereIan Jackson2024-10-151-1/+1
|
* Fix a couple of lifetime warnings from nightly.Nick Mathewson2024-10-011-1/+1
| | | | | | | | | Nightly rustdoc, under some circumstances, issues a warning when you have an elided lifetime that matches a lifetime with a name. (It would prefer that you name the lifetime explicitly.) This does not change the actual lifetime of anything; it only makes some formerly elided lifetimes explicit.
* fs-mistrust: Make fake PathExt return impl DisplayIan Jackson2024-08-191-3/+4
| | | | Otherwise it doesn't compile when actually used.
* fs-mistrust: Make a comment into a docIan Jackson2024-08-191-2/+2
| | | | Placates clippy.
* fs-mistrust: Decorate some items with missing walkdir cfgIan Jackson2024-08-192-1/+5
|
* fs-mistrust: Make CheckedDir::metadata() return an error if path is symlink.Gabriela Moldovan2024-08-121-2/+45
|
* fs-mistrust: Avoid opening the file in CheckedDir::metadata().Gabriela Moldovan2024-08-081-5/+19
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2291#note_3057232
* fs-mistrust: Add a TODO about refactoring CheckedDir::metadata().Gabriela Moldovan2024-08-081-0/+1
|