aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/nfsen-devel/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/nfsen-devel/files')
-rw-r--r--net-mgmt/nfsen-devel/files/patch-bin_testPlugin25
-rw-r--r--net-mgmt/nfsen-devel/files/patch-html_alerting.php13
-rw-r--r--net-mgmt/nfsen-devel/files/patch-html_nfsen.php33
-rw-r--r--net-mgmt/nfsen-devel/files/patch-install.pl20
-rw-r--r--net-mgmt/nfsen-devel/files/patch-libexec_NfSen.pm53
5 files changed, 143 insertions, 1 deletions
diff --git a/net-mgmt/nfsen-devel/files/patch-bin_testPlugin b/net-mgmt/nfsen-devel/files/patch-bin_testPlugin
new file mode 100644
index 000000000000..86004d1ee713
--- /dev/null
+++ b/net-mgmt/nfsen-devel/files/patch-bin_testPlugin
@@ -0,0 +1,25 @@
+
+$FreeBSD$
+
+--- bin/testPlugin.orig
++++ bin/testPlugin
+@@ -50,6 +50,7 @@
+
+ use NfConf;
+ use NfSen;
++use NfProfile;
+ use Log;
+
+ my $VERSION = '$Id: testPlugin 60 2007-01-09 12:26:47Z peter $';
+@@ -164,7 +165,10 @@
+ print "Run plugin '$plugin' with profile '$profile' at '$timeslot'\n";
+ my $sub = "${plugin}::run";
+ no strict 'refs';
+-&$sub($profile, $timeslot);
++&$sub({
++ profile => $profile,
++ timeslot => $timeslot,
++});
+ use strict 'refs';
+ print "Plugin run successfully, at least as far as I can tell ...\n" ;
+
diff --git a/net-mgmt/nfsen-devel/files/patch-html_alerting.php b/net-mgmt/nfsen-devel/files/patch-html_alerting.php
new file mode 100644
index 000000000000..624067699a06
--- /dev/null
+++ b/net-mgmt/nfsen-devel/files/patch-html_alerting.php
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- html/alerting.php.orig
++++ html/alerting.php
+@@ -449,6 +449,7 @@
+ foreach ( $alert_condition_plugin as $plugin) {
+ $selected = $alert['condition'][0] == $plugin ? 'selected' : '';
+ print " <option value='$i' $selected>" . $plugin . "</option>\n";
++ $i++;
+ }
+ }
+ ?>
diff --git a/net-mgmt/nfsen-devel/files/patch-html_nfsen.php b/net-mgmt/nfsen-devel/files/patch-html_nfsen.php
new file mode 100644
index 000000000000..a2c5d1424e98
--- /dev/null
+++ b/net-mgmt/nfsen-devel/files/patch-html_nfsen.php
@@ -0,0 +1,33 @@
+
+$FreeBSD$
+
+--- html/nfsen.php.orig
++++ html/nfsen.php
+@@ -489,7 +489,8 @@
+ if ( count($BookmarkVars) == count($_vars) ) {
+ for ( $i=0; $i<count($BookmarkVars); $i++ ) {
+ if ( $_vars[$i] != '-' )
+- $_POST[$BookmarkVars[$i]] = $_vars[$i];
++ $_POST[$BookmarkVars[$i]] =
++ str_replace('!','|',$_vars[$i]);
+ }
+ } else {
+ SetMessage('warning', "Bookmark processing error");
+@@ -749,7 +750,16 @@
+ // Generate bookmark
+ $vars = array();
+ foreach ( $BookmarkVars as $var ) {
+- $vars[] = array_key_exists($var, $_SESSION) ? $_SESSION[$var] : '-';
++ if (array_key_exists($var, $_SESSION)) {
++ $vars[] = $_SESSION[$var];
++ }
++ elseif (array_key_exists('detail_opts', $_SESSION) and
++ array_key_exists($var, $_SESSION['detail_opts'])) {
++ $vars[] = str_replace('|','!',$_SESSION['detail_opts'][$var]);
++ }
++ else {
++ $vars[] = '-';
++ }
+ }
+
+ $_SESSION['bookmark'] = urlencode(base64_encode(implode('|', $vars)));
diff --git a/net-mgmt/nfsen-devel/files/patch-install.pl b/net-mgmt/nfsen-devel/files/patch-install.pl
index 4b4113a85cc1..05ae145eb312 100644
--- a/net-mgmt/nfsen-devel/files/patch-install.pl
+++ b/net-mgmt/nfsen-devel/files/patch-install.pl
@@ -9,7 +9,7 @@ $FreeBSD$
#
#
# Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
-@@ -81,33 +81,7 @@
+@@ -83,33 +83,7 @@
# Get Perl
sub GetPerl {
@@ -44,3 +44,21 @@ $FreeBSD$
} # End of GetPerl
+@@ -620,7 +594,7 @@
+ exit 1;
+ }
+
+-my $hints = NfSen::LoadHints();
++my $hints = NfSen::LoadHints_startup();
+ if ( $$$hints{'version'} == -1 ) {
+ # initial NfSen install or upgrade from old version without hints
+ $$$hints{'version'} = $nfsen_version;
+@@ -725,7 +699,7 @@
+
+
+ Nfsources::Reconfig();
+-NfSen::StoreHints();
++NfSen::StoreHints_startup();
+ chown $nfsen_uid, $www_gid, "$NfConf::PROFILESTATDIR/hints" || die "Can't chown hints db: $!\n";
+ print "Setup done.\n\n";
+
diff --git a/net-mgmt/nfsen-devel/files/patch-libexec_NfSen.pm b/net-mgmt/nfsen-devel/files/patch-libexec_NfSen.pm
new file mode 100644
index 000000000000..875b98ce0f55
--- /dev/null
+++ b/net-mgmt/nfsen-devel/files/patch-libexec_NfSen.pm
@@ -0,0 +1,53 @@
+
+$FreeBSD$
+
+--- libexec/NfSen.pm.orig
++++ libexec/NfSen.pm
+@@ -705,6 +705,25 @@
+
+ } # End of LoadHints
+
++sub LoadHints_startup {
++
++ eval {
++ local $SIG{'__DIE__'} = 'DEFAULT';
++ $hints = lock_retrieve "$NfConf::PROFILESTATDIR/hints";
++ };
++
++ if ( my $err = $@ ) {
++ warn "Error reading hints: $err\n";
++ warn "Initialize hints to defaults.\n";
++ $$hints{'version'} = -1; # unknown
++ $$hints{'installed'} = 0;
++ $$hints{'subdirlayout'} = $NfConf::SUBDIRLAYOUT;
++ }
++
++ return \$hints;
++
++} # End of LoadHints_startup
++
+ sub StoreHints {
+
+ eval {
+@@ -717,6 +736,20 @@
+ return $err;
+ }
+
+-} # End of StoreAlertStatus
++} # End of StoreHints
++
++sub StoreHints_startup {
++
++ eval {
++ local $SIG{'__DIE__'} = 'DEFAULT';
++ lock_store $hints, "$NfConf::PROFILESTATDIR/hints";
++ };
++
++ if ( my $err = $@ ) {
++ warn "Error store hints: $err\n";
++ return $err;
++ }
++
++} # End of StoreHints_startup
+
+ 1;