mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Merge pull request #180 from zalando/bugfix/environment_leakage
Clear environment of PostgreSQL
This commit is contained in:
@@ -359,8 +359,9 @@ class Postgresql(object):
|
||||
if not block_callbacks:
|
||||
self.set_state('starting')
|
||||
|
||||
env = os.environ.copy()
|
||||
if 'username' in self.superuser:
|
||||
env = {'PATH': os.environ.get('PATH')}
|
||||
# pg_ctl will write a FATAL if the username is incorrect. exporting PGUSER if necessary
|
||||
if 'username' in self.superuser and self.superuser['username'] != os.environ.get('USER'):
|
||||
env['PGUSER'] = self.superuser['username']
|
||||
ret = subprocess.call(self._pg_ctl + ['start', '-o', self.server_options()], env=env, preexec_fn=os.setsid) == 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user