trifectatechfoundation / sudo-rs

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

Use a random temporary file name for `visudo` #669

Closed pvdrz closed 1 year ago

pvdrz commented 1 year ago

Describe the changes done on this pull request This PR uses a random name for the temporary file created by visudo. This file is put in the /tmp directory.

It also updates the tests that involve the name of this file to use snapshots so we can filter the random part of the filename from it.

Pull Request Checklist

github-actions[bot] commented 1 year ago

Number of dependencies and binary size impact report

Metric main PR #669 Delta
Direct dependencies 3 3 -
Total dependencies 4 4 -
Binary size 992.2 KiB 992.3 KiB -
Text size 577.6 KiB 577.8 KiB -
Dependencies diff ```diff └─ sudo-rs [v0.2.0-dev.20230711] ├─ glob [v0.3.1] ├─ libc [v0.2.147] └─ log [v0.4.19] ```
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.11 :warning:

Comparison is base (d58920d) 57.86% compared to head (296f3c3) 57.76%.

:exclamation: Current head 296f3c3 differs from pull request most recent head 2e783fd. Consider uploading reports for the commit 2e783fd to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #669 +/- ## ========================================== - Coverage 57.86% 57.76% -0.11% ========================================== Files 68 68 Lines 8941 8955 +14 ========================================== - Hits 5174 5173 -1 - Misses 3767 3782 +15 ``` | [Impacted Files](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/669?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety) | Coverage Δ | | |---|---|---| | [src/visudo/cli.rs](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/669?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety#diff-c3JjL3Zpc3Vkby9jbGkucnM=) | `0.00% <0.00%> (ø)` | | | [src/visudo/help.rs](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/669?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety#diff-c3JjL3Zpc3Vkby9oZWxwLnJz) | `0.00% <0.00%> (ø)` | | | [src/visudo/mod.rs](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/669?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%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/669/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.