Upgrading to GitLab 12.5.4.

Commit 21d2ca8b authored by Christoph Berg's avatar Christoph Berg

pg_createcluster, pg_ctlcluster: cd / to prevent warnings from PostgreSQL tools. (Closes: #834264)

parent 2ea7c2c8
......@@ -15,6 +15,8 @@ postgresql-common (183) UNRELEASED; urgency=medium
* pg_upgradecluster: Allow configuring the maintenance database.
(Closes: #851874)
* pg_dropcluster: Remove custom xlog directory. (Closes: #830789)
* pg_createcluster, pg_ctlcluster: cd / to prevent warnings from PostgreSQL
tools. (Closes: #834264)
-- Christoph Berg <myon@debian.org> Fri, 12 May 2017 21:18:03 +0200
......
......@@ -26,6 +26,8 @@ my @postgres_user = getpwnam 'postgres';
my %defaultconf;
my $explicit_auth_config = 0;
chdir '/';
# replace placeholders
# Arguments: <string> <version> <cluster>
sub replace_v_c ($$$) {
......
......@@ -32,6 +32,11 @@ my $mode = 'smart'; # default shutdown mode
my $foreground = 0; # don't daemonize, use postgres instead of pg_ctl
my $stdlog = 0; # when run in foreground, still log to the default logfile
# untaint environment
$ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
chdir '/';
# Putting recovery.conf into /etc/postgresql is a common mistake, error out
sub start_check_wrong_recovery_conf {
if (-f "$info{configdir}/recovery.conf" and # recovery.conf in config dir
......@@ -371,10 +376,6 @@ unless ($action eq 'stop') {
error 'Cluster is disabled' if $info{'start'} eq 'disabled';
}
# untaint environment
$ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
unless (-d $info{'pgdata'} && defined $info{'owneruid'}) {
error $info{'pgdata'} . ' is not accessible or does not exist';
}
......@@ -479,7 +480,6 @@ if ($> == 0) {
}
}
chdir ('/var/lib/postgresql');
change_ugid $info{'owneruid'}, $info{'ownergid'};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment