Skip to content

Restore user ID when credential request fails - #70

Open
leesonthenet wants to merge 1 commit into
dhleong:mainfrom
leesonthenet:fix-root-uid-restoration
Open

Restore user ID when credential request fails#70
leesonthenet wants to merge 1 commit into
dhleong:mainfrom
leesonthenet:fix-root-uid-restoration

Conversation

@leesonthenet

Copy link
Copy Markdown

RootManagingCredentialRequester restores the original user ID after credential acquisition succeeds, but previously skipped that restoration if the delegated credential request threw an error.

This changes the delegation to use try/finally, ensuring the configured user ID is restored on both success and failure.

A regression test verifies that process.setuid() is called when credential acquisition fails and that the original error is preserved.

Validation:

  • npm run check
  • 38 tests passing

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.

1 participant