Skip to content

find: fix symbolic -perm matching for directories - #931

Merged
sylvestre merged 1 commit into
uutils:mainfrom
zhangpan2001:fix/930-perm-directory-symbolic-modes
Oct 29, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
zhangpan2001:fix/930-perm-directory-symbolic-modes

Conversation

@zhangpan2001

Copy link
Copy Markdown
Contributor

The directory mask was parsed using regular file rules, which made
-perm u=rwX match 0600 directories instead of 0700 directories.
Set the parser's directory flag so X and special bits follow directory
rules.

Add parser tests for directory masks and integration tests for all
three comparison forms. Include regular files and numeric modes as
controls.

Fixes #930

The directory mask was parsed using regular file rules, which made
-perm u=rwX match 0600 directories instead of 0700 directories.
Set the parser's directory flag so X and special bits follow directory
rules.

Add parser tests for directory masks and integration tests for all
three comparison forms. Include regular files and numeric modes as
controls.

Fixes uutils#930
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.66%. Comparing base (82cfc21) to head (674e8c9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #931      +/-   ##
==========================================
+ Coverage   92.65%   92.66%   +0.01%     
==========================================
  Files          37       37              
  Lines        7837     7851      +14     
  Branches      393      393              
==========================================
+ Hits         7261     7275      +14     
  Misses        435      435              
  Partials      141      141              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Oct 28, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 17.59%

2 warnings

⚠️ 15 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

⚡ 6 improved benchmarks
✅ 14 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ basename 19.9 ms 16.4 ms +21.3%
⚡ regex 30 ms 25.2 ms +18.97%
⚡ count_no_match 19 ms 16.1 ms +18.12%
⚡ ignore_case 19 ms 16.1 ms +18.04%
⚡ count_many 19.2 ms 16.3 ms +17.89%
⚡ split_null 7.4 ms 6.6 ms +11.45%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing zhangpan2001:fix/930-perm-directory-symbolic-modes (674e8c9) with main (82cfc21)

Open in CodSpeed

@github-actions

Copy link
Copy Markdown

Commit 674e8c9 has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 317 / PASSED: 279 / FAILED: 32 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 277 / FAILED: 34 / SKIPPED: 6

Changes from main branch:
  TOTAL: +0
  PASSED: +2
  FAILED: -2

Test improvements (2):
  + gnu/inum_automount
  + gnu/perm_symbolic_slash

1 similar comment
@github-actions

Copy link
Copy Markdown

Commit 674e8c9 has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 317 / PASSED: 279 / FAILED: 32 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 277 / FAILED: 34 / SKIPPED: 6

Changes from main branch:
  TOTAL: +0
  PASSED: +2
  FAILED: -2

Test improvements (2):
  + gnu/inum_automount
  + gnu/perm_symbolic_slash

@sylvestre
sylvestre merged commit 812e1a2 into uutils:main Oct 29, 2026
34 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

find: -perm u=rwX matches 0600 directories instead of 0700

2 participants