mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Open trust in pg_hba.conf during bootstrap to localhost (#1075)
previously it was open by mistake to unix_socket only Fixes https://github.com/zalando/patroni/issues/1072
This commit is contained in:
@@ -152,10 +152,10 @@ class ConfigHandler(object):
|
||||
# and in order to be able to change it, we are opening trust access from a certain address
|
||||
if self._postgresql.bootstrap.running_custom_bootstrap:
|
||||
addresses = {'': 'local'}
|
||||
if 'host' in self._local_address and not self._local_address['host'].startswith('/'):
|
||||
for _, _, _, _, sa in socket.getaddrinfo(self._local_address['host'], self._local_address['port'],
|
||||
0, socket.SOCK_STREAM, socket.IPPROTO_TCP):
|
||||
addresses[sa[0] + '/32'] = 'host'
|
||||
if 'host' in self.local_replication_address and not self.local_replication_address['host'].startswith('/'):
|
||||
addresses.update({sa[0] + '/32': 'host' for _, _, _, _, sa in socket.getaddrinfo(
|
||||
self.local_replication_address['host'], self.local_replication_address['port'],
|
||||
0, socket.SOCK_STREAM, socket.IPPROTO_TCP)})
|
||||
|
||||
with open(self._pg_hba_conf, 'w') as f:
|
||||
f.write(self._CONFIG_WARNING_HEADER)
|
||||
|
||||
Reference in New Issue
Block a user