Hi,

While tryng the new v19 feature CREATE/ALTER SUBSCRIPTION ... SERVER,
I found that ALTER SUBSCRIPTION ... OWNER TO can change the effective
conninfo for a SERVER subscription, but does not validate the new owner's
generated conninfo with walrcv_check_conninfo().

As a result, the owner of a SERVER subscription with password_required=true
can be changed to a non-superuser whose generated connection string does not
contain a password. The ownership change succeeds, but the subscription is
left in a state that will fail later when a worker or another command tries to
connect.

Isn't this problematic?

The attached patch fixes this by making ALTER SUBSCRIPTION ... OWNER TO
validate the new owner's generated conninfo with walrcv_check_conninfo().
It also updates the ALTER SUBSCRIPTION documentation to mention
the SERVER-specific requirements for changing the owner.

Thought?

Regards,

-- 
Fujii Masao

Attachment: v1-0001-Validate-subscription-conninfo-on-owner-change.patch
Description: Binary data

Reply via email to