Closed MasaoFujii closed 1 year ago
Reproduced :heavy_check_mark:.
# After removing -c supautils.privileged_role=\"$privileged_role\" from shell.nix
$ supautils-with-pg-15 psql -U rolecreator
$ postgres=> create role foo;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: 2023-02-10 17:37:47.327 -05 [338570] LOG: server process (PID 338583) was terminated by signal 11: Segmentation fault
cc @soedirgo
With the setting supautils.privileged_role not set, supautils caused a segmentation fault when CREATE ROLE command was executed. ISTM that this happened because supautils_hook() unexpectedly passed "privileged_role" variable to get_role_oid() even though it's NULL. Attached patch fixes this bug.