Fix possible command injection in os.system()

This commit is contained in:
Daniel Mach authored and Alfredo Monclus committed 2026-03-23 12:14:17 -03:00
1 parent e26e1bebfe
commit 573d021126
1 file changed
+4 -2
+4 -2
View File
@@ -706,8 +706,10 @@ class KlipperScreen(Gtk.Window):
def set_screenblanking_timeout(self, time):
# disable screensaver we have our own
if not self.wayland:
os.system(f"xset -display {self.display_number} s off")
os.system(f"xset -display {self.display_number} s noblank")
cmd = ["xset", "-display", self.display_number, "s", "off"]
subprocess.call(cmd)
cmd = ["xset", "-display", self.display_number, "s", "noblank"]
subprocess.call(cmd)
if time == "off":
self.blanking_time = 0
else: