Merge ~paride/ubuntu/+source/postfix:lp1906970-impish into ubuntu/+source/postfix:ubuntu/devel

Proposed by Paride Legovini
Status: Merged
Approved by: Sergio Durigan Junior
Approved revision: fabf04ebd52a1b74ec08483de67d16a036bbb627
Merged at revision: fabf04ebd52a1b74ec08483de67d16a036bbb627
Proposed branch: ~paride/ubuntu/+source/postfix:lp1906970-impish
Merge into: ubuntu/+source/postfix:ubuntu/devel
Diff against target: 42 lines (+10/-2)
3 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/postfix.postinst (+1/-1)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior (community) Approve
git-ubuntu developers Pending
Review via email: mp+406805@code.launchpad.net

Commit message

d/postfix.postinst: tolerate search domain with a leading dot

Search domain with a leading dot cause postfix.postinst to fail because it constructs a 'myhostname' with a duplicate dot (see #991950).

The glibc resolver tolerates such domains and strips the leading dot from the search domain [1]. This change makes postfix.postinst do the same.

This same fix has been proposed for inclusion in Debian [2].

[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=resolv/res_query.c;h=ebbe5a6a4ed86abe3fccd4a134bfcf6f613c9bbb;hb=HEAD#l411
[2] https://salsa.debian.org/postfix-team/postfix-dev/-/merge_requests/12

Closes: #991950, LP: #1906970

To post a comment you must log in.
Revision history for this message
Paride Legovini (paride) wrote (last edit ):

Test PPA: https://launchpad.net/~paride/+archive/ubuntu/postfix-lp1906970

Test case:

1. Start an Impish LXD container
2. Edit /etc/resolv.conf and add search line like one of these:

     search .
     search .foo.bar
     domain .foo.bar

3. Install postfix from the archive, accept all the debconf defaults,
   and verify that postinst fails with a broken domain name.
4. Purge postfix and reinstall from the test PPA.
5. Verify that the installation succeeds.
6. Verify that `myhostname` in /etc/postfix/main.cf is sane.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

I'm taking this one.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the MP, Paride.

I agree with the rationale and the proposed change here. I think it makes sense to adjust the postinst file to disregard the leading dot.

I'm approving the MP, but I'd like to leave a few comments:

1) I think you forgot to add the leading "#" on the bug number in the d/changelog entry...?

2) It's a good practice to post the autopkgtest results when you're filing the MP. More often than not I will re-run the tests anyway, but it's still a good indicator that you double checked for regressions and such :-). FWIW, I ran the tests locally and verified that everything seems OK.

3) This is one of those uploads that make you think whether it makes more sense to wait until Debian accepts the change, instead of adding a delta to the Ubuntu package. In this particular case, I am convinced that it makes sense to go ahead and upload this because (a) I think (hope!) that Debian won't take long to incorporate this change, and (b) it will help with your core-dev application :-).

So, having said all that, I will wait until your reply regarding the missing "#" before I proceed with the sponsorship.

Thanks!

review: Approve
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Looks like this fix also takes care of LP: #1934381, doesn't it? If it does, maybe it's worth adding to the d/ch entry *or* mark this as the duplicate of the bug that's being fixed.

Either way, thank you, Paride.

Revision history for this message
Paride Legovini (paride) wrote :

Thanks Sergio for reviewing!

1) Good catch, d/changelog updated.

2) Noted, I did run the autopkgtests locally, next time I'll also copypaste the results.

@Utkarsh: I marked LP: #1934381 as a duplicate (as it's newer). Thanks for mentioning it!

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Awesome, thank you Paride.

Uploaded:

$ git push pkg upload/3.5.6-1ubuntu1
Enumerating objects: 18, done.
Counting objects: 100% (18/18), done.
Delta compression using up to 8 threads
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 1.87 KiB | 382.00 KiB/s, done.
Total 13 (delta 9), reused 0 (delta 0)
To ssh://git.launchpad.net/ubuntu/+source/postfix
 * [new tag] upload/3.5.6-1ubuntu1 -> upload/3.5.6-1ubuntu1

$ dput postfix_3.5.6-1ubuntu1_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/postfix/postfix_3.5.6-1ubuntu1_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/postfix/postfix_3.5.6-1ubuntu1.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading postfix_3.5.6-1ubuntu1.dsc: done.
  Uploading postfix_3.5.6-1ubuntu1.debian.tar.xz: done.
  Uploading postfix_3.5.6-1ubuntu1_source.buildinfo: done.
  Uploading postfix_3.5.6-1ubuntu1_source.changes: done.
Successfully uploaded packages.

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 f08a6f5..e61e3c4 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+postfix (3.5.6-1ubuntu1) impish; urgency=medium
7+
8+ * d/postfix.postinst: tolerate search domain with a leading dot
9+ (LP: #1906970)
10+
11+ -- Paride Legovini <paride@ubuntu.com> Fri, 06 Aug 2021 17:56:03 +0200
12+
13 postfix (3.5.6-1build1) impish; urgency=medium
14
15 * No-change rebuild due to OpenLDAP soname bump.
16diff --git a/debian/control b/debian/control
17index 5e9a483..3288242 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -1,7 +1,8 @@
21 Source: postfix
22 Section: mail
23 Priority: optional
24-Maintainer: LaMont Jones <lamont@debian.org>
25+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
26+XSBC-Original-Maintainer: LaMont Jones <lamont@debian.org>
27 Uploaders: Scott Kitterman <scott@kitterman.com>
28 Standards-Version: 4.5.0
29 Homepage: http://www.postfix.org
30diff --git a/debian/postfix.postinst b/debian/postfix.postinst
31index dc28f3c..9ba7eac 100644
32--- a/debian/postfix.postinst
33+++ b/debian/postfix.postinst
34@@ -49,7 +49,7 @@ myfqdn() {
35 if [ $myhostname = ${myhostname%.*} ]; then
36 if [ -f /etc/resolv.conf ]; then
37 # The resolver uses the last one found, and ignores the rest
38- mydom=$(sed -n 's/^search[[:space:]]*\([^[:space:]]*\).*/\1/p;s/^domain[[:space:]]*\([^[:space:]]*\).*/\1/p' /etc/resolv.conf | tail -1)
39+ mydom=$(sed -n 's/^search[[:space:]]*\.*\([^[:space:]]*\).*/\1/p;s/^domain[[:space:]]*\.*\([^[:space:]]*\).*/\1/p' /etc/resolv.conf | tail -1)
40 myhostname="$myhostname${mydom:+.$mydom}"
41 else
42 myhostname="$myhostname.UNKNOWN"

Subscribers

People subscribed via source and target branches