You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2018/09/18 12:02:04 UTC

[Bug 7623] New: sa-update files with mirrors containing paths (or ports)

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7623

            Bug ID: 7623
           Summary: sa-update files with mirrors containing paths (or
                    ports)
           Product: Spamassassin
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: sa-update
          Assignee: dev@spamassassin.apache.org
          Reporter: manuel@mausz.at
  Target Milestone: Undefined

The DNS query introduced in
https://github.com/apache/spamassassin/commit/83bc5ea4062948f399ca1b96ea906314717850fe
fails if the update URL contains paths or ports. According to
https://wiki.apache.org/spamassassin/PublishingRuleUpdates this should be
supported.

Right now only the trailing slash + leading scheme will be removed. Optional
paths or ports will be passed together with the domain to do_dns_query. e.g.
"http://sa.zmi.at/sa-update-german/" will result in
do_dns_query("sa.zmi.at/sa-update-german"). Obviously this can't work and the
mirror will be marked as failed.

A quick fix would be using the URI module: $mirror = URI->new($mirror)->host

Do not know if this is available in all supported perl versions.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7623] sa-update files with mirrors containing paths (or ports)

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7623

andrew@topdog.za.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrew@topdog.za.net

--- Comment #1 from andrew@topdog.za.net ---
The following patch does work for me.

diff -ruN Mail-SpamAssassin-3.4.2.orig/sa-update.raw
Mail-SpamAssassin-3.4.2/sa-update.raw
--- Mail-SpamAssassin-3.4.2.orig/sa-update.raw  2018-09-14 03:27:51.000000000
+0200
+++ Mail-SpamAssassin-3.4.2/sa-update.raw       2018-09-27 18:07:22.339001090
+0200
@@ -1659,6 +1659,7 @@
     my($a_rr, $aaaa_rr);
       # RFC 3986:  scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
     $mirror =~ s{^[a-z][a-z0-9.+-]*://}{}si;  # strip scheme like http://
+    $mirror =~ s{(:[0-9]+)?(/.*)?$}{}si;      # strip port and path like
:8090/updatestage/
     return 1 if $have_inet4 && do_dns_query($mirror, "A");
     return 1 if $have_inet6 && do_dns_query($mirror, "AAAA");
     return 0;

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7623] sa-update files with mirrors containing paths (or ports)

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7623

Henrik Krohns <he...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |hege@hege.li

--- Comment #2 from Henrik Krohns <he...@hege.li> ---
Fixed

Sending        spamassassin-3.4/sa-update.raw
Sending        trunk/sa-update.raw
Transmitting file data ..done
Committing transaction...
Committed revision 1842303.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7623] sa-update files with mirrors containing paths (or ports)

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7623

--- Comment #3 from Henrik Krohns <he...@hege.li> ---
Ok might as well do it properly, before someone thinks of using IPv4 or IPv6
IP-address literals..

Sending        spamassassin-3.4/sa-update.raw
Sending        trunk/sa-update.raw
Transmitting file data ..done
Committing transaction...
Committed revision 1842321.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7623] sa-update files with mirrors containing paths (or ports)

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7623

Kevin A. McGrail <km...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kmcgrail@apache.org
           Severity|normal                      |blocker
   Target Milestone|Undefined                   |3.4.3

-- 
You are receiving this mail because:
You are the assignee for the bug.