From: Bdale Garbee Date: Tue, 27 May 2025 18:17:06 +0000 (-0600) Subject: use smarter approach to escaping command strings for os.system X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=6b0c4a3c88ff8dcf1a94462a0e6f46a179f8a871;p=fw%2Fquantimotor use smarter approach to escaping command strings for os.system --- diff --git a/ui/app.py b/ui/app.py index 14bdaee..81cdcf6 100755 --- a/ui/app.py +++ b/ui/app.py @@ -318,7 +318,7 @@ def runatest(): global ctx # turn triggered buffering on - os.system("echo 1 > /sys/bus/iio/devices/iio\:device0/buffer0/enable") + os.system(shlex.quote("echo 1 > /sys/bus/iio/devices/iio:device0/buffer0/enable")) # create data logging thread loggertask = DataReader(ctx) @@ -345,7 +345,7 @@ def endatest(): pyrotask.join() # turn triggered buffering off so low speed iio actions work while idle - os.system("echo 0 > /sys/bus/iio/devices/iio\:device0/buffer0/enable") + os.system(shlex.quote("echo 0 > /sys/bus/iio/devices/iio:device0/buffer0/enable")) status = "idle"