Code

Updated Recipies tab for servers and workstations.
[gosa.git] / gosa-si / modules / GosaSupportDaemon.pm
index 14e755aea245aefbb33d4f8df7d8f3dd6ca2c6a2..651bd57d7a1d914fec06b226d69cbdfd08d60014 100644 (file)
@@ -1,9 +1,8 @@
-package GOSA::GosaSupportDaemon;
+package GOsaSI::GosaSupportDaemon;
 
 use strict;
 use warnings;
 
-use Exporter;
 use IO::Socket::INET;
 use Crypt::Rijndael;
 use Digest::MD5  qw(md5 md5_hex md5_base64);
@@ -13,9 +12,11 @@ use XML::Simple;
 use Data::Dumper;
 use Net::DNS;
 use Net::ARP;
+
 use DateTime;
+use Exporter;
 
-@ISA = qw(Exporter);
+our @ISA = qw(Exporter);
 
 my @functions = (
     "create_passwd",
@@ -53,8 +54,9 @@ my @functions = (
     "check_opsi_res",
     "calc_timestamp",
     "opsi_callobj2string",
-    ); 
-@EXPORT = @functions;
+    );
+    
+our @EXPORT = @functions;
 
 my $op_hash = {
     'eq' => '=',
@@ -513,7 +515,7 @@ sub get_orderby_statement {
 sub get_dns_domains() {
         my $line;
         my @searches;
-        open($RESOLV, "<", "/etc/resolv.conf") or return @searches;
+        open(my $RESOLV, "<", "/etc/resolv.conf") or return @searches;
         while(<$RESOLV>){
                 $line= $_;
                 chomp $line;
@@ -726,7 +728,7 @@ sub get_interfaces {
        my @result;
        my $PROC_NET_DEV= ('/proc/net/dev');
 
-       open($FD_PROC_NET_DEV, "<", "$PROC_NET_DEV")
+       open(my $FD_PROC_NET_DEV, "<", "$PROC_NET_DEV")
                or die "Could not open $PROC_NET_DEV";
 
        my @ifs = <$FD_PROC_NET_DEV>;
@@ -754,7 +756,7 @@ sub get_local_ip_for_remote_ip {
     if($remote_ip =~ /^(\d\d?\d?\.){3}\d\d?\d?$/) {
         my $PROC_NET_ROUTE= ('/proc/net/route');
 
-        open($FD_PROC_NET_ROUTE, "<", "$PROC_NET_ROUTE")
+        open(my $FD_PROC_NET_ROUTE, "<", "$PROC_NET_ROUTE")
             or die "Could not open $PROC_NET_ROUTE";
 
         my @ifs = <$FD_PROC_NET_ROUTE>;
@@ -858,7 +860,7 @@ sub run_as {
                &main::daemon_log("ERROR: The sudo utility is not available! Please fix this!");
        }
        my $cmd_line= "$sudo_cmd su - $uid -c '$command'";
-       open($PIPE, "$cmd_line |");
+       open(my $PIPE, "$cmd_line |");
        my $result = {'command' => $cmd_line};
        push @{$result->{'output'}}, <$PIPE>;
        close($PIPE);