From: Stephen L Johnson Date: Tue, 17 Apr 2001 02:58:12 +0000 (+0000) Subject: corrected sort array compare bug config file loading X-Git-Tag: spong-2_7_4~6 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc1e7bc6da9ae2ee90670807a6d1c3c10c40ff7c;p=spong.git corrected sort array compare bug config file loading --- diff --git a/src/spong-network.pl b/src/spong-network.pl index 5ae3e8c..4d91b6a 100755 --- a/src/spong-network.pl +++ b/src/spong-network.pl @@ -17,7 +17,7 @@ # (2) Converted checks to new plugin mechanism (Stephen Johnson May 28, 1999) # Added user-configurable escalation mechanism # -# $Id: spong-network.pl,v 1.33 2001/04/17 02:30:17 sljohnson Exp $ +# $Id: spong-network.pl,v 1.34 2001/04/17 02:58:12 sljohnson Exp $ use Carp; use lib "@@LIBDIR@@"; @@ -463,7 +463,7 @@ sub load_config_files { # Fallback, if we didn't read things correctly... - if( sort @HOSTS_LIST != sort keys %HOSTS ) { + if( sort ( @HOSTS_LIST ) != sort ( keys %HOSTS ) ) { @HOSTS_LIST = sort keys %HOSTS; } &debug( "host file loaded" ); } diff --git a/src/spong-server.pl b/src/spong-server.pl index 5156d15..a680057 100755 --- a/src/spong-server.pl +++ b/src/spong-server.pl @@ -6,7 +6,7 @@ # There are one or more update processes that listen for status updates # from client programs. -# $Id: spong-server.pl,v 1.40 2001/03/26 19:22:52 sljohnson Exp $ +# $Id: spong-server.pl,v 1.41 2001/04/17 02:58:12 sljohnson Exp $ use lib "@@LIBDIR@@"; @@ -1232,7 +1232,7 @@ sub load_config_files { # Fallback, if we didn't read things correctly... - if( sort @HOSTS_LIST != sort keys %HOSTS ) { + if( sort ( @HOSTS_LIST ) != sort ( keys %HOSTS ) ) { @HOSTS_LIST = sort keys %HOSTS; } # Do the same thing for the groups file. @@ -1248,7 +1248,7 @@ sub load_config_files { close( GROUPS ); eval $evalme || die "Invalid spong.groups file: $@"; - if( sort @GROUPS_LIST != sort keys %GROUPS ) { + if( sort ( @GROUPS_LIST ) != sort ( keys %GROUPS ) ) { @GROUPS_LIST = sort keys %GROUPS; } } diff --git a/src/wap-spong.pl b/src/wap-spong.pl index a9d44a2..b6c139a 100644 --- a/src/wap-spong.pl +++ b/src/wap-spong.pl @@ -663,7 +663,7 @@ sub load_config_files { # Fallback, if we didn't read things correctly... - if( sort @HOSTS_LIST != sort keys %HOSTS ) { + if( sort ( @HOSTS_LIST ) != sort ( keys %HOSTS ) ) { @HOSTS_LIST = sort keys %HOSTS; } # Do the same thing for the groups file. @@ -679,7 +679,7 @@ sub load_config_files { close( GROUPS ); eval $evalme || die "Invalid spong.groups file: $@"; - if( sort @GROUPS_LIST != sort keys %GROUPS ) { + if( sort ( @GROUPS_LIST ) != sort ( keys %GROUPS ) ) { @GROUPS_LIST = sort keys %GROUPS; } } diff --git a/src/www-spong-ack.pl b/src/www-spong-ack.pl index e5fdacb..e4bf6d7 100755 --- a/src/www-spong-ack.pl +++ b/src/www-spong-ack.pl @@ -11,7 +11,7 @@ # History # (1) Created, pulled out of www-spong program (Ed 07-28-97) # -# $Id: www-spong-ack.pl,v 1.8 2000/11/06 19:39:06 sljohnson Exp $ +# $Id: www-spong-ack.pl,v 1.9 2001/04/17 02:58:12 sljohnson Exp $ use CGI; use Sys::Hostname; @@ -325,7 +325,7 @@ sub load_config_files { # Fallback, if we didn't read things correctly... - if( sort @HOSTS_LIST != sort keys %HOSTS ) { + if( sort ( @HOSTS_LIST ) != sort ( keys %HOSTS ) ) { @HOSTS_LIST = sort keys %HOSTS; } # Do the same thing for the groups file. @@ -341,7 +341,7 @@ sub load_config_files { close( GROUPS ); eval $evalme || die "Invalid spong.groups file: $@"; - if( sort @GROUPS_LIST != sort keys %GROUPS ) { + if( sort ( @GROUPS_LIST ) != sort ( keys %GROUPS ) ) { @GROUPS_LIST = sort keys %GROUPS; } } diff --git a/src/www-spong.pl b/src/www-spong.pl index 077b1e5..94dff38 100755 --- a/src/www-spong.pl +++ b/src/www-spong.pl @@ -12,7 +12,7 @@ # (3) Re-did as a client which gets info from the spong-server (07/24/1997) # (4) Did a whole bunch of stuff (Ed Hill, 06/18/1998) # -# $Id: www-spong.pl,v 1.19 2000/11/21 18:27:07 sljohnson Exp $ +# $Id: www-spong.pl,v 1.20 2001/04/17 02:58:12 sljohnson Exp $ use Sys::Hostname; use Getopt::Long; @@ -637,7 +637,7 @@ sub load_config_files { # Fallback, if we didn't read things correctly... - if( sort @HOSTS_LIST != sort keys %HOSTS ) { + if( sort ( @HOSTS_LIST ) != sort ( keys %HOSTS ) ) { @HOSTS_LIST = sort keys %HOSTS; } # Do the same thing for the groups file. @@ -653,7 +653,7 @@ sub load_config_files { close( GROUPS ); eval $evalme || die "Invalid spong.groups file: $@"; - if( sort @GROUPS_LIST != sort keys %GROUPS ) { + if( sort ( @GROUPS_LIST ) != sort ( keys %GROUPS ) ) { @GROUPS_LIST = sort keys %GROUPS; } }