[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] When stdin is not attached to a tty exit early



commit ea12da31eceb3c79b259da5edb562a282022a7d8
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date:   Fri Oct 28 19:24:34 2016 +0200

    When stdin is not attached to a tty exit early
---
 ooni/ui/cli.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ooni/ui/cli.py b/ooni/ui/cli.py
index 6228d2f..c545d82 100644
--- a/ooni/ui/cli.py
+++ b/ooni/ui/cli.py
@@ -174,6 +174,10 @@ def director_startup_other_failures(failure):
 
 def initializeOoniprobe(global_options):
     print("It looks like this is the first time you are running ooniprobe")
+    if not sys.stdin.isatty():
+        print("ERROR: STDIN is not attached to a tty. Quiting.")
+        sys.exit(8)
+
     print("Please take a minute to read through the informed consent documentation and "
           "understand what are the risks associated with running ooniprobe.")
     print("Press enter to continue...")



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits