Skip to content

fix(occ): set GID before UID to ensure success#60331

Merged
AndyScherzinger merged 1 commit into
masterfrom
jtr/fix-occ-gid-before-uid
Jun 11, 2026
Merged

fix(occ): set GID before UID to ensure success#60331
AndyScherzinger merged 1 commit into
masterfrom
jtr/fix-occ-gid-before-uid

Conversation

@joshtrichards

@joshtrichards joshtrichards commented May 12, 2026

Copy link
Copy Markdown
Member

Summary

The previous implementation attempted to set GID after dropping root UID, which would fail (silently) and made the posix_setgid() call effectively a no-op. This swaps the order to set the target GID first.

Also refactored for clarity:

  • Renamed dropPrivileges to switchToConfigFileOwner for clearer intent
  • Update docblock to explicitly state best-effort limitations
  • Use more descriptive variable names
  • Re-organized for readability

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

The previous implementation attempted to set GID after dropping root UID, which would fail (silently) and made the posix_setgid() call effectively a no-op. This swaps the order to set the target GID first.

Also refactored for clarity:
- Renamed dropPrivileges to switchToConfigFileOwner for clearer intent
- Update docblock to explicitly state best-effort limitations
- Use more descriptive variable names
- Re-organized for readability

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 34 milestone May 12, 2026
@joshtrichards joshtrichards requested a review from a team as a code owner May 12, 2026 13:37
@joshtrichards joshtrichards requested review from Altahrim, ArtificialOwl and icewind1991 and removed request for a team May 12, 2026 13:37
Comment thread occ
@provokateurin provokateurin enabled auto-merge May 13, 2026 06:19
This was referenced Jun 5, 2026
@susnux susnux added the community pull requests from community label Jun 9, 2026
@susnux susnux modified the milestones: Nextcloud 34.0.1, Nextcloud 35 Jun 9, 2026
@come-nc come-nc added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jun 11, 2026
@AndyScherzinger AndyScherzinger disabled auto-merge June 11, 2026 09:12
@AndyScherzinger AndyScherzinger merged commit 19e90da into master Jun 11, 2026
160 of 183 checks passed
@AndyScherzinger AndyScherzinger deleted the jtr/fix-occ-gid-before-uid branch June 11, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish bug community pull requests from community feature: occ

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants