Add POSIX setgid/setuid/sticky bit support #59
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ISSUE #58 - Add POSIX setgid/setuid/sticky bit support
Fixes #58
Description
Here, I adjust the
POSIX_LS_RE
to account fors
,S
,t
, andT
in the "pex"-y positions, by adding them to the set of characters we scan for 9 of. Now, the following characters are included in the scan:-rwxsStT
, where previously only-rwxs
were supported. Off-hand, it appears thes
was an attempt to support setuid/setgid, but it did not cover the case where thex
bit is not set, which renders as aS
.Because this regex did not previously validate for the correct ordering (i.e., refuting strange combos like
rxw
), I did not add them in this PR.The
pex
parsing closure, which does some simple arithmetic to determine the "pex" value, needed some updates.S
andT
indicate the presence of a setuid/setgid bit, or a sticky bit, but withoutx
. (Ifx
is set, then theS
instead is typically reported ass
.)So, I added
S
andT
as exceptions in addition to-
. They will be treated the same. With this change, no information is recorded about the setuid/setgid bits, and I don't think the interpretation of them is of great importance at this time given they are interpreted locally by the operating system and they have different meanings.Type of change
Please select relevant options.
Checklist
cargo fmt
cargo clippy
and reports no warningsAcceptance tests
wait for a project maintainer to fulfill this section...