summaryrefslogtreecommitdiff
path: root/crates/fs-mistrust/src/user.rs
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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.
* Merge branch 'bug487' into 'main'Ian Jackson2022-05-301-0/+6
|\ | | | | | | | | | | | | fs-mistrust: add getegid() to getgrouplist() output. Closes #487 See merge request tpo/core/arti!548
| * fs-mistrust: add getegid() to getgrouplist() output.Nick Mathewson2022-05-271-0/+6
| | | | | | | | | | | | | | | | | | | | This fixes a unit test failure in weird environments (like some containers) where the current effective GID is not included in the list of current groups. Closes #487. Bug reported by @sjm217.
* | fs-mistrust: Document problems with non-UTF8 OsString in tomlNick Mathewson2022-05-261-0/+5
|/ | | | | | | | | | | It turns out that the `toml` crate can't handle OsString, since `toml` doesn't support serialize_newtype_variant, and the `serde` crate tries to serialize OsString using that method. In this commit we document that limitation, and test that we can at least round-trip through json. Found by inspecting test coverage.
* Use serde attrs instead of manual implsNick Mathewson2022-05-241-0/+10
|
* Write custom serde impls for Trusted{User,Group}Nick Mathewson2022-05-241-10/+22
| | | | | | | | | | | | | | | | We support all of the following (in TOML notation): ``` user = "rose" # by name user = 413 # by ID user = false # no user user = ":current" # A 'special' user. user = { name: "rose" } user = { id: 413 } user = { special: ":none" } user = { special: ":current" } ```
* Add serde derives for MistrustBuilder.Nick Mathewson2022-05-241-0/+10
| | | | | | The Group and User (de)serialization is pretty ugly, and I can't vouch for the correcness of MistrustBuilder. I will seek feedback before I proceed.
* fs-mistrust: Add Group and User types.Nick Mathewson2022-05-241-18/+168
| | | | | This will help make the actual configuration more serializable, I hope.
* fs-mistrust: make Mistrust have a corresponding Builder type.Nick Mathewson2022-05-241-0/+8
| | | | | This is an approximately minimal revision to get Builder in place; subsequent commits will clean up the API.
* Fix typos (using the typos-cli tool).Nick Mathewson2022-05-041-1/+1
|
* Work around CI config weirdness.Nick Mathewson2022-05-031-0/+5
| | | | | Some of our builders put root into gid 0, but getgroups() doesn't actually give any result.
* fs-mistrust: Add code to make a self-named group "trusted".Nick Mathewson2022-05-031-0/+202
This required a bit of poking through the `users` crate, to mess with the user and group dbs. The original goal was to "trust the group with the same name as us", but it turned into a bit of a production, since: * We want to take our own name from $USER, assuming that matches our uid. (Otherwise we want to ask getpwuid_r().) * We only want to trust the group if we are actually a member of that group. * We want to cache this information. * We want to test this code.