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
1diff --git a/PgCommon.pm b/PgCommon.pm
2index 2b7877d..ab6e8a2 100644
3--- a/PgCommon.pm
4+++ b/PgCommon.pm
5@@ -255,8 +255,8 @@ sub set_conffile_value {
6 # of appending
7 if (!$found) {
8 for (my $i=0; $i <= $#lines; ++$i) {
9- if ($lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)/i or
10- $lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)/i) {
11+ if ($lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)$/i or
12+ $lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)$/i) {
13 $lines[$i] = "$1$2$value$3\n";
14 $found = 1;
15 last;
16diff --git a/debian/changelog b/debian/changelog
17index 53c844c..d0e7242 100644
18--- a/debian/changelog
19+++ b/debian/changelog
20@@ -1,3 +1,9 @@
21+postgresql-common (214ubuntu0.2) focal; urgency=medium
22+
23+ * Fix set_conffile_value comment parsing regular expression. (LP: #2007794)
24+
25+ -- Athos Ribeiro <athos.ribeiro@canonical.com> Mon, 10 Apr 2023 18:35:10 -0300
26+
27 postgresql-common (214ubuntu0.1) focal-security; urgency=medium
28
29 [ Christoph Berg ]
30diff --git a/t/005_PgCommon.t b/t/005_PgCommon.t
31index 22dcca8..e1bc337 100644
32--- a/t/005_PgCommon.t
33+++ b/t/005_PgCommon.t
34@@ -102,6 +102,9 @@ print F <<EOF;
35
36 # Commented_Int = 12
37 # commented_str='foobar'
38+# commented_bool off
39+# commented_bool2 off # comment
40+# commented_bool3 just a comment
41
42 #intval = 1
43 Intval = 42
44@@ -194,6 +197,9 @@ is_deeply (\%conf, {
45 # test set_conf_value()
46 PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_int', '24';
47 PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_str', 'new foo';
48+PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_bool', 'on';
49+PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_bool2', 'on';
50+PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'commented_bool3', 'on';
51 PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'intval', '39';
52 PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'cintval', '5';
53 PgCommon::set_conf_value '8.4', 'test', 'foo.conf', 'strval', 'Howdy';
54@@ -210,6 +216,9 @@ is ($conf, <<EOF, 'set_conf_value');
55
56 Commented_Int = 24
57 commented_str='new foo'
58+commented_bool on
59+commented_bool2 on # comment
60+# commented_bool3 just a comment
61
62 #intval = 1
63 Intval = 39
64@@ -223,6 +232,7 @@ cemptystr = '' # moo!
65 #testpath = '/bin/bad'
66 testpath = '/bin/new'
67 QuoteStr = 'test ! -f \\'/tmp/%f\\' && echo \\'yes\\''
68+commented_bool3 = on
69 newval = 'NEW!'
70 include_dir = 'conf.d'
71 EOF
72@@ -241,6 +251,9 @@ is ($conf, <<EOF, 'disable_conf_value');
73
74 Commented_Int = 24
75 commented_str='new foo'
76+commented_bool on
77+commented_bool2 on # comment
78+# commented_bool3 just a comment
79
80 #intval = 1
81 #Intval = 39 #ints are out of fashion
82@@ -254,6 +267,7 @@ cemptystr = '' # moo!
83 #testpath = '/bin/bad'
84 #testpath = '/bin/new' #now 2 comments
85 QuoteStr = 'test ! -f \\'/tmp/%f\\' && echo \\'yes\\''
86+commented_bool3 = on
87 newval = 'NEW!'
88 include_dir = 'conf.d'
89 EOF
90@@ -272,6 +286,9 @@ is ($conf, <<EOF, 'replace_conf_value');
91
92 Commented_Int = 24
93 commented_str='new foo'
94+commented_bool on
95+commented_bool2 on # comment
96+# commented_bool3 just a comment
97
98 #intval = 1
99 #Intval = 39 #ints are out of fashion
100@@ -286,6 +303,7 @@ cemptystr = '' # moo!
101 #testpath = '/bin/bad'
102 #testpath = '/bin/new' #now 2 comments
103 QuoteStr = 'test ! -f \\'/tmp/%f\\' && echo \\'yes\\''
104+commented_bool3 = on
105 newval = 'NEW!'
106 include_dir = 'conf.d'
107 EOF

Subscribers

People subscribed via source and target branches