trifectatechfoundation / sudo-rs

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

Allow escape character to serve dual purpose in token parser #692

Closed squell closed 1 year ago

squell commented 1 year ago

The tokenizer assumed that an escape character such as \ was never serving a "dual purpose" (i.e. it's either an escape character or it's a normal character) #687 shows that apparently this assumption was wrong (and so it kind of defeated the purpose of having a escaped category in QuotedInclude. This PR fixes this. Submitting without an issue since it's really an esoteric point (who in their right mind uses " in their filenames?!)

github-actions[bot] commented 1 year ago

Number of dependencies and binary size impact report

Metric main PR #692 Delta
Direct dependencies 3 3 -
Total dependencies 4 4 -
Binary size 996.5 KiB 996.5 KiB -
Text size 580.6 KiB 580.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: 100.00% and no project coverage change.

Comparison is base (ac35d48) 57.75% compared to head (270a091) 57.76%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #692 +/- ## ======================================= Coverage 57.75% 57.76% ======================================= Files 68 68 Lines 9004 9006 +2 ======================================= + Hits 5200 5202 +2 Misses 3804 3804 ``` | [Impacted Files](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/692?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety) | Coverage Δ | | |---|---|---| | [src/sudoers/basic\_parser.rs](https://app.codecov.io/gh/memorysafety/sudo-rs/pull/692?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=memorysafety#diff-c3JjL3N1ZG9lcnMvYmFzaWNfcGFyc2VyLnJz) | `95.55% <100.00%> (+0.03%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.