From: janw Date: Tue, 8 Apr 2008 10:12:58 +0000 (+0000) Subject: Fixed robustness.. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cb9af9baa8c60fbb85b9a09eb43838a89f5d3523;p=gosa.git Fixed robustness.. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10278 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index c8116dc93..d9bf2393d 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -150,7 +150,7 @@ sub check_cmdline_param () { sub read_configfile { my ($cfg_file, %cfg_defaults) = @_ ; my $cfg; - if( defined( $cfg_file) && ( length($cfg_file) > 0 )) { + if( defined( $cfg_file) && ( (-s $cfg_file) > 0 )) { if( -r $cfg_file ) { $cfg = Config::IniFiles->new( -file => $cfg_file ); } else { @@ -162,7 +162,7 @@ sub read_configfile { foreach my $section (keys %cfg_defaults) { foreach my $param (keys %{$cfg_defaults{ $section }}) { my $pinfo = $cfg_defaults{ $section }{ $param }; - ${@$pinfo[ 0 ]} = (defined($cfg))?$cfg->val( $section, $param, @$pinfo[ 1 ] ):${@$pinfo[ 0 ]} = @$pinfo[ 1 ]; + ${@$pinfo[ 0 ]} = $cfg->val( $section, $param, @$pinfo[ 1 ] ); } } } diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index d665e58c8..9d48dc4ff 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -241,7 +241,7 @@ EOF #=============================================================================== sub read_configfile { my $cfg; - if( defined( $cfg_file) && ( length($cfg_file) > 0 )) { + if( defined( $cfg_file) && ( (-s $cfg_file) > 0 )) { if( -r $cfg_file ) { $cfg = Config::IniFiles->new( -file => $cfg_file ); } else { @@ -253,7 +253,7 @@ sub read_configfile { foreach my $section (keys %cfg_defaults) { foreach my $param (keys %{$cfg_defaults{ $section }}) { my $pinfo = $cfg_defaults{ $section }{ $param }; - ${@$pinfo[ 0 ]} = (defined($cfg))?$cfg->val( $section, $param, @$pinfo[ 1 ] ):@$pinfo[ 1 ]; + ${@$pinfo[ 0 ]} = $cfg->val( $section, $param, @$pinfo[ 1 ] ); } } } diff --git a/gosa-si/modules/ArpHandler.pm b/gosa-si/modules/ArpHandler.pm index ded762b9e..549afed52 100644 --- a/gosa-si/modules/ArpHandler.pm +++ b/gosa-si/modules/ArpHandler.pm @@ -60,7 +60,7 @@ my %cfg_defaults = #=============================================================================== sub read_configfile { my $cfg; - if( defined( $main::cfg_file) && ( length($main::cfg_file) > 0 )) { + if( defined( $main::cfg_file) && ( (-s $main::cfg_file) > 0 )) { if( -r $main::cfg_file ) { $cfg = Config::IniFiles->new( -file => $main::cfg_file ); } else { diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index b1d207f74..25127ad06 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -82,7 +82,7 @@ sub get_module_info { #=============================================================================== sub read_configfile { my $cfg; - if( defined( $main::cfg_file) && ( length($main::cfg_file) > 0 )) { + if( defined( $main::cfg_file) && ( (-s $main::cfg_file) > 0 )) { if( -r $main::cfg_file ) { $cfg = Config::IniFiles->new( -file => $main::cfg_file ); } else { diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index 4f7bd8611..960c666cd 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -192,7 +192,7 @@ sub get_module_info { #=============================================================================== sub read_configfile { my $cfg; - if( defined( $main::cfg_file) && ( length($main::cfg_file) > 0 )) { + if( defined( $main::cfg_file) && ( (-s $main::cfg_file) > 0 )) { if( -r $main::cfg_file ) { $cfg = Config::IniFiles->new( -file => $main::cfg_file ); } else { diff --git a/gosa-si/server/events/clMessages.pm b/gosa-si/server/events/clMessages.pm index 6cdfd7f7d..486a6e2a4 100644 --- a/gosa-si/server/events/clMessages.pm +++ b/gosa-si/server/events/clMessages.pm @@ -55,7 +55,7 @@ sub read_configfile { my ($cfg_file, %cfg_defaults) = @_; my $cfg; - if( defined( $cfg_file) && ( length($cfg_file) > 0 )) { + if( defined( $cfg_file) && ( (-s $cfg_file) > 0 )) { if( -r $cfg_file ) { $cfg = Config::IniFiles->new( -file => $cfg_file ); } else { diff --git a/gosa-si/server/events/siTriggered.pm b/gosa-si/server/events/siTriggered.pm index bde782956..2ae7a78bd 100644 --- a/gosa-si/server/events/siTriggered.pm +++ b/gosa-si/server/events/siTriggered.pm @@ -47,7 +47,7 @@ sub read_configfile { my ($cfg_file, %cfg_defaults) = @_; my $cfg; - if( defined( $cfg_file) && ( length($cfg_file) > 0 )) { + if( defined( $cfg_file) && ( (-s $cfg_file) > 0 )) { if( -r $cfg_file ) { $cfg = Config::IniFiles->new( -file => $cfg_file ); } else {