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

Proposed by Karl Stenerud
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 4cc6d64c2f8b7d873b3af04286a9bf4e02c0ae11
Merge reported by: Andreas Hasenack
Merged at revision: 4cc6d64c2f8b7d873b3af04286a9bf4e02c0ae11
Proposed branch: ~kstenerud/ubuntu/+source/postfix:bionic-postconf-segfault-1753470
Merge into: ubuntu/+source/postfix:ubuntu/bionic-devel
Diff against target: 57 lines (+35/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/fix-postconf-segfault.diff (+26/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
Canonical Server Pending
Canonical Server Core Reviewers Pending
Review via email: mp+353267@code.launchpad.net

Description of the change

Cherry-picked existing cosmic fix from 8581dd80e48e4e9793236b178b5c9aceeb133966 in pkg/ubuntu/cosmic-devel:

          * 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)

    PPA: ppa:kstenerud/postfix-postconf-segfault-1753470

    Steps to test:

    # lxc launch ubuntu:bionic builder
    # lxc exec builder bash

    # apt dist-upgrade
    # apt install -y postfix
    # touch /etc/postfix/valiases.cf
    # chmod 0600 /etc/postfix/valiases.cf
    # echo "virtual_alias_maps = pgsql:/etc/postfix/valiases.cf" >> /etc/postfix/main.cf
    # su - ubuntu
    $ /usr/sbin/postconf virtual_alias_map

    * This should crash.

    # sudo add-apt-repository -y ppa:kstenerud/postfix-postconf-segfault-1753470
    # sudo apt upgrade
    /usr/sbin/postconf virtual_alias_map

    * This should not crash.

    Package Test Results:

    autopkgtest [11:15:08]: test postfix: - - - - - - - - - - results - - - - - - - - - -
    postfix PASS
    autopkgtest [11:15:09]: @@@@@@@@@@@@@@@@@@@@ summary
    postfix PASS

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

Hi Karl,
I think in the meantime the patch is accepted upstream and you could mark that in the patch if you want.

Dep3 has for this:
+ * `Applied-Upstream` (optional)
+
+ This field can be used to document the fact that the patch has been
+ applied upstream. It may contain the upstream version expected to
+ contain this patch, or the URL or commit identifier of the upstream
+ commit (with commit identifiers prefixed with "commit:", as in the
+ `Origin` field), or both separated by a comma and a space.

Other than it looks good to me.

For next time it would be great if you could trow also a link to a ppa with the changes built in here so I can retest without rebuilding on my own, but that isn't critical atm.

Further the Author in your commits is still set up as:
  Karl Stenerud <email address hidden>
That is fine if intentional, knowing it is the first I wanted to ask if you wanted to switch to the @canonical address for these?

The patch itself applies as-is without fuzz, builds and works.

Need-Info until the few things mentioned are clarified, but overall LGTM

review: Needs Information
Revision history for this message
Karl Stenerud (kstenerud) wrote :

I've modified the commit to include Applied-Upstream, and fixed the email address.

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

Thanks, it now LGTM

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

Also the bug has a IMHO valid SRU Template, so this is ok for sponsoring now

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

You actually had the email "in" the changelog right before
   7 -- Karl Stenerud <email address hidden> Thu, 16 Aug 2018 11:33:00 -0700
The commit still is at:
commit e8d659e4f5db16a513f84c6ca6185546a0937cd9 (HEAD, kstenerud/bionic-postconf-segfault-1753470)
Author: Karl Stenerud <email address hidden>
Date: Thu Aug 16 11:51:28 2018 -0700

So which one did you change?
This is what is currently pushed at https://git.launchpad.net/~kstenerud/ubuntu/+source/postfix/commit/?id=e8d659e4f5db16a513f84c6ca6185546a0937cd9

See the diff of committer and author?

This isn't critical, but probably good to sort out never the less.
Back to needs info as I want to avoid tagging and sponsoring not what you intended.

review: Needs Information
Revision history for this message
Karl Stenerud (kstenerud) wrote :

OK, got the author updated correctly this time!

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

Ok, thanks now it looks good

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

This is one of the packages refusing to be tagged.
I shoved it through another lintian check and sponsored it.

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading postfix_3.3.0-1ubuntu0.1.dsc: done.
  Uploading postfix_3.3.0-1ubuntu0.1.debian.tar.xz: done.
  Uploading postfix_3.3.0-1ubuntu0.1_source.buildinfo: done.
  Uploading postfix_3.3.0-1ubuntu0.1_source.changes: done.
Successfully uploaded packages.

Please set to merged once accepted by the SRU Team.

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..349fa4f 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+postfix (3.3.0-1ubuntu0.1) bionic; 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+ -- Karl Stenerud <karl.stenerud@canonical.com> Thu, 16 Aug 2018 11:33:00 -0700
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..20fc5bc
20--- /dev/null
21+++ b/debian/patches/fix-postconf-segfault.diff
22@@ -0,0 +1,26 @@
23+Description: Fix a postconf segfault when map file cannot be read
24+Author: Viktor Dukhovni <postfix-users@dukhovni.org>
25+Applied-Upstream: https://archive.mgm51.com/mirrors/postfix-source/official/postfix-3.3.1.tar.gz
26+Origin: https://marc.info/?l=postfix-users&m=152578771531514&w=2
27+Bug-Debian: https://bugs.debian.org/898271
28+Bug-Ubuntu: https://launchpad.net/bugs/1753470
29+Last-Update: 2018-08-20
30+---
31+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
32+--- a/src/postconf/postconf_dbms.c
33++++ b/src/postconf/postconf_dbms.c
34+@@ -174,10 +174,10 @@
35+ */
36+ dict = dict_ht_open(dict_spec, O_CREAT | O_RDWR, 0);
37+ dict_register(dict_spec, dict);
38+- if ((fp = vstream_fopen(cf_file, O_RDONLY, 0)) == 0
39+- && errno != EACCES) {
40+- msg_warn("open \"%s\" configuration \"%s\": %m",
41+- dp->db_type, cf_file);
42++ if ((fp = vstream_fopen(cf_file, O_RDONLY, 0)) == 0) {
43++ if (errno != EACCES)
44++ msg_warn("open \"%s\" configuration \"%s\": %m",
45++ dp->db_type, cf_file);
46+ myfree(dict_spec);
47+ return;
48+ }
49diff --git a/debian/patches/series b/debian/patches/series
50index c2e4727..1f77ec0 100644
51--- a/debian/patches/series
52+++ b/debian/patches/series
53@@ -15,3 +15,4 @@
54 50_LANG.diff
55 70_postfix-check.diff
56 tls_version.diff
57+fix-postconf-segfault.diff

Subscribers

People subscribed via source and target branches