diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-02-14 12:10:00 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-02-14 12:10:00 -0800 |
commit | 72728a87d04ab3027960f7667840e4d4f781bb7d (patch) | |
tree | 5538e918919c5decea36d9c3d64d1a7c4ae5ff72 | |
parent | 33e9fbd53200bcb39b19fe9258679e9c27b67c2f (diff) | |
download | vyatta-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.pm | 4 |
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: # |