[tor-commits] [onionperf/master] Add path validation to filter interface

karsten at torproject.org karsten at torproject.org
Fri Sep 18 08:29:49 UTC 2020


commit 1a81b3dff756cf197d661f931485443d1454c7c4
Author: Ana Custura <ana at netstat.org.uk>
Date:   Fri Aug 21 01:38:01 2020 +0100

    Add path validation to filter interface
---
 onionperf/onionperf | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/onionperf/onionperf b/onionperf/onionperf
index b1e7bd3..96c6869 100755
--- a/onionperf/onionperf
+++ b/onionperf/onionperf
@@ -439,6 +439,9 @@ def analyze(args):
 def filter(args):
     from onionperf.filtering import Filtering
 
+    p = os.path.abspath(os.path.expanduser(args.input))
+    if not os.path.exists(p):
+        raise argparse.ArgumentTypeError("path '%s' does not exist" % args.input)
     filtering = Filtering()
     filtering.read_input(args.input)
     if args.include_fingerprints is not None:





More information about the tor-commits mailing list