diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client
index 4e48451073feb9254a50962b422e89e4c502fa67..cbc3e571952a00d7474b602a6cc4650915c277bd 100755 (executable)
--- a/gosa-si/gosa-si-client
+++ b/gosa-si/gosa-si-client
my ($msg, $address, $encrypt_key, $msg_header) = @_ ;
my $error = 0;
- if( $msg_header ) {
- $msg_header = "'$msg_header'-";
- }
- else {
- $msg_header = "";
- }
+ if( $msg_header ) { $msg_header = "'$msg_header'-"; }
+ else { $msg_header = ""; }
# encrypt xml msg
my $crypted_msg = &encrypt_msg($msg, $encrypt_key);
$error++;
}
+ # send xml msg
if( $error == 0 ) {
- # send xml msg
print $socket $crypted_msg."\n";
-
daemon_log("send ".$msg_header."msg to $address", 1);
daemon_log("message:\n$msg", 8);
-
}
# close socket in any case
eval{ require $event; };
if( $@ ) {
daemon_log("ERROR: import of event module '$event' failed", 1);
- daemon_log("$@", 8);
+ daemon_log("$@", 1);
next;
}
my $file_record = $_[ARG0];
my $header;
my $content = "";
+ daemon_log("DEBUG: fifo got record: $file_record", 7);
$file_record =~ /^(\S+)[ ]?([\s\S]+)?$/;
if( defined $1 ) {
$REGISTERED = 1;
}
else {
- &send_msg_to_target($answer, $server_address, $server_key);
+ $answer =~ /<header>(\S+)<\/header>/;
+ &send_msg_to_target($answer, $server_address, $server_key, $1);
}
# postprocessing
# forward error messages to logfile
if ( ! $foreground ) {
- open STDIN, '/dev/null' or die "Can’t read /dev/null: $!";
- open STDOUT, '>>/dev/null' or die "Can't write to /dev/null: $!";
- open STDERR, '>>/dev/null' or die "Can't write to /dev/null: $!";
+ open( STDIN, '+>/dev/null' );
+ open( STDOUT, '+>&STDIN' );
+ open( STDERR, '+>&STDIN' );
}
# Just fork, if we are not in foreground mode