Don't require root permissions unless needed

Previously webplot would always try to add a new iptables rule to
allow incoming connections to go through the firewall.  This is only
needed if iptables is, in fact, blocking that traffic.  ChromeOS uses
this, but most other systems do not.  The result was that you always
needed sudo access to run webplot.

This CL adds a command line flag "--behind_firewall" that allows you
to tell webplot that it needs to check for the iptables rule.  The
flag defaults to false, so you won't be asked for a sudo password
unless you specify it.  This CL also updates the ChromeOS wrapper
for it to reflect these changes, so it will always use this flag
since you need to do this on Chromebooks.

BUG=chromium:508636
TEST=emerged onto a Kip and it all works, and it works without root
access on my development machine.
CQ-DEPEND=I5c767b5bf9481859fdd978e53cd0ef41fb7b7e3a

Change-Id: Ifd1329bd97758bce705c4a0c9f868e451bcbd411
Signed-off-by: Charlie Mooney <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/284738
Reviewed-by: Shyh-In Hwang <[email protected]>
2 files changed