You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2018/10/29 12:24:09 UTC
svn commit: r1845113 - /spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
Author: hege
Date: Mon Oct 29 12:24:08 2018
New Revision: 1845113
URL: http://svn.apache.org/viewvc?rev=1845113&view=rev
Log:
Load Sys::Hostname only if required, save a meg
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm?rev=1845113&r1=1845112&r2=1845113&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm Mon Oct 29 12:24:08 2018
@@ -68,7 +68,6 @@ use IO::Handle;
use File::Spec;
use File::Basename;
use Time::Local;
-use Sys::Hostname (); # don't import hostname() into this namespace!
use NetAddr::IP 4.000;
use Scalar::Util qw(tainted);
use Fcntl;
@@ -960,7 +959,8 @@ sub extract_ipv4_addr_from_string {
# Sys::Hostname thinks our hostname is, might also be a full qualified one)
sub hostname {
return $hostname if defined($hostname);
-
+ # Load only when required
+ require Sys::Hostname;
# Sys::Hostname isn't taint safe and might fall back to `hostname`. So we've
# got to clean PATH before we may call it.
clean_path_in_taint_mode();