From bb38b350d6e87023de9d5f6af2da9cb71c1b1492 Mon Sep 17 00:00:00 2001 From: opensides Date: Mon, 17 May 2010 13:02:47 +0000 Subject: [PATCH] - Correcting errors due to code changes GOSA:: GOsaSI:: git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18516 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server | 18 +++++------ gosa-si/modules/DBsqlite.pm | 60 ++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 1885d3011..3f369825d 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -145,7 +145,7 @@ my $repo_path; my %repo_dirs=(); # Variables declared in config file are always set to 'our' -our (%cfg_defaults, $log_file, $pid_file, $pid +our (%cfg_defaults, $log_file, $pid_file, $pid, $server_ip, $server_port, $ClientPackages_key, $dns_lookup, $arp_activ, $gosa_unit_tag, $GosaPackages_key, $gosa_timeout, @@ -398,7 +398,7 @@ sub usage 'vvv': warning plus error logs 'vvvvv': info plus warning logs 'vvvvvvv': debug plus info logs - -no-arp : starts $prg without connection to arp module + -no-arp : starts gosa-si-server without connection to arp module -d : if verbose level is higher than 7x 'v' specified parts can be debugged 1 : report incoming messages 2 : report unencrypted outgoing messages @@ -550,7 +550,7 @@ sub daemon_log { # Build log message and write it to log file and commandline chomp($msg); - my $log_msg = "$month $monthday $hours:$minutes:$seconds$microSeconds $prg $msg\n"; + my $log_msg = "$month $monthday $hours:$minutes:$seconds$microSeconds $0 $msg\n"; flock(LOG_HANDLE, LOCK_EX); seek(LOG_HANDLE, 0, 2); print LOG_HANDLE $log_msg; @@ -749,7 +749,7 @@ sub sig_int_handler { # to be removed rather crude !! #system("kill `ps -C gosa-si-server -o pid=`"); - $pid->remove or warn "Could not remove $pidfile\n"; + $pid->remove or warn "Could not remove $pid_file\n"; exit(0); } @@ -3629,8 +3629,8 @@ GetOptions( 'v|verbose+' => \$verbose, 'h|help' => \&usage, 'c|config=s' => \$config, 'x|dump-config=i' => \$dump_config, - 'f|foreground' => \$foreground) - 'd=s' => \$debug_parts, + 'f|foreground' => \$foreground, + 'd=s' => \$debug_parts) or usage( '', 1 ); # We may want to dump the default configuration @@ -3655,8 +3655,8 @@ $SIG{CHLD} = 'IGNORE'; # Create the PID object # Ensure you put a name that won't clobber # another program's PID file -my $pid = File::Pid->new({ - file => $pidfile, +$pid = File::Pid->new({ + file => $pid_file, }); # Write the PID file @@ -3677,7 +3677,7 @@ if( ! $foreground ) { umask 0; #} else { # $pid = $$; -#} +} # Do something useful - put our PID into the pid_file #if( 0 != $pid ) { diff --git a/gosa-si/modules/DBsqlite.pm b/gosa-si/modules/DBsqlite.pm index 31f2c395d..8e3784df7 100644 --- a/gosa-si/modules/DBsqlite.pm +++ b/gosa-si/modules/DBsqlite.pm @@ -45,8 +45,8 @@ sub new { sub connect { my $self = shift; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::connect was called static! Argument was '$self'!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::connect was called static! Argument was '$self'!", 1); return; } @@ -59,8 +59,8 @@ sub connect { sub disconnect { my $self = shift; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::disconnect was called static! Argument was '$self'!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::disconnect was called static! Argument was '$self'!", 1); return; } @@ -79,8 +79,8 @@ sub disconnect { sub lock { my $self = shift; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::lock was called static! Argument was '$self'!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::lock was called static! Argument was '$self'!", 1); return; } @@ -104,8 +104,8 @@ get_lock: sub unlock { my $self = shift; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::unlock was called static! Argument was '$self'!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::unlock was called static! Argument was '$self'!", 1); return; } if(not ref $self->{db_lock_handle}) { @@ -121,7 +121,7 @@ sub unlock { sub create_table { my $self = shift; if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::create_table was called static! Statement was '$self'!", 1); + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::create_table was called static! Statement was '$self'!", 1); return; } my $table_name = shift; @@ -328,8 +328,8 @@ sub add_dbentry { sub update_dbentry { my ($self, $sql)= @_; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::update_dbentry was called static! Statement was '$self'!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::update_dbentry was called static! Statement was '$self'!", 1); return; } my $db_answer= $self->exec_statement($sql); @@ -339,8 +339,8 @@ sub update_dbentry { sub del_dbentry { my ($self, $sql)= @_;; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::del_dbentry was called static! Statement was '$self'!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::del_dbentry was called static! Statement was '$self'!", 1); return; } my $db_res= $self->exec_statement($sql); @@ -350,8 +350,8 @@ sub del_dbentry { sub get_table_columns { my $self = shift; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::get_table_columns was called static! Statement was '$self'!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::get_table_columns was called static! Statement was '$self'!", 1); return; } my $table = shift; @@ -374,8 +374,8 @@ sub get_table_columns { sub select_dbentry { my ($self, $sql)= @_; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::select_dbentry was called static! Statement was '$self'!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::select_dbentry was called static! Statement was '$self'!", 1); return; } my $error= 0; @@ -415,8 +415,8 @@ sub select_dbentry { sub show_table { my $self = shift; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::show_table was called static! Statement was '$self'!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::show_table was called static! Statement was '$self'!", 1); return; } my $table_name = shift; @@ -435,13 +435,13 @@ sub show_table { sub exec_statement { my $self = shift; my $sql_statement = shift; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::exec_statement was called static! Statement was '$self'!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::exec_statement was called static! Statement was '$self'!", 1); return; } if(not defined($sql_statement) or length($sql_statement) == 0) { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::exec_statement was called with empty statement!", 1); + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::exec_statement was called with empty statement!", 1); return; } @@ -521,8 +521,8 @@ sub exec_statement { sub exec_statementlist { my $self = shift; my $sql_list = shift; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::exec_statementlist was called static!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::exec_statementlist was called static!", 1); return; } my @db_answer; @@ -541,8 +541,8 @@ sub exec_statementlist { sub count_dbentries { my ($self, $table)= @_; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::count_dbentries was called static!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::count_dbentries was called static!", 1); return; } my $error= 0; @@ -560,8 +560,8 @@ sub count_dbentries { sub move_table { my ($self, $from, $to) = @_; - if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') { - &main::daemon_log("0 ERROR: GOSA::DBsqlite::move_table was called static!", 1); + if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') { + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::move_table was called static!", 1); return; } @@ -628,11 +628,11 @@ sub move_table { }; if($@) { $self->{dbh}->rollback(); - &main::daemon_log("0 ERROR: GOSA::DBsqlite::move_table crashed! Operation failed with $@", 1); + &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::move_table crashed! Operation failed with $@", 1); } } - &main::daemon_log("0 INFO: GOSA::DBsqlite::move_table: Operation successful!", 7); + &main::daemon_log("0 INFO: GOsaSI::DBsqlite::move_table: Operation successful!", 7); $self->unlock(); return; -- 2.30.2