summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 524d4ec)
raw | patch | inline | side by side (parent: 524d4ec)
author | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 27 Mar 2010 23:48:49 +0000 (23:48 +0000) | ||
committer | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 27 Mar 2010 23:48:49 +0000 (23:48 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17322 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/modules/GosaPackages.pm | patch | blob | history | |
gosa-si/modules/GosaSupportDaemon.pm | patch | blob | history |
index 1760c0e1519cd9f66d05e25e89e14b78d63b4b23..00a07fa2dc12f24ba40c11f2d8f8e5d7b9f5e1d9 100644 (file)
package GosaPackages;
-use Exporter;
-@ISA = ("Exporter");
-
use strict;
use warnings;
+
+use Exporter;
use GOSA::GosaSupportDaemon;
use IO::Socket::INET;
use Socket;
use MIME::Base64;
use Net::ARP;
+@ISA = ("Exporter");
+
my $event_dir = "/usr/lib/gosa-si/server/GosaPackages";
use lib "/usr/lib/gosa-si/server/GosaPackages";
index 8d3caad0a4452ca9dafedff61cc99c4bcfa8402c..14e755aea245aefbb33d4f8df7d8f3dd6ca2c6a2 100644 (file)
package GOSA::GosaSupportDaemon;
+use strict;
+use warnings;
+
use Exporter;
+use IO::Socket::INET;
+use Crypt::Rijndael;
+use Digest::MD5 qw(md5 md5_hex md5_base64);
+use MIME::Base64;
+use XML::Quote qw(:all);
+use XML::Simple;
+use Data::Dumper;
+use Net::DNS;
+use Net::ARP;
+use DateTime;
+
@ISA = qw(Exporter);
+
my @functions = (
"create_passwd",
"create_xml_hash",
- "createXmlHash",
- "myXmlHashToString",
+ "createXmlHash",
+ "myXmlHashToString",
"get_content_from_xml_hash",
"add_content2xml_hash",
"create_xml_string",
"opsi_callobj2string",
);
@EXPORT = @functions;
-use strict;
-use warnings;
-use IO::Socket::INET;
-use Crypt::Rijndael;
-use Digest::MD5 qw(md5 md5_hex md5_base64);
-use MIME::Base64;
-use XML::Quote qw(:all);
-use XML::Simple;
-use Data::Dumper;
-use Net::DNS;
-use Net::ARP;
-use DateTime;
my $op_hash = {
'eq' => '=',
sub get_dns_domains() {
my $line;
my @searches;
- open(RESOLV, "</etc/resolv.conf") or return @searches;
- while(<RESOLV>){
+ open($RESOLV, "<", "/etc/resolv.conf") or return @searches;
+ while(<$RESOLV>){
$line= $_;
chomp $line;
$line =~ s/^\s+//;
push(@searches, split(/ /, $1));
}
}
- close(RESOLV);
+ close($RESOLV);
my %tmp = map { $_ => 1 } @searches;
@searches = sort keys %tmp;
my @result;
my $PROC_NET_DEV= ('/proc/net/dev');
- open(PROC_NET_DEV, "<$PROC_NET_DEV")
+ open($FD_PROC_NET_DEV, "<", "$PROC_NET_DEV")
or die "Could not open $PROC_NET_DEV";
- my @ifs = <PROC_NET_DEV>;
+ my @ifs = <$FD_PROC_NET_DEV>;
- close(PROC_NET_DEV);
+ close($FD_PROC_NET_DEV);
# Eat first two line
shift @ifs;
if($remote_ip =~ /^(\d\d?\d?\.){3}\d\d?\d?$/) {
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;
&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($PIPE, "$cmd_line |");
my $result = {'command' => $cmd_line};
- push @{$result->{'output'}}, <PIPE>;
- close(PIPE);
+ push @{$result->{'output'}}, <$PIPE>;
+ close($PIPE);
my $exit_value = $? >> 8;
$result->{'resultCode'} = $exit_value;
return $result;