summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-14 12:10:00 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-14 12:10:00 -0800
commit72728a87d04ab3027960f7667840e4d4f781bb7d (patch)
tree5538e918919c5decea36d9c3d64d1a7c4ae5ff72
parent33e9fbd53200bcb39b19fe9258679e9c27b67c2f (diff)
downloadvyatta-cfg-qos-72728a87d04ab3027960f7667840e4d4f781bb7d.tar.gz
vyatta-cfg-qos-72728a87d04ab3027960f7667840e4d4f781bb7d.zip
use sudo to run ethtool
But do it in a manner safe from quoting attacks!
-rw-r--r--scripts/VyattaQosUtil.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/VyattaQosUtil.pm b/scripts/VyattaQosUtil.pm
index 86b091a..1e77179 100644
--- a/scripts/VyattaQosUtil.pm
+++ b/scripts/VyattaQosUtil.pm
@@ -169,7 +169,9 @@ sub ethtoolRate {
my ($dev) = @_;
my $rate = undef;
- open my $ethtool, "ethtool $dev |" or die "ethtool failed: $!\n";
+ open my $ethtool, "-|"
+ or exec 'sudo', 'ethtool', $dev
+ or die "ethtool failed: $!\n";
# ethtool produces:
#