diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 250e0080b376831bdaced8405381f5de7cfee7bb..ada883ba08d8c225d9040d5cb39a4217c8586dd2 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
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 {
}
};
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;
}
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 } ) {
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;
}
}
+# 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,
);
-# import all modules
-&import_modules;
-
-# TODO
-# check wether all modules are gosa-si valid passwd check
-
-
-
POE::Kernel->run();
exit;