about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2001-10-22 19:40:45 +0000
committerGraham Barr <gbarr@pobox.com>2001-10-22 19:40:45 +0000
commit22849b580fa5f9f198cdb454d36632b497807ae9 (patch)
treeb522022d1309ed20ba51185fde0e76910f0a2f01
parent6f1bb6605e79094c7555c5f616e09c20105569fd (diff)
downloadperl-libnet-22849b580fa5f9f198cdb454d36632b497807ae9.tar.gz
Net::Config
- Protect eval's from user defining $SIG{__DIE__}

-rw-r--r--Net/Config.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/Net/Config.pm b/Net/Config.pm
index 793a683..5a262fd 100644
--- a/Net/Config.pm
+++ b/Net/Config.pm
@@ -13,7 +13,7 @@ use strict;
 
 @EXPORT  = qw(%NetConfig);
 @ISA     = qw(Net::LocalCfg Exporter);
-$VERSION = "1.07"; # $Id: //depot/libnet/Net/Config.pm#12 $
+$VERSION = "1.08"; # $Id: //depot/libnet/Net/Config.pm#13 $
 
 eval { local $SIG{__DIE__}; require Net::LocalCfg };
 
@@ -37,18 +37,18 @@ my $file = __FILE__;
 my $ref;
 $file =~ s/Config.pm/libnet.cfg/;
 if ( -f $file ) {
-    $ref = eval { do $file };
+    $ref = eval { local $SIG{__DIE__}; do $file };
     if (ref($ref) eq 'HASH') {
         %NetConfig = (%NetConfig, %{ $ref });
         $LIBNET_CFG = $file;
     }
 }
 if ($< == $> and !$CONFIGURE)  {
-    my $home = eval { (getpwuid($>))[7] } || $ENV{HOME};
+    my $home = eval { local $SIG{__DIE__}; (getpwuid($>))[7] } || $ENV{HOME};
     $home ||= $ENV{HOMEDRIVE} . ($ENV{HOMEPATH}||'') if defined $ENV{HOMEDRIVE};
     if (defined $home) {
         $file = $home . "/.libnetrc";
-        $ref = eval { do $file } if -f $file;
+        $ref = eval { local $SIG{__DIE__}; do $file } if -f $file;
         %NetConfig = (%NetConfig, %{ $ref })
             if ref($ref) eq 'HASH';        
     }
@@ -285,6 +285,6 @@ If true then C<Configure> will check each hostname given that it exists
 
 =for html <hr>
 
-I<$Id: //depot/libnet/Net/Config.pm#12 $>
+I<$Id: //depot/libnet/Net/Config.pm#13 $>
 
 =cut