Skip to content

Conversation

@soedirgo
Copy link
Member

Ensure switch_to_original_role() gets called if an exception happens after switch_to_superuser() - otherwise is_switched_to_superuser is left in an inconsistent state.

Switch back to original role if needed if an exception happens during
superuser switch, otherwise `is_switched_to_superuser` becomes inconsistent
The variable is already `false` if it's in the `if` block
@soedirgo soedirgo changed the title Fix/handle exceptions during su switch fix: handle exceptions during superuser switch Nov 19, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19501006832

Details

  • 27 of 32 (84.38%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 88.502%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/supautils.c 27 32 84.38%
Totals Coverage Status
Change from base Build 19299320771: 0.4%
Covered Lines: 1016
Relevant Lines: 1148

💛 - Coveralls

@steve-chavez
Copy link
Member

I understand the logic, but I worry about the repetition of run_process_utility_hook_with_cleanup and if it's needed in every place. This retry might affect us in unexpected ways.

I have a WIP for #79, which should reduce the calls to run_process_utility_hook, gimme a couple of days to see if finishing that leads to a better solution.

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.

4 participants