trifectatechfoundation / sudo-rs

A memory safe implementation of sudo and su.
Other
2.88k stars 77 forks source link

su CLI overhaul #792

Closed japaric closed 10 months ago

japaric commented 10 months ago

this PR:

this PR is best reviewed commit by commit

codecov[bot] commented 10 months ago

Codecov Report

Attention: 27 lines in your changes are missing coverage. Please review.

Comparison is base (870d15b) 55.88% compared to head (bde50e8) 57.44%. Report is 15 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #792 +/- ## ========================================== + Coverage 55.88% 57.44% +1.55% ========================================== Files 74 74 Lines 9968 10523 +555 ========================================== + Hits 5571 6045 +474 - Misses 4397 4478 +81 ``` | [Files](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/792?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety) | Coverage Δ | | |---|---|---| | [src/su/context.rs](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/792?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety#diff-c3JjL3N1L2NvbnRleHQucnM=) | `61.11% <100.00%> (+0.65%)` | :arrow_up: | | [src/su/mod.rs](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/792?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety#diff-c3JjL3N1L21vZC5ycw==) | `0.00% <0.00%> (ø)` | | | [src/su/cli.rs](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/792?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety#diff-c3JjL3N1L2NsaS5ycw==) | `94.63% <92.76%> (+1.89%)` | :arrow_up: | ... and [17 files with indirect coverage changes](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/792/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

japaric commented 10 months ago

I saw this IsAbsent trait that was also on the sudo CLI overhaul. Could those two be shared? Maybe they are but I overlooked it.

that should be done in a follow up PR. I didn't base the su refactor on top of the sudo refactor branch so I couldn't reuse the trait.