Commit Graph

3952 Commits

Author SHA1 Message Date
Nick Mathewson 052f3089ca Bump to rusqlite 0.28. 2022-07-19 16:49:44 -04:00
Nick Mathewson 414939bf8c Merge branch 'mistrust-envvar' into 'main'
Move environment-variable checking into fs-mistrust

Closes #483

See merge request tpo/core/arti!630
2022-07-19 20:46:47 +00:00
Nick Mathewson 6f1de00369 Merge branch 'fallible_writers_v2' into 'main'
Revise tor_bytes::Writer::write to return a Result.

Closes #513

See merge request tpo/core/arti!623
2022-07-19 20:29:15 +00:00
eta b96fcd91f2 Merge branch 'eq' into 'main'
tor-cell: Derive Eq for NtorV3Extension

See merge request tpo/core/arti!631
2022-07-19 19:50:51 +00:00
eta d6b0116b71 Apply 1 suggestion(s) to 1 file(s) 2022-07-19 19:33:15 +00:00
Nick Mathewson d2b64642e1 fs-mistrust: accept "n" as "no". 2022-07-19 15:29:24 -04:00
Ian Jackson d89758ace2 Semver tweaks from review.
These aren't user facing comments, but getting them
right will help us write better changelogs.
2022-07-19 15:29:24 -04:00
Nick Mathewson 222d1fea5e arti-client: Remove code related to overriding fs-mistrust.
This logic can now be adjusted via the config object so that it does
its own overriding by looking at the environment as appropriate.
Removing these methods helps simplify the code a bit.

Enabled by #483.
2022-07-19 15:29:24 -04:00
Nick Mathewson f1d99317bd Arti: Use synthetic argument to implement --disable-fs-permission-checks
Now that configuring the environment variables related to fs
permissions works properly, we don't need to use the "override"
feature any more: we can just add the option to the configuration
when appropriate.

With this design, `--disable-fs-permission-checks` is now mostly an
alias for
`--option storage.permissions.dangerously_trust_everyone=true`

Enabled by #483.
2022-07-19 15:21:09 -04:00
Nick Mathewson 8563635a29 Move responsibility for disable-fs-mistrust envvar.
The variable is now handled when building the configuration, and no
longer needs to be special-cased.

Closes #483.
2022-07-19 15:21:09 -04:00
Nick Mathewson 03b5efbd6e fs-mistrust: API to disable based on environment
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.
2022-07-19 15:21:09 -04:00
Ian Jackson 76285d8a2e Merge branch 'dormant' into 'main'
Make dormant be a postage::watch

See merge request tpo/core/arti!632
2022-07-19 18:24:05 +00:00
Ian Jackson 44402f722e tor-basic-utils: Add a test for DropNotifyWatchSender 2022-07-19 19:04:34 +01:00
Ian Jackson c7933de0ab tor-basic-utils: Add ref to upstream issue re drop 2022-07-19 19:00:23 +01:00
Ian Jackson bd41e29f33 tor-basic-utils: Add comment about lack of race
In answer to
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/632#note_2822107

I think this is subtle enough that it deserves a comment.
2022-07-19 17:21:22 +01:00
Ian Jackson cb982183f9 arti-client: Do periodic task dormancy in a management task
This means that it is no longer possible to write code which updates
the dormant mode but forgets to notify the periodic tasks.
2022-07-18 18:13:13 +01:00
Ian Jackson 2d3f4493a4 arti-client: Make dormant_mode be an Option, None on drop
This will allow receivers (which we are about to introduce) to
terminate when the last client is dropped.
2022-07-18 18:13:13 +01:00
Ian Jackson bc498bc7a0 arti-client: Provide DropNotifyWatchSender
There are going to be some tasks (well, right away, one task) which
will want to go away when the sender is dropped.

The docs in postage are silent, but postage::Sender does not
have a Drop impl so I don't think we can rely on the Receivers getting
None from their Stream impl.

So we're going to have the watch send Options, which are None only
when the sender is dropped.
2022-07-18 18:13:13 +01:00
Ian Jackson 9146a03533 arti-client: Convert dormant_mode into a postage::watch
We are going to want to be able to wake up other tasks elsewhere in
Arti, that need to know about dormancy.  We will give them a postage
watch Receiver.

Right now there are no such things yet.
2022-07-18 18:13:13 +01:00
Ian Jackson 9287e009cc arti-client: Make DormantMode have a Default 2022-07-18 18:13:13 +01:00
Ian Jackson f8170a9c48 arti-client: Add Bug variant to error
We're going to want this in a moment.
2022-07-18 18:13:13 +01:00
Ian Jackson 7acdd21750 Provide maybe_send on postage::Sender, via extension trait
We need to replace the AtomicBool for dormant mode with something that
can wake up tasks.  postage::watch is the right shape.

But we want to be able to update it but suppress no-op updates.
(There is going to be a call site where no-op updates can occur.)

In the absence of a suitable upstream method as requested here
  https://github.com/austinjones/postage-rs/issues/56
