trifectatechfoundation / sudo-rs

A memory safe implementation of sudo and su.
Other
2.9k stars 79 forks source link

More `visudo` fixes about temporary files #666

Closed pvdrz closed 1 year ago

pvdrz commented 1 year ago

Describe the changes done on this pull request This PR updates visudo so it sets the right permissions for the sudoers temporary file and emit a warning to stderr if the contents of the sudoers file did not change after editing them.

Blocked by #665

Pull Request Checklist

github-actions[bot] commented 1 year ago

Number of dependencies and binary size impact report

Metric main PR #666 Delta
Direct dependencies 3 3 -
Total dependencies 4 4 -
Binary size 979 KiB 983.1 KiB +0.4%
Text size 571.5 KiB 574.4 KiB +0.5%
Dependencies diff ```diff └─ sudo-rs [v0.2.0-dev.20230703] ├─ glob [v0.3.1] ├─ libc [v0.2.147] └─ log [v0.4.19] ```
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 15.47% and project coverage change: -0.35 :warning:

Comparison is base (27b9ade) 59.02% compared to head (37990f8) 58.68%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #666 +/- ## ========================================== - Coverage 59.02% 58.68% -0.35% ========================================== Files 66 66 Lines 8764 8817 +53 ========================================== + Hits 5173 5174 +1 - Misses 3591 3643 +52 ``` | [Impacted Files](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/666?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety) | Coverage Δ | | |---|---|---| | [src/visudo/mod.rs](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/666?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety#diff-c3JjL3Zpc3Vkby9tb2QucnM=) | `0.00% <0.00%> (ø)` | | | [src/system/timestamp.rs](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/666?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety#diff-c3JjL3N5c3RlbS90aW1lc3RhbXAucnM=) | `80.04% <75.00%> (ø)` | | | [src/system/file.rs](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/666?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety#diff-c3JjL3N5c3RlbS9maWxlLnJz) | `77.04% <76.92%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/666/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: Do you have feedback about the report comment? Let us know in this issue.