diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index d73b3c7630b1b65a00ccb0a060de25ce07bba640..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;
}
}
-# moved to GosaSupportDaemon: 03-06-2008: rettenbe
-#=== FUNCTION ================================================================
-# NAME: get_ip
-# PARAMETERS: interface name (i.e. eth0)
-# RETURNS: (ip address)
-# DESCRIPTION: Uses ioctl to get ip address directly from system.
-#===============================================================================
-#sub get_ip {
-# my $ifreq= shift;
-# my $result= "";
-# my $SIOCGIFADDR= 0x8915; # man 2 ioctl_list
-# my $proto= getprotobyname('ip');
-#
-# socket SOCKET, PF_INET, SOCK_DGRAM, $proto
-# or die "socket: $!";
-#
-# if(ioctl SOCKET, $SIOCGIFADDR, $ifreq) {
-# my ($if, $sin) = unpack 'a16 a16', $ifreq;
-# my ($port, $addr) = sockaddr_in $sin;
-# my $ip = inet_ntoa $addr;
-#
-# if ($ip && length($ip) > 0) {
-# $result = $ip;
-# }
-# }
-#
-# return $result;
-#}
-
-
sub get_local_ip_for_remote_ip {
my $remote_ip= shift;
my $result="0.0.0.0";
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 process_task {
no strict "refs";
+ #CHECK: Not @_[...]?
my ($session, $heap, $task) = @_;
my $error = 0;
my $answer_l;
sub watch_for_done_jobs {
+ #CHECK: $heap for what?
my ($kernel,$heap) = @_[KERNEL, HEAP];
my $sql_statement = "SELECT * FROM ".$job_queue_tn." WHERE ((status='done') AND (modified='0'))";
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;