fix: setgroups(size=0) does not commit cleared groups back to the PCB#1852
fix: setgroups(size=0) does not commit cleared groups back to the PCB#1852Deepak8858 wants to merge 1 commit intoDragonOS-Community:masterfrom
Conversation
|
@claude review Look at this from an overall perspective to see if it's reasonable. |
|
Claude finished @fslongjin's task in 4m 36s —— View job Claude Code ReviewI'll review the PR #1852 fix for setgroups(idempotency) from an overall perspective. Tasks:
1. Bug AnalysisThe bug was in
The diff shows the fix adds the missing assignment: *pcb.cred.lock() = Cred::new_arc(cred);This ensures the cleared groups are persisted. The bug only affected the Why this matters: Without the fix, 2. Fix Correctness Assessment✅ The fix is correct: It adds the missing credential persistence step, matching the pattern used in the Locking considerations:
Alternative approach: For the Credential handling: The use of Edge cases covered:
Conclusion: The fix correctly addresses the bug without introducing new issues. 3. Similar Patterns in Other SyscallsI examined all credential-modifying syscalls that use
Findings:
The 4. Overall Assessment and RecommendationsVerdict: ✅ The PR is correct and ready to merge. The fix addresses a real bug where Strengths:
Potential Improvements (optional):
Testing considerations: While not required for this PR, adding a unit test for Final recommendation: Merge this PR as it stands. The fix is correct, minimal, and addresses the reported issue. |

Fixes #1838
Calling setgroups(0, NULL) was modifying a local copy of credentials but not writing them back to the PCB. This fix ensures the updated credentials are persisted.