Merge ~athos-ribeiro/ubuntu/+source/postgresql-common:fix-set-conffile-regex-focal into ubuntu/+source/postgresql-common:ubuntu/focal-devel

Proposed by Athos Ribeiro
Status: Rejected
Rejected by: Andreas Hasenack
Proposed branch: ~athos-ribeiro/ubuntu/+source/postgresql-common:fix-set-conffile-regex-focal
Merge into: ubuntu/+source/postgresql-common:ubuntu/focal-devel
Diff against target: 107 lines (+26/-2)
3 files modified
PgCommon.pm (+2/-2)
debian/changelog (+6/-0)
t/005_PgCommon.t (+18/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Bryce Harrington (community) Approve
Canonical Server Reporter Pending
Review via email: mp+440667@code.launchpad.net

Description of the change

pg_conftool mistakes regular comments starting with a configuration option for actual commented configuration options.

While the issue does not impact any software features or its usability, it may lead to the deletion of useful comments or documentation in configuration files.

See LP: #2007794 for further reference.

PPA: https://launchpad.net/~athos-ribeiro/+archive/ubuntu/pg-fix-config-regex/+packages

DEP8 test results:

  - postgresql-common/214ubuntu0.2
    + ✅ postgresql-common on focal for amd64 @ 11.04.23 00:24:15 Log️ 🗒️
    + ✅ postgresql-common on focal for arm64 @ 11.04.23 00:38:32 Log️ 🗒️
    + ✅ postgresql-common on focal for armhf @ 11.04.23 00:22:30 Log️ 🗒️
    + ❌ postgresql-common on focal for i386 @ 11.04.23 00:29:50 Log️ 🗒️
      • default-psql FAIL 🟥
      • run-testsuite FAIL 🟥
    + ✅ postgresql-common on focal for ppc64el @ 11.04.23 00:26:19 Log️ 🗒️
    + ✅ postgresql-common on focal for s390x @ 11.04.23 00:49:50 Log️ 🗒️

The i386 failures are not regressions, as shown in https://autopkgtest.ubuntu.com/packages/p/postgresql-common/focal/i386

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Confirmed test results for focal. See karmic MP for further review comments.

  - postgresql-common/214ubuntu0.2
    + ✅ postgresql-common on focal for amd64 @ 11.04.23 00:24:15 Log️ 🗒️
    + ✅ postgresql-common on focal for arm64 @ 11.04.23 00:38:32 Log️ 🗒️
    + ✅ postgresql-common on focal for armhf @ 11.04.23 00:22:30 Log️ 🗒️
    + ❌ postgresql-common on focal for i386 @ 11.04.23 00:29:50 Log️ 🗒️
      • default-psql FAIL 🟥
      • run-testsuite FAIL 🟥
    + ✅ postgresql-common on focal for ppc64el @ 11.04.23 00:26:19 Log️ 🗒️
    + ✅ postgresql-common on focal for s390x @ 11.04.23 00:49:50 Log️ 🗒️

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: athos-ribeiro, bryce
Uploaders: athos-ribeiro, bryce
MP auto-approved

review: Approve
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks Bryce!

Uploaded:

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading postgresql-common_214ubuntu0.2.dsc: done.
  Uploading postgresql-common_214ubuntu0.2.tar.xz: done.
  Uploading postgresql-common_214ubuntu0.2_source.buildinfo: done.
  Uploading postgresql-common_214ubuntu0.2_source.changes: done.
Successfully uploaded packages.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

214ubuntu0.2 was never published, this link is a 404:

  https://launchpad.net/ubuntu/+source/postgresql-common/214ubuntu0.2

I see a rejection[1] notice;

  Rejected on 2023-05-19 by Steve Langasek
  rejected per uploader

The ubuntu/focal-devel git-ubuntu branch also does not have this version. Marking the MP as rejected.

1. https://launchpad.net/ubuntu/focal/+queue?queue_state=4&queue_text=postgresql-common

Unmerged commits

7f6a32f... by Athos Ribeiro

Update changelog

fd7a286... by Athos Ribeiro

    - Fix set_conffile_value comment parsing regular expression. (LP: #2007794)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/PgCommon.pm b/PgCommon.pm
index 2b7877d..ab6e8a2 100644
--- a/PgCommon.pm
+++ b/PgCommon.pm
@@ -255,8 +255,8 @@ sub set_conffile_value {
255 # of appending255 # of appending
256 if (!$found) {256 if (!$found) {
257 for (my $i=0; $i <= $#lines; ++$i) {257 for (my $i=0; $i <= $#lines; ++$i) {
258 if ($lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)/i or258 if ($lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)$/i or
259 $lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)/i) {259 $lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)$/i) {
260 $lines[$i] = "$1$2$value$3\n";260 $lines[$i] = "$1$2$value$3\n";
261 $found = 1;261 $found = 1;
262 last;262 last;
diff --git a/debian/changelog b/debian/changelog
index 53c844c..d0e7242 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
1postgresql-common (214ubuntu0.2) focal; urgency=medium
2
3 * Fix set_conffile_value comment parsing regular expression. (LP: #2007794)
4
5 -- Athos Ribeiro <athos.ribeiro@canonical.com> Mon, 10 Apr 2023 18:35:10 -0300
6
1postgresql-common (214ubuntu0.1) focal-security; urgency=medium7postgresql-common (214ubuntu0.1) focal-security; urgency=medium
28
3 [ Christoph Berg ]9 [ Christoph Berg ]
diff --git a/t/005_PgCommon.t b/t/005_PgCommon.t
index 22dcca8..e1bc337 100644
--- a/t/005_PgCommon.t
+++ b/t/005_PgCommon.t
@@ -102,6 +102,9 @@ print F <<EOF;
102102
103# Commented_Int = 12103# Commented_Int = 12
104# commented_str='foobar'104# commented_str='foobar'
105# commented_bool off
106# commented_bool2 off # comment
107# commented_bool3 just a comment
105108
106#intval = 1109#intval = 1
107Intval = 42110Intval = 42
@@ -194,6 +197,9 @@ is_deeply (\%conf, {
194# test set_conf_value()197# test set_conf_value()
195PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_int', '24';198PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_int', '24';
196PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_str', 'new foo';199PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_str', 'new foo';
200PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_bool', 'on';
201PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_bool2', 'on';
202PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_bool3', 'on';
197PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'intval', '39';203PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'intval', '39';
198PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'cintval', '5';204PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'cintval', '5';
199PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'strval', 'Howdy';205PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'strval', 'Howdy';
@@ -210,6 +216,9 @@ is ($conf, <<EOF, 'set_conf_value');
210216
211Commented_Int = 24217Commented_Int = 24
212commented_str='new foo'218commented_str='new foo'
219commented_bool on
220commented_bool2 on # comment
221# commented_bool3 just a comment
213222
214#intval = 1223#intval = 1
215Intval = 39224Intval = 39
@@ -223,6 +232,7 @@ cemptystr = '' # moo!
223#testpath = '/bin/bad'232#testpath = '/bin/bad'
224testpath = '/bin/new'233testpath = '/bin/new'
225QuoteStr = 'test ! -f \\'/tmp/%f\\' && echo \\'yes\\''234QuoteStr = 'test ! -f \\'/tmp/%f\\' && echo \\'yes\\''
235commented_bool3 = on
226newval = 'NEW!'236newval = 'NEW!'
227include_dir = 'conf.d'237include_dir = 'conf.d'
228EOF238EOF
@@ -241,6 +251,9 @@ is ($conf, <<EOF, 'disable_conf_value');
241251
242Commented_Int = 24252Commented_Int = 24
243commented_str='new foo'253commented_str='new foo'
254commented_bool on
255commented_bool2 on # comment
256# commented_bool3 just a comment
244257
245#intval = 1258#intval = 1
246#Intval = 39 #ints are out of fashion259#Intval = 39 #ints are out of fashion
@@ -254,6 +267,7 @@ cemptystr = '' # moo!
254#testpath = '/bin/bad'267#testpath = '/bin/bad'
255#testpath = '/bin/new' #now 2 comments268#testpath = '/bin/new' #now 2 comments
256QuoteStr = 'test ! -f \\'/tmp/%f\\' && echo \\'yes\\''269QuoteStr = 'test ! -f \\'/tmp/%f\\' && echo \\'yes\\''
270commented_bool3 = on
257newval = 'NEW!'271newval = 'NEW!'
258include_dir = 'conf.d'272include_dir = 'conf.d'
259EOF273EOF
@@ -272,6 +286,9 @@ is ($conf, <<EOF, 'replace_conf_value');
272286
273Commented_Int = 24287Commented_Int = 24
274commented_str='new foo'288commented_str='new foo'
289commented_bool on
290commented_bool2 on # comment
291# commented_bool3 just a comment
275292
276#intval = 1293#intval = 1
277#Intval = 39 #ints are out of fashion294#Intval = 39 #ints are out of fashion
@@ -286,6 +303,7 @@ cemptystr = '' # moo!
286#testpath = '/bin/bad'303#testpath = '/bin/bad'
287#testpath = '/bin/new' #now 2 comments304#testpath = '/bin/new' #now 2 comments
288QuoteStr = 'test ! -f \\'/tmp/%f\\' && echo \\'yes\\''305QuoteStr = 'test ! -f \\'/tmp/%f\\' && echo \\'yes\\''
306commented_bool3 = on
289newval = 'NEW!'307newval = 'NEW!'
290include_dir = 'conf.d'308include_dir = 'conf.d'
291EOF309EOF

Subscribers

People subscribed via source and target branches