Commit 242007f3 authored by Martin Pitt's avatar Martin Pitt

pg_createcluster: Fix test if specified owner/group ID is numeric. Thanks

Sven Berkvens-Matthijsse! (LP: #1329227)
parent b9718e9c
......@@ -3,6 +3,8 @@ postgresql-common (160) UNRELEASED; urgency=medium
* supported-versions: Set 9.4 as default for Ubuntu 14.10.
* debian/maintscripts-functions: Call update-alternatives under C locale to
fix parsing for non-English locales. (LP: #1293596)
* pg_createcluster: Fix test if specified owner/group ID is numeric. Thanks
Sven Berkvens-Matthijsse! (LP: #1329227)
-- Martin Pitt <mpitt@debian.org> Sat, 26 Jul 2014 18:48:39 +0200
......
......@@ -262,7 +262,7 @@ error "Invalid --start-conf value: $startconf" if $startconf ne 'auto' &&
$startconf ne 'manual' && $startconf ne 'disabled';
if ($owneruid) {
$owneruid = (getpwnam $owneruid)[2] unless $owneruid =~ /\d+/;
$owneruid = (getpwnam $owneruid)[2] unless $owneruid =~ /^\d+$/;
} elsif ($> == 0) {
$owneruid = getpwnam 'postgres';
error 'User postgres does not exist' unless $owneruid;
......@@ -272,7 +272,7 @@ if ($owneruid) {
}
if ($ownergid) {
$ownergid = (getgrnam $ownergid)[2] unless $ownergid =~ /\d+/;
$ownergid = (getgrnam $ownergid)[2] unless $ownergid =~ /^\d+$/;
} else {
$ownergid = (getpwuid $owneruid)[3];
}
......
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