[tor-bugs] #29073 [Core Tor/Tor]: shellcheck: linux-tor-prio.sh issues

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Jan 11 15:53:56 UTC 2019


#29073: shellcheck: linux-tor-prio.sh issues
------------------------------+--------------------
     Reporter:  rl1987        |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------
 {{{

 In linux-tor-prio.sh line 98:
 MTU=1500
 ^-- SC2034: MTU appears unused. Verify use (or export if used externally).


 In linux-tor-prio.sh line 108:
 BDP=$(expr $RTT_LATENCY \* $RATE_UP / $AVG_PKT)
       ^-- SC2003: expr is antiquated. Consider rewriting this using
 $((..)), ${} or [[ ]].


 In linux-tor-prio.sh line 113:
 BDP=$(expr $BDP / 4)
       ^-- SC2003: expr is antiquated. Consider rewriting this using
 $((..)), ${} or [[ ]].
            ^-- SC2086: Double quote to prevent globbing and word
 splitting.


 In linux-tor-prio.sh line 151:
 ip link set dev $DEV qlen $BDP
                           ^-- SC2086: Double quote to prevent globbing and
 word splitting.


 In linux-tor-prio.sh line 161:
 tc class add dev $DEV parent 1:1 classid 1:20 htb rate $(expr $RATE_UP -
 $RATE_UP_TOR)kbit ceil ${RATE_UP}kbit prio 0
                                                        ^-- SC2046: Quote
 this to prevent word splitting.
                                                          ^-- SC2003: expr
 is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].


 In linux-tor-prio.sh line 162:
 tc class add dev $DEV parent 1:1 classid 1:21 htb rate $[$RATE_UP_TOR]kbit
 ceil ${RATE_UP_TOR_CEIL}kbit prio 10
                                                        ^-- SC2007: Use
 $((..)) instead of deprecated $[..]


 In linux-tor-prio.sh line 165:
 tc qdisc add dev $DEV parent 1:20 handle 20: pfifo limit $BDP
                                                          ^-- SC2086:
 Double quote to prevent globbing and word splitting.


 In linux-tor-prio.sh line 166:
 tc qdisc add dev $DEV parent 1:21 handle 21: pfifo limit $BDP
                                                          ^-- SC2086:
 Double quote to prevent globbing and word splitting.


 In linux-tor-prio.sh line 179:
 if [ ""$TOR_IP == "" ]
        ^-- SC2086: Double quote to prevent globbing and word splitting.


 In linux-tor-prio.sh line 182:
         iptables -t mangle -A TORSHAPER-OUT -m owner --uid-owner $TOR_UID
 -j MARK --set-mark 21
                                                                  ^--
 SC2086: Double quote to prevent globbing and word splitting.


 In linux-tor-prio.sh line 185:
         iptables -t mangle -A TORSHAPER-OUT -s $TOR_IP -j MARK --set-mark
 21
                                                ^-- SC2086: Double quote to
 prevent globbing and word splitting.

 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/29073>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list