Code

- Corrected open perl function, corrected variable passing to open and close
authoropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 27 Mar 2010 23:39:31 +0000 (23:39 +0000)
committeropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 27 Mar 2010 23:39:31 +0000 (23:39 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17321 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/modules/ClientPackages.pm

index fb8aab830dd33adcc62e5226f235e304b16f934c..8fc6318bcf69b87dfd021adf2558e858c0eed3e4 100644 (file)
@@ -1,12 +1,11 @@
 package ClientPackages;
 
-use Exporter;
-@ISA = ("Exporter");
-
 # Each module has to have a function 'process_incoming_msg'. This function works as a interface to gosa-sd and receives the msg hash from gosa-sd. 'process_incoming_function checks, wether it has a function to process the incoming msg and forward the msg to it. 
 
 use strict;
 use warnings;
+
+use Exporter;
 use GOSA::GosaSupportDaemon;
 use IO::Socket::INET;
 use XML::Simple;
@@ -17,6 +16,8 @@ use Net::LDAP::Util;
 use Socket;
 use Net::hostent;
 
+@ISA = ("Exporter");
+
 my $event_dir = "/usr/lib/gosa-si/server/ClientPackages";
 use lib "/usr/lib/gosa-si/server/ClientPackages";
 
@@ -451,9 +452,9 @@ sub here_i_am {
     if ( defined($msg_hash->{'force-hostname'}[0]) &&
        length($msg_hash->{'force-hostname'}[0]) > 0){
     #      $heap->{force-hostname}->{$mac_address}= $msg_hash->{'force-hostname'}[0];
-           open (TFILE, ">/var/tmp/$mac_address");
-           print TFILE $msg_hash->{'force-hostname'}[0];
-           close (TFILE); 
+           open ($TFILE, ">", "/var/tmp/$mac_address");
+           print $TFILE $msg_hash->{'force-hostname'}[0];
+           close ($TFILE); 
     } else {
     #      $heap->{force-hostname}->{$mac_address}= undef;
        if ( -e "/var/tmp/$mac_address") {
@@ -1081,12 +1082,12 @@ sub server_matches {
                } else {
                        my $PROC_NET_ROUTE= ('/proc/net/route');
 
-                       open(PROC_NET_ROUTE, "<$PROC_NET_ROUTE")
+                       open($FD_PROC_NET_ROUTE, "<", "$PROC_NET_ROUTE")
                                or die "Could not open $PROC_NET_ROUTE";
 
-                       my @ifs = <PROC_NET_ROUTE>;
+                       my @ifs = <$FD_PROC_NET_ROUTE>;
 
-                       close(PROC_NET_ROUTE);
+                       close($FD_PROC_NET_ROUTE);
 
                        # Eat header line
                        shift @ifs;