> -----Original Message-----
> From: Jason Haar [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 02, 2004 5:36 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Qmail-scanner-general]hostname call
> 
> 
> On Tue, Jan 27, 2004 at 10:49:49AM +0000, Mark Powell wrote:
> > Hi,
> >   Is there any reason that the hostname cannot be discovered with:
> > 
> > use Sys::Hostname;
> > my $hostname = hostname;
> > 
> > rather than being hardcoded. When a new virus comes along (like 
> > ClamAV's
> 
> Unfortunately, "use Sys::Hostname" actually forks off a call 
> to "hostname" on most OSes. I didn't like that extra fork 
> being needed, so I hardwired it...
> 
> I understand your concern 'tho, maybe that optimization 
> should be dropped.
> 
> Is there anything other than $hostname that is hardwired?
> 

I dont really give a damn about the system hostname... we are using
qmail, therefore you should use /var/qmail/control/me

i change it to this...

# HOSTNAME GRABBED DYNAMICALLY
open(ME,"/var/qmail/control/me");
flock(ME,2);
my $temphost=<ME>;
close(ME);
$temphost =~ s/[^A-Za-z0-9\-\.]//g; # strip invalid chars
$temphost =~ m/(.*)/;  # gotta do it to make it taint safe.. blah
my $hostname = $1;

thats my opinion anyways :)






-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Qmail-scanner-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general

Reply via email to