Commit d03d3d61 authored by Martin Pitt's avatar Martin Pitt

Change all "su" invocations to system user to specify an explicit shell,

to fix breakage after latest base-passwd 3.5.30 (which changed system
users to have no shell).
parent 24690301
...@@ -6,6 +6,9 @@ postgresql-common (152) UNRELEASED; urgency=low ...@@ -6,6 +6,9 @@ postgresql-common (152) UNRELEASED; urgency=low
* Drop support for obsolete oom_adj, all kernels in all supported * Drop support for obsolete oom_adj, all kernels in all supported
Debian/Ubuntu releases support oom_score_adj. (See #646245) Debian/Ubuntu releases support oom_score_adj. (See #646245)
* debian/README.Debian: Fix commands to get a postgres user shell. * debian/README.Debian: Fix commands to get a postgres user shell.
* Change all "su" invocations to system user to specify an explicit shell,
to fix breakage after latest base-passwd 3.5.30 (which changed system
users to have no shell).
[ Christoph Berg ] [ Christoph Berg ]
* pg_virtualenv: Fix program name in manpage. * pg_virtualenv: Fix program name in manpage.
......
...@@ -35,7 +35,7 @@ Please fix this and reinstall this package." >&2 ...@@ -35,7 +35,7 @@ Please fix this and reinstall this package." >&2
# ensure home directory ownership # ensure home directory ownership
mkdir -p /var/lib/postgresql mkdir -p /var/lib/postgresql
su - postgres -c "test -O /var/lib/postgresql && su -s /bin/sh - postgres -c "test -O /var/lib/postgresql &&
test -G /var/lib/postgresql" || \ test -G /var/lib/postgresql" || \
chown postgres:postgres /var/lib/postgresql chown postgres:postgres /var/lib/postgresql
......
...@@ -14,7 +14,7 @@ use PgCommon; ...@@ -14,7 +14,7 @@ use PgCommon;
my $shellaction = '#!/bin/sh my $shellaction = '#!/bin/sh
S=`basename $0` S=`basename $0`
su postgres <<EOF su -s /bin/sh postgres <<EOF
psql --cluster "$1/$2" db1 -c "INSERT INTO log VALUES (\'$S $1 $2 $3\')" psql --cluster "$1/$2" db1 -c "INSERT INTO log VALUES (\'$S $1 $2 $3\')"
EOF EOF
'; ';
......
...@@ -10,7 +10,7 @@ my $version = $MAJORS[0]; ...@@ -10,7 +10,7 @@ my $version = $MAJORS[0];
use Test::More tests => 30; use Test::More tests => 30;
# prepare nobody-owned root dir for $PG_CLUSTER_CONF_ROOT # prepare nobody-owned root dir for $PG_CLUSTER_CONF_ROOT
my $rootdir=`su -c 'mktemp -d' nobody`; my $rootdir=`su -s /bin/sh -c 'mktemp -d' nobody`;
chomp $rootdir; chomp $rootdir;
($rootdir) = $rootdir =~ m!^([a-zA-Z0-9._/]+)$!; # untaint ($rootdir) = $rootdir =~ m!^([a-zA-Z0-9._/]+)$!; # untaint
$ENV{'PG_CLUSTER_CONF_ROOT'} = "$rootdir/etc"; $ENV{'PG_CLUSTER_CONF_ROOT'} = "$rootdir/etc";
......
...@@ -13,7 +13,7 @@ use PgCommon; ...@@ -13,7 +13,7 @@ use PgCommon;
my $v = $MAJORS[-1]; my $v = $MAJORS[-1];
# prepare nobody-owned work dir # prepare nobody-owned work dir
my $workdir=`su -c 'mktemp -d' nobody`; my $workdir=`su -s /bin/sh -c 'mktemp -d' nobody`;
chomp $workdir; chomp $workdir;
chdir $workdir or die "could not chdir to $workdir: $!"; chdir $workdir or die "could not chdir to $workdir: $!";
......
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