diff --git a/gosa-si/gosa-si-bus b/gosa-si/gosa-si-bus
index 8076db2883ca2145b28202ebc8c973afc542c4fa..37d54002cfa8899372b8036ca35b34742401e97e 100755 (executable)
--- a/gosa-si/gosa-si-bus
+++ b/gosa-si/gosa-si-bus
use MIME::Base64;
use File::Basename;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use MIME::Base64;
use File::Basename;
use Digest::MD5 qw(md5 md5_hex md5_base64);
-use utf8;
use GOSA::GosaSupportDaemon;
use GOSA::DBsqlite;
use GOSA::GosaSupportDaemon;
use GOSA::DBsqlite;
sub encrypt_msg {
my ($msg, $key) = @_;
my $my_cipher = &create_ciphering($key);
sub encrypt_msg {
my ($msg, $key) = @_;
my $my_cipher = &create_ciphering($key);
+ my $len;
{
{
- use bytes;
- $msg = "\0"x(16-length($msg)%16).$msg;
+ use bytes;
+ $len= 16-length($msg)%16;
}
}
+ $msg = "\0"x($len).$msg;
$msg = $my_cipher->encrypt($msg);
chomp($msg = &encode_base64($msg));
# there are no newlines allowed inside msg
$msg = $my_cipher->encrypt($msg);
chomp($msg = &encode_base64($msg));
# there are no newlines allowed inside msg
}
elsif( $target =~ /([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})/ ) {
# target is a mac address
}
elsif( $target =~ /([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})/ ) {
# target is a mac address
- my $sql_statement = "SELECT * FROM bus_known_clients WHERE macaddress='$target'";
+ my $sql_statement = "SELECT * FROM bus_known_clients WHERE macaddress LIKE '$target'";
my $query_res = $bus_known_clients_db->select_dbentry( $sql_statement );
if( 1 > keys(%{$query_res})) {
daemon_log("ERROR: there are more than one hosts in bus_known_clients_db with mac address '$target'", 1);
my $query_res = $bus_known_clients_db->select_dbentry( $sql_statement );
if( 1 > keys(%{$query_res})) {
daemon_log("ERROR: there are more than one hosts in bus_known_clients_db with mac address '$target'", 1);
# forward error messages to logfile
if ( ! $foreground ) {
# 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
}
# Just fork, if we are not in foreground mode