we introduce this facility via an extension trait.
2022-07-18 18:13:13 +01:00
Ian Jackson bcf94f33e0 tor-cell: Derive Eq for NtorV3Extension
Apropos clippy complaint.
2022-07-18 17:49:59 +01:00
Nick Mathewson 8d66f8ecd0 Merge branch 'dirmgr_error_cleanup' into 'main'
Clean up some errors in tor-dirmgr

Closes #521

See merge request tpo/core/arti!628
2022-07-18 14:40:11 +00:00
Nick Mathewson 3c424c82d7 dirmgr: Add a helper to create LockFile errors. 2022-07-18 10:10:28 -04:00
Nick Mathewson 26bfc5d061 Merge branch 'unused' into 'main'
tor-persist: Resource::Temporary: Mark with cfg

See merge request tpo/core/arti!629
2022-07-18 13:52:13 +00:00
Ian Jackson b7de46958d tor-persist: Resource::Temporary: Mark with cfg
Without this, some builds get a "variant is never constructed" warning.
2022-07-18 13:07:30 +01:00
Ian Jackson 44f37b2d07 Merge branch 'cirmgr_error_cleanup' into 'main'
Clean-ups in circmgr errors

See merge request tpo/core/arti!625
2022-07-15 15:58:44 +00:00
Nick Mathewson 9d3beb34a3 Bump tor-dirmgr to version 0.5.1.
This does not require a change in any other crate, since
the change here does not affect tor-dirmgr's APIs.
2022-07-14 12:00:42 -04:00
Nick Mathewson eaf0733a6c Changelog for tor-dirmgr 0.5.1 2022-07-14 12:00:08 -04:00
Nick Mathewson c983987782 dirmgr: Make UnrecognizedSchema more helpful 2022-07-14 09:53:17 -04:00
Nick Mathewson 8cbc740d90 dirmgr: Add an instance of BadUtf8InCache 2022-07-14 09:32:01 -04:00
Nick Mathewson d1e9d4ce84 dirmgr: Clarify disk IO errors. 2022-07-14 09:27:29 -04:00
Nick Mathewson 13b2a35a5d Merge branch 'cache-filename-formatting-windows' into 'main'
Fix illegal formatting in cache filenames on Windows

Closes #516

See merge request tpo/core/arti!627
2022-07-14 13:06:16 +00:00
Nick Mathewson c1101f13f3 dirmgr: style edits to error messages. 2022-07-14 08:40:42 -04:00
feelingnothing 171dd5eb63 Fix illegal formatting in cache filenames 2022-07-14 15:27:52 +03:00
Ian Jackson 87801dd4c0 Apply 1 suggestion(s) to 1 file(s) 2022-07-13 13:13:13 +00:00
Nick Mathewson ef76b273a9 circmgr: Refactor DirPathBuilder::pick_path.
We no longer needs to have a "return" at the end of each match
block.
2022-07-12 12:05:35 -04:00
Nick Mathewson c59d6a9211 circmgr: Use FilterCounts to explain why we couldn't build paths 2022-07-12 12:02:12 -04:00
Nick Mathewson 2deb03eb61 circmgr: Use FilterCounts to explain why we couldn't find an exit. 2022-07-12 11:51:05 -04:00
Nick Mathewson 98cda34fb8 netdir: Make pick() functions take FnMut closures.
There's no reason to enforce their being Fn closures, and allowing
them to be FnMut allows us to count which filters make us rejected
given relays.
2022-07-12 11:43:49 -04:00
Nick Mathewson ad87cdcf27 tor-basic-utils: Add a new interface to FilterCount
This interface allows using FilterCount with functions that expect
predicates rather than iterator chains.

I'm about to use it to get meaningful FilterCount results in the
path-selection code in circmgr.
2022-07-12 11:35:41 -04:00
Nick Mathewson 8d8c61cc98 Merge branch 'docs' into 'main'
Fix some rustdoc links

See merge request tpo/core/arti!624
2022-07-12 14:49:18 +00:00
Ian Jackson f098b93d0a tor-persist: StateMgr: vagueify docs about NoLock error
`NoLock` is now a variant of `err::ErrorSource` but that is private.
2022-07-12 15:15:07 +01:00
Ian Jackson 1fc86e3ea9 Fix two rustdoc links
This type must have been renamed, I guess.
2022-07-12 15:14:47 +01:00
Nick Mathewson 51f4779f75 tor-circmgr: Clarify and improve Protocol error. 2022-07-12 10:01:56 -04:00
Nick Mathewson 4db7f4b9db tor-circmgr: minor error message edits. 2022-07-12 09:39:20 -04:00
Nick Mathewson 4dce7557b6 Remove the last vestiges of write_infallible.
Now that everything has been converted to fallible writers, we get
to finally remove write_infallible() from tor_bytes.
2022-07-11 11:18:51 -04:00
Nick Mathewson fbb6484025 tor-proto: Stop using write_infallible in handshake code.
This change was a bit annoying, since most of this code _can't_ fail,
and so the only reasonable response is to wrap the input in an
internal error... except for one case where we're actually encoding
a caller-provided message, so we _do_ want to wrap the EncodeError
from tor_bytes.
2022-07-11 11:18:51 -04:00
Nick Mathewson 44314f5076 tor-cell: Stop using write_infallible
Also, stop using "expect" and "assert!" to check for errors.
2022-07-11 11:18:51 -04:00