Skip to content

chgrp: reject the :gid format for the group operand - #15284

Open
vatsanbalaji-ossagent wants to merge 2 commits into
uutils:mainfrom
vatsanbalaji-ossagent:chgrp-colon-group
Open

vatsanbalaji-ossagent wants to merge 2 commits into
uutils:mainfrom
vatsanbalaji-ossagent:chgrp-colon-group

Conversation

@vatsanbalaji-ossagent

Copy link
Copy Markdown
Contributor

Currently, chgrp accepts group operands like :1000, even though GNU coreutils rejects this format. This change separates the group operand parsing from --from parsing, so the :gid syntax remains supported for --from but is rejected as a group operand. A regression test is also added to verify the behavior.

Closes #12792

🤖 Generated with Claude Code

GNU chgrp only accepts a group name or numeric ID as the group operand
and rejects ":1000" as an invalid group. Only --from accepts the :gid
format, so parse the operand separately and add a regression test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
}

#[test]
fn test_invalid_group_with_colon_prefix() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_numeric_group_formats still expects :gid to work as the target group, which is why CI is red. please update it

test_numeric_group_formats still passed ":gid" as the group operand,
which is now rejected. Use the plain numeric gid instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vatsanbalaji-ossagent

Copy link
Copy Markdown
Contributor Author

Thanks for catching this! test_numeric_group_formats was still using :gid as the target group. I've updated that step to use a plain numeric GID, so it still tests numeric group handling. The new test_invalid_group_with_colon_prefix test separately checks that :gid is rejected as a group operand.

I missed this locally because the test is skipped on macOS due to cfg(not(target_vendor = "apple")).

@codspeed

codspeed Bot commented Oct 13, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 22.05%

⚠️ 120 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 1 benchmark has no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 2 regressed benchmarks
✅ 398 untouched benchmarks
⏩ 70 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation factor_three_39_bit_primes 321.7 ms 597 ms -46.11%
❌ Simulation factor_five_38_bit_primes 1.5 s 1.8 s -15.51%
⚡ ⚠️ Simulation du_all_wide_tree[(5000, 500)] 35.7 ms 34.3 ms +4.02%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing vatsanbalaji-ossagent:chgrp-colon-group (2a0c5fc) with main (1747ba1)

Open in CodSpeed

Footnotes

  1. 70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch has not been deployed

No deployments
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.

gnucompability(chgrp): using :1000 as a group will get accepted by uutils one but will be rejected by gnu one

2 participants