Complete the if_-hardened patch that was incomplete, and backport one more fix (for...
authorDiego Elio Pettenò <flameeyes@gentoo.org>
Fri, 11 Nov 2011 11:36:04 +0000 (11:36 +0000)
committerDiego Elio Pettenò <flameeyes@gentoo.org>
Fri, 11 Nov 2011 11:36:04 +0000 (11:36 +0000)
Package-Manager: portage-2.2.0_alpha72/cvs/Linux x86_64

net-analyzer/munin/ChangeLog
net-analyzer/munin/Manifest
net-analyzer/munin/files/munin-1.4.6-if_-hardened.patch
net-analyzer/munin/munin-1.4.6-r4.ebuild [moved from net-analyzer/munin/munin-1.4.6-r3.ebuild with 98% similarity]

index 26181f36757b0774e47b0d725372ba66e9b61de0..6ab2e98d17761ebfcc9178a27b1d44ddb1d09ac5 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for net-analyzer/munin
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.62 2011/11/03 18:08:56 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.63 2011/11/11 11:36:04 flameeyes Exp $
+
+*munin-1.4.6-r4 (11 Nov 2011)
+
+  11 Nov 2011; Diego E. Pettenò <flameeyes@gentoo.org> +munin-1.4.6-r4.ebuild,
+  -munin-1.4.6-r3.ebuild, files/munin-1.4.6-if_-hardened.patch:
+  Complete the if_-hardened patch that was incomplete, and backport one more fix
+  (for a bug introduced in said patch).
 
 *munin-1.4.6-r3 (03 Nov 2011)
 
index b40a567046721174ec65b1f24ab975b989caf9cd..f4f9a2d9eda3dfa4b96cd0a578c47ec53b6ab683 100644 (file)
@@ -8,7 +8,7 @@ AUX munin-1.4.4-Makefile.patch 2531 RMD160 f0a492267fd1078139a9f80997173cd1d4823
 AUX munin-1.4.6-apc-multi.patch 2329 RMD160 752c3a98ef7b8f11130381e38dbcdd159d9a51dd SHA1 c6e5465103ad0c9a56865bd3f9763b46c5e82a09 SHA256 128884796d3f5972136526254cfeaf76f40360be3be35ce63a76da2f6f2ab28e
 AUX munin-1.4.6-apc-temp.patch 1548 RMD160 884a9a0ec0cbc85a3ae7b9082a4c5915f5cac2af SHA1 d90bce289de037502f86ab6841d8a7b23f449140 SHA256 8b51c301cdd90f11e0d3fa5c16ae7bf4717bac2f6321765b6d37ecae4d9d6e27
 AUX munin-1.4.6-fix-asterisk-plugins.patch 6639 RMD160 60be6ab42c0983ddc56e3dacbd25210fdc0492e3 SHA1 07d176e8b1ac7658d27982df8586a3e23f3df080 SHA256 29c8c30b69420453676cc173c232dd3ed1a561e6f0a8fd82ed2b750867ae4ee0
-AUX munin-1.4.6-if_-hardened.patch 4067 RMD160 6632190bafc5dc3e0f9a4dcd519404252892f7d1 SHA1 526494ebdbf76d6f8edd013c4f44b06156de74dd SHA256 10a39a3c3ec7a7be4e462671dc695dc4c7361fbf6f0c2983c344139af2b922ea
+AUX munin-1.4.6-if_-hardened.patch 6403 RMD160 2cf5df669e97e936655388745613f3d7c4098b60 SHA1 cb2c25673c1511f678e6f5d59d299badce9c5005 SHA256 5a06d68df8a976869009a63a9f1a5aa1c6dba481cd8595b3d0e33aca507cc10d
 AUX munin-1.4.6-munin-version-identifier.patch 10903 RMD160 373e5a9f3c89a0642adc7aa8b6c8a8f7ff6fc585 SHA1 40615deac2ae75b2767e65f8c321c11ba1f97305 SHA256 a403e5f1ade8b8b3c917fd4a1b72eb1857d6d67c6c955c63a72f5876c5eb4dd4
 AUX munin-node_conf.d_1.4.5-r3 398 RMD160 d2ec21e963a0cb8618866e282bfb1f3bfaab22a8 SHA1 fb184d277f01256234362268f323bdec64bf395b SHA256 1599bf39d048f8330403d14b43dbc839cb7dfe2e4bc7531f52b4af9d00afd6d0
 AUX munin-node_conf.d_1.4.6-r2 316 RMD160 7e20d734fe0e83f10c117a2fe440c9405ed2aac7 SHA1 db3678e68a74d933827217a6f5db251ce567df40 SHA256 cf250f39eae1ee564f51cd99ec20510accb8a68d59469893c5f6c474263f5b50
@@ -18,13 +18,13 @@ DIST munin-1.4.5.tar.gz 1231622 RMD160 883aa4baacfa5be1ec6a83737d5d241c40ad6912
 DIST munin-1.4.6.tar.gz 1238782 RMD160 c4e5129641fa279f8b2668c7cafbb9d2656fd895 SHA1 055bf7da181941ce965e57cab7fe9a71fe57779f SHA256 1795812d9ad60e60f81c7f08c8be455ce44e1d4f966f7dd6be620e4c356de9c6
 EBUILD munin-1.4.5-r3.ebuild 4629 RMD160 1a65cd42f60a281a314a3d48b029e093c44804f0 SHA1 39c9e7b4f49d1df3bd6c58ca10e0897e9673074a SHA256 6f6198d9b815da6a1c587d65c1205eaa56d30c38fe8db508277ce190b3e469fc
 EBUILD munin-1.4.6-r2.ebuild 4867 RMD160 a2a8c77079df50d61cb49fa4d19ee6d5ca15ad18 SHA1 009918bd3baa8bc324b4d017f1c3d2ac470c0569 SHA256 d1e3327c9d38904c03c846552a89b9631f565a2d117453d67c8df7d7f8e45bb8
-EBUILD munin-1.4.6-r3.ebuild 4971 RMD160 ca7251ec7296a81596f3effbeb8a4242d5783106 SHA1 ddfcf733c874777c645dc2ad0d5c0bd667676a40 SHA256 c6b7c3ec35fe0a057f3a6debe27ef6d76f1e53c763c3ad3479bbcbce3c11565e
-MISC ChangeLog 12277 RMD160 54562c58364e950628e5db0cc6a92fd95abbfd0e SHA1 c9707a9ea6b65659f9127425ce3befbb00c3887e SHA256 2f139af4b344c0202bd0143293deb53acf71bb93cf408dc92b2f16cdd0602074
+EBUILD munin-1.4.6-r4.ebuild 4971 RMD160 f8e1953983bdca8bd18bdde3151d5793b494eb4e SHA1 f7e44fb0b7f609e47559c424873ca583e6fc0264 SHA256 c3c2f9838f674e7f0f141da5454cf09b349458243863adcf911f42dbf1aa83d3
+MISC ChangeLog 12574 RMD160 ac0de178ec73f26fdf7647e54e80c2cd63324e5f SHA1 310d8e60c2e76d131e1a763bb44bb2298d00f336 SHA256 0818fcc803773a601e6030b667d09b8f5efe9674cc16452bc1c099352f157fb6
 MISC metadata.xml 1249 RMD160 cd80a2d4d99585103b30a431c66bf8af5b2f8e96 SHA1 634e2949f42ab86ff056ac28891830ccf3d1a749 SHA256 1a37b6137d5f3e8c9cac67754bf18a2a83ff31e553fd5123aa9abe79a4ce4883
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
-iEYEARECAAYFAk6y2LgACgkQAiZjviIA2XieogCfdPFPaxpq9Qisn7rW7A6Rj97y
-D4QAn3W+wgqh5A0B/FYdWRzdMWpCc8ZS
-=6re6
+iEYEARECAAYFAk69CJwACgkQAiZjviIA2XiOGQCgkPA4zKa0RFuOoEvqGwfZ+uWo
+Y9YAoLjVa88uS5wYwbp+kTArj5zqPytt
+=k/mS
 -----END PGP SIGNATURE-----
index 4262dc57375a804a8efac372daabc81b0c39c75a..03c4ece263a27d157904f83fa234ec2f0f2dd3af 100644 (file)
@@ -1,5 +1,5 @@
 diff --git a/plugins/node.d.linux/if_.in b/plugins/node.d.linux/if_.in
-index 31b554a..2f08709 100755
+index da0fc31..63a5dfd 100755
 --- a/plugins/node.d.linux/if_.in
 +++ b/plugins/node.d.linux/if_.in
 @@ -43,7 +43,9 @@ monitored with this plugin.
@@ -13,18 +13,20 @@ index 31b554a..2f08709 100755
  
  =head1 LICENSE
  
-@@ -64,86 +66,65 @@ Unknown license
+@@ -64,86 +66,71 @@ Unknown license
  
  INTERFACE=${0##*if_}
  
 -findspeed () {
 -
-     # Who whould have thought it's so much work to determine the
-     # maximum speed of a network interface.  Buckle up!
+-    # Who whould have thought it's so much work to determine the
+-    # maximum speed of a network interface.  Buckle up!
 -
 -    IWLIST="$(type -p iwlist)"
 -
 -    WIRELESS=0
++# Who whould have thought it's so much work to determine the
++# maximum speed of a network interface.  Buckle up!
 +findspeed_mbps() {
      # Do not use interface name to guess technology.  Many many
      # wifi drivers use "eth*" names.
@@ -43,6 +45,21 @@ index 31b554a..2f08709 100755
 -          esac
 -          ;;
 -    esac
+-
+-    SPEED=U
+-    # Find speed in Mbps. - or not
+-    case $WIRELESS:$IWLIST in
+-      0:*)
+-          ETHTOOL="$(type -p ethtool)"
+-          if [ -x "$ETHTOOL" ]; then
+-              SPEED="$($ETHTOOL $INTERFACE 2>&1 |
+-                         awk '/Speed:/ { gsub(/[^0-9]*/,"",$2); print $2; }')"
+-              case $SPEED in
+-                  [0-9]*) :;; # OK
+-                  *)      SPEED=U;; # Could be "unknown"
+-              esac
+-          else
+-              INSTALL="ethtool"
 +    IWLIST="$(type -p iwlist)"
 +    if [ -x "$IWLIST" ]; then
 +      SPEED=$($IWLIST $INTERFACE rate 2>&1 |
@@ -64,24 +81,7 @@ index 31b554a..2f08709 100755
 +          if [ -n "$SPEED" ]; then
 +              echo $SPEED
 +              return
-+          fi
-+    fi
- 
--    SPEED=U
--    # Find speed in Mbps. - or not
--    case $WIRELESS:$IWLIST in
--      0:*)
-           ETHTOOL="$(type -p ethtool)"
-           if [ -x "$ETHTOOL" ]; then
-               SPEED="$($ETHTOOL $INTERFACE 2>&1 |
-                          awk '/Speed:/ { gsub(/[^0-9]*/,"",$2); print $2; }')"
--              case $SPEED in
--                  [0-9]*) :;; # OK
--                  *)      SPEED=U;; # Could be "unknown"
--              esac
--          else
--              INSTALL="ethtool"
--          fi
+           fi
 -          ;;
 -      1:/*)
 -          # Current bit rate is not very interesting, it varies too often
@@ -89,13 +89,20 @@ index 31b554a..2f08709 100755
 -                  awk 'BEGIN { RATE=U }
 -                               { if ($2 == "Mb/s") RATE=$1; } 
 -                         END   { print RATE; }')
- 
+-
 -          ;;
 -      *)
 -          # Wireless interface, cannot find iwlist
 -          INSTALL="wireless-tools"
 -          ;;
 -    esac
++    fi
++
++    ETHTOOL="$(type -p ethtool)"
++    if [ -x "$ETHTOOL" ]; then
++      SPEED="$($ETHTOOL $INTERFACE 2>&1 |
++                 awk '/Speed:/ { gsub(/[^0-9]*/,"",$2); print $2; }')"
++
 +        if [ $SPEED = [0-9]* ]; then
 +          echo $SPEED
 +            return
@@ -113,18 +120,19 @@ index 31b554a..2f08709 100755
 -              *)          SPEED=U;;
 -          esac
 -          ;;
-+    if [ -x $MIITOOL ]; then
-+      case $($MIITOOL $INTERFACE 2>&1) in
-+          *1000base*) echo 1000; return ;;
-+          *100base*)  echo 100; return ;;
-+          *10base*)   echo 10; return ;;
-     esac
+-    esac
 -
 -    # sysfs can report the speed if the driver supports it
 -    SYSFS="$(cat /sys/class/net/$INTERFACE/speed 2>/dev/null)"
 -    # If it can't, it fails on I/O, so we check cat's return value
 -    if [ $? -eq 0 -a "$SPEED" = "U" -a -n "$SYSFS" ]; then
 -        SPEED="$SYSFS"
++    if [ -x $MIITOOL ]; then
++      case $($MIITOOL $INTERFACE 2>&1) in
++          *1000base*) echo 1000; return ;;
++          *100base*)  echo 100; return ;;
++          *10base*)   echo 10; return ;;
++      esac
      fi
  
 -    case $SPEED in
@@ -137,10 +145,67 @@ index 31b554a..2f08709 100755
 +findspeed() {
 +    SPEED=$(findspeed_mbps)
 +
-+    if [ -z $SPEED ]; then
-+        echo "up.info Traffic of the $INTERFACE interface. Unable to determine interface speed.  Please install ethtool, wireless-tools, mii-tool or whatever is appropriate for the interface."
++    if [ -z $SPEED -o $SPEED = "U" ]; then
++        printf "up.info Traffic of the %s interface. Unable to determine interface speed." $INTERFACE
++        if [ $EUID -ne 0 ]; then
++                echo " Please run the plugin as root."
++        else
++                echo " Please install ethtool, wireless-tools, mii-tool or whatever is appropriate for the interface."
++        fi
++
 +        return
 +    fi
  
      BPS=$(( $SPEED * 1000 * 1000 ))
  
+@@ -207,11 +194,15 @@ case $1 in
+ esac
+ 
+ # Escape dots in the interface name (eg. vlans) before using it as a regex
+-awk -v interface="$INTERFACE" \
+-    'BEGIN { gsub(/\./, "\\.", interface) } \
+-    $1 ~ "^" interface ":" {
+-        split($0, a, /: */); $0 = a[2]; \
+-        print "down.value " $1 "\nup.value " $9 \
+-    }' \
+-    /proc/net/dev
+-
++if [ -r /sys/class/net/$INTERFACE/statistics/rx_bytes ]; then
++    echo "down.value $(cat /sys/class/net/$INTERFACE/statistics/rx_bytes)"
++    echo "up.value $(cat /sys/class/net/$INTERFACE/statistics/tx_bytes)"
++else
++    awk -v interface="$INTERFACE" \
++        'BEGIN { gsub(/\./, "\\.", interface) } \
++        $1 ~ "^" interface ":" {
++            split($0, a, /: */); $0 = a[2]; \
++            print "down.value " $1 "\nup.value " $9 \
++        }' \
++        /proc/net/dev
++fi
+diff --git a/plugins/node.d.linux/if_err_.in b/plugins/node.d.linux/if_err_.in
+index 331866d..2e35909 100755
+--- a/plugins/node.d.linux/if_err_.in
++++ b/plugins/node.d.linux/if_err_.in
+@@ -93,10 +93,15 @@ if [ "$1" = "config" ]; then
+ fi;
+ 
+ # Escape dots in the interface name (eg. vlans) before using it as a regex
+-awk -v interface="$INTERFACE" \
+-    'BEGIN { gsub(/\./, "\\.", interface) } \
+-    $1 ~ "^" interface ":" {
+-        split($0, a, /: */); $0 = a[2]; \
+-        print "rcvd.value " $3 "\ntrans.value " $11 \
+-    }' \
+-    /proc/net/dev
++if [ -r /sys/class/net/$INTERFACE/statistics/rx_bytes ]; then
++    echo "down.value $(cat /sys/class/net/$INTERFACE/statistics/rx_errors)"
++    echo "up.value $(cat /sys/class/net/$INTERFACE/statistics/tx_errors)"
++else
++    awk -v interface="$INTERFACE" \
++        'BEGIN { gsub(/\./, "\\.", interface) } \
++        $1 ~ "^" interface ":" {
++            split($0, a, /: */); $0 = a[2]; \
++            print "rcvd.value " $3 "\ntrans.value " $11 \
++        }' \
++        /proc/net/dev
++fi
similarity index 98%
rename from net-analyzer/munin/munin-1.4.6-r3.ebuild
rename to net-analyzer/munin/munin-1.4.6-r4.ebuild
index 408143a64ab01c7ef68d51e0fa4e81ecb234e65e..5ed38f46a4c8d8e6c1a3878f12f4dd9de961faac 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/munin-1.4.6-r3.ebuild,v 1.1 2011/11/03 18:08:56 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/munin-1.4.6-r4.ebuild,v 1.1 2011/11/11 11:36:04 flameeyes Exp $
 
 EAPI=2