Code

bugfix: DBsqlite select_dbentry: correct sorting of the DB output
[gosa.git] / gosa-si / modules / GosaSupportDaemon.pm
index bb3a305811ab71224ff3ba417d3f8b8ad193e405..002308e537d574d997c2268e4eeaea10f99f5e31 100644 (file)
@@ -69,7 +69,7 @@ sub transform_msg2hash {
 #      RETURNS:  nothing
 #  DESCRIPTION:  ????
 #===============================================================================
-sub send_msg_hash2address {
+sub send_msg_hash2address ($$$){
     my ($msg_hash, $address, $passwd) = @_ ;
 
     # fetch header for logging
@@ -97,7 +97,7 @@ sub send_msg_hash2address {
     close $socket;
 
     daemon_log("send '$header'-msg to $address", 1);
-    daemon_log("$msg_xml", 5);
+    daemon_log("message:\n$msg_xml", 8);
     return 0;
 }
 
@@ -168,9 +168,9 @@ sub encrypt_msg {
     my ($msg, $my_cipher) = @_;
     if(not defined $my_cipher) { print "no cipher object\n"; }
     $msg = "\0"x(16-length($msg)%16).$msg;
-    my $crypted_msg = $my_cipher->encrypt($msg);
-    chomp($crypted_msg = &encode_base64($crypted_msg));
-    return $crypted_msg;
+    $msg = $my_cipher->encrypt($msg);
+    chomp($msg = &encode_base64($msg));
+    return $msg;
 }
 
 
@@ -182,9 +182,11 @@ sub encrypt_msg {
 #  DESCRIPTION:  decrypts the incoming message with the Crypt::Rijndael module
 #===============================================================================
 sub decrypt_msg {
-    my ($crypted_msg, $my_cipher) = @_ ;
-    $crypted_msg = &decode_base64($crypted_msg);
-    my $msg = $my_cipher->decrypt($crypted_msg); 
+    my ($msg, $my_cipher) = @_ ;
+    if(defined $msg && defined $my_cipher) {
+        $msg = &decode_base64($msg);
+    }
+    $msg = $my_cipher->decrypt($msg); 
     $msg =~ s/\0*//g;
     return $msg;
 }
@@ -230,8 +232,7 @@ sub open_socket {
     if(not defined $socket) {
         return;
     }
-    &daemon_log("open_socket:", 7);
-    &daemon_log("\t$PeerAddr", 7);
+    &daemon_log("open_socket: $PeerAddr", 7);
     return $socket;
 }