X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-si%2Fgosa-si-server;h=ada883ba08d8c225d9040d5cb39a4217c8586dd2;hb=63fb879ad78726b33ed72587ab801e4174669cef;hp=250e0080b376831bdaced8405381f5de7cfee7bb;hpb=d47928d43540800ff10f9918243db1e0648d1875;p=gosa.git diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 250e0080b..ada883ba0 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -472,11 +472,36 @@ sub import_modules { close (DIR); } +#=== FUNCTION ================================================================ +# NAME: password_check +# PARAMETERS: nothing +# RETURNS: nothing +# DESCRIPTION: escalates an critical error if two modules exist which are avaialable by +# the same password +#=============================================================================== +sub password_check { + my $passwd_hash = {}; + while (my ($mod_name, $mod_info) = each %$known_modules) { + my $mod_passwd = @$mod_info[1]; + if (not defined $mod_passwd) { next; } + if (not exists $passwd_hash->{$mod_passwd}) { + $passwd_hash->{$mod_passwd} = $mod_name; + + # escalates critical error + } else { + &daemon_log("0 ERROR: two loaded modules do have the same password. Please modify the 'key'-parameter in config file"); + &daemon_log("0 ERROR: module='$mod_name' and module='".$passwd_hash->{$mod_passwd}."'"); + exit( -1 ); + } + } + +} + #=== FUNCTION ================================================================ # NAME: sig_int_handler # PARAMETERS: signal - string - signal arose from system -# RETURNS: noting +# RETURNS: nothing # DESCRIPTION: handels tasks to be done befor signal becomes active #=============================================================================== sub sig_int_handler { @@ -596,8 +621,8 @@ sub check_outgoing_xml_validity { } }; if($@) { - daemon_log("$session_id WARNING: outgoing msg is not gosa-si envelope conform: ", 5); - daemon_log("$@ ".(defined($msg) && length($msg)>0)?$msg:"Empty Message", 5); + daemon_log("$session_id ERROR: outgoing msg is not gosa-si envelope conform: ", 1); + daemon_log("$@ ".(defined($msg) && length($msg)>0)?$msg:"Empty Message", 1); $msg_hash = undef; } @@ -1018,8 +1043,8 @@ sub msg_to_decrypt { if(( !$msg ) || ( !$msg_hash ) || ( !$module )){ # if an incoming msg could not be decrypted (maybe a wrong key), send client a ping. If the client # could not understand a msg from its server the client cause a re-registering process - daemon_log("$session_id INFO cannot understand incoming msg, send 'ping'-msg to all host with ip '".$heap->{remote_ip}. - "' to cause a re-registering of the client if necessary", 5); + daemon_log("$session_id WARNING cannot understand incoming msg, send 'ping'-msg to all host with ip '".$heap->{remote_ip}. + "' to cause a re-registering of the client if necessary", 3); my $sql_statement = "SELECT * FROM $main::known_clients_tn WHERE (hostname LIKE '".$heap->{'remote_ip'}."%')"; my $query_res = $known_clients_db->select_dbentry( $sql_statement ); while( my ($hit_num, $hit) = each %{ $query_res } ) { @@ -2016,9 +2041,9 @@ sub change_goto_state { sub run_recreate_packages_db { my ($kernel, $session, $heap) = @_[KERNEL, SESSION, HEAP]; my $session_id = $session->ID; - &main::daemon_log("$session_id INFO: Recreating FAI Packages DB ('$fai_release_tn', '$fai_server_tn', '$packages_list_tn')", 4); - $kernel->yield('create_fai_release_db'); - $kernel->yield('create_fai_server_db'); + &main::daemon_log("$session_id INFO: Recreating FAI Packages DB ('$fai_release_tn', '$fai_server_tn', '$packages_list_tn')", 5); + $kernel->yield('create_fai_release_db', $fai_release_tn); + $kernel->yield('create_fai_server_db', $fai_server_tn); return; } @@ -3007,6 +3032,12 @@ foreach my $foreign_server (@foreign_server_list) { } +# import all modules +&import_modules; +# check wether all modules are gosa-si valid passwd check +&password_check; + + POE::Component::Server::TCP->new( Alias => "TCP_SERVER", Port => $server_port, @@ -3058,14 +3089,6 @@ POE::Session->create( ); -# import all modules -&import_modules; - -# TODO -# check wether all modules are gosa-si valid passwd check - - - POE::Kernel->run(); exit;