Merge ~ahasenack/ubuntu/+source/postfix:postfix-postconf-segfault-1753470 into ubuntu/+source/postfix:ubuntu/devel

Proposed by Andreas Hasenack
Status: Merged
Merge reported by: Christian Ehrhardt 
Merged at revision: 73cb543efe06a340021cbf538d3ca88abfd96bd8
Proposed branch: ~ahasenack/ubuntu/+source/postfix:postfix-postconf-segfault-1753470
Merge into: ubuntu/+source/postfix:ubuntu/devel
Diff against target: 56 lines (+34/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/fix-postconf-segfault.diff (+25/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
Canonical Server Pending
Review via email: mp+345296@code.launchpad.net

Commit message

  * debian/patches/fix-postconf-segfault.diff: Fix a postconf segfault
    when map file cannot be read. Thanks to Viktor Dukhovni <postfix-
    <email address hidden>>. (LP: #1753470)

Description of the change

Steps to reproduce:

sudo apt install postfix
echo "virtual_alias_maps = pgsql:/etc/postfix/valiases.cf" | sudo tee -a /etc/postfix/main.cf
sudo truncate -s 0 /etc/postfix/valiases.cf
sudo chmod 0600 /etc/postfix/valiases.cf
postconf <--- segfaults as a regular user who cannot read the valiases.cf file

PPA with a fixed package:
sudo add-apt-repository -y -u ppa:ahasenack/postfix-postconf-segfault-1753470
sudo apt dist-upgrade
postconf <--- outputs the configuration, ignoring the EACCES error

The patch from Viktor at https://marc.info/?l=postfix-users&m=152578771531514&w=2 was ACK'ed by Wietse in https://marc.info/?l=postfix-users&m=152584869731079&w=2

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

- Confirmed the error exists and is reproducible
- Confirmed the test build in the ppa fixes the issue
- changelog ok
- version number ok
- Thanks for already having a Debian bug and upstream discussion
- patch LGTM as well (it is not yet upstream but as close as it can be)

Keep in mind that we might need to adapt if upstream changes its mind on it.
But for Cosmic this should be fine where we can re-roll fast and OTOH before the SRU to Bionic happens we have a few days of push/build/test/prep/SRU-review ... until then you'll know if upstream changed the approach to fix it.

Ack for the MP here +1

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

When you have a moment, could you please push the upload tag and dput the package? Thanks

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

On Wed, May 9, 2018 at 7:21 PM, Andreas Hasenack <email address hidden>
wrote:

> When you have a moment, could you please push the upload tag and dput the
> package? Thanks
>

Seems I came by IRC in the right moment: tagged, pushed and sponsored.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 6d9e675..b5f577c 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+postfix (3.3.0-1ubuntu1) cosmic; urgency=medium
7+
8+ * debian/patches/fix-postconf-segfault.diff: Fix a postconf segfault
9+ when map file cannot be read. Thanks to Viktor Dukhovni <postfix-
10+ users@dukhovni.org>. (LP: #1753470)
11+
12+ -- Andreas Hasenack <andreas@canonical.com> Wed, 09 May 2018 09:51:09 -0300
13+
14 postfix (3.3.0-1) unstable; urgency=medium
15
16 [Wietse Venema]
17diff --git a/debian/patches/fix-postconf-segfault.diff b/debian/patches/fix-postconf-segfault.diff
18new file mode 100644
19index 0000000..f8eef6b
20--- /dev/null
21+++ b/debian/patches/fix-postconf-segfault.diff
22@@ -0,0 +1,25 @@
23+Description: Fix a postconf segfault when map file cannot be read
24+Author: Viktor Dukhovni <postfix-users@dukhovni.org>
25+Origin: https://marc.info/?l=postfix-users&m=152578771531514&w=2
26+Bug-Debian: https://bugs.debian.org/898271
27+Bug-Ubuntu: https://launchpad.net/bugs/1753470
28+Last-Update: 2018-05-09
29+---
30+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
31+--- a/src/postconf/postconf_dbms.c
32++++ b/src/postconf/postconf_dbms.c
33+@@ -174,10 +174,10 @@
34+ */
35+ dict = dict_ht_open(dict_spec, O_CREAT | O_RDWR, 0);
36+ dict_register(dict_spec, dict);
37+- if ((fp = vstream_fopen(cf_file, O_RDONLY, 0)) == 0
38+- && errno != EACCES) {
39+- msg_warn("open \"%s\" configuration \"%s\": %m",
40+- dp->db_type, cf_file);
41++ if ((fp = vstream_fopen(cf_file, O_RDONLY, 0)) == 0) {
42++ if (errno != EACCES)
43++ msg_warn("open \"%s\" configuration \"%s\": %m",
44++ dp->db_type, cf_file);
45+ myfree(dict_spec);
46+ return;
47+ }
48diff --git a/debian/patches/series b/debian/patches/series
49index c2e4727..1f77ec0 100644
50--- a/debian/patches/series
51+++ b/debian/patches/series
52@@ -15,3 +15,4 @@
53 50_LANG.diff
54 70_postfix-check.diff
55 tls_version.diff
56+fix-postconf-segfault.diff

Subscribers

People subscribed via source and target branches