From 3a08f10e1993df99d531f186fc657078962aa9bb Mon Sep 17 00:00:00 2001 From: Changlei Li Date: Tue, 18 Nov 2025 13:52:52 +0800 Subject: [PATCH] CA-420524 Do not allow input a non-exist device in network reset Find the device from /sys/class/net/ to check if it exists. Signed-off-by: Changlei Li --- plugins-base/XSFeatureNetworkReset.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins-base/XSFeatureNetworkReset.py b/plugins-base/XSFeatureNetworkReset.py index 45699d2..433359a 100644 --- a/plugins-base/XSFeatureNetworkReset.py +++ b/plugins-base/XSFeatureNetworkReset.py @@ -216,6 +216,9 @@ def HandleKeyDEVICE(self, inKey): if self.device == "": pane.InputIndexSet(None) Layout.Inst().PushDialogue(InfoDialogue(Lang('Invalid device name'))) + elif not os.path.isdir('/sys/class/net/' + self.device): + pane.InputIndexSet(None) + Layout.Inst().PushDialogue(InfoDialogue(Lang('Device does not exist'))) elif (self.vlan != '') and not valid_vlan(self.vlan): pane.InputIndexSet(None) Layout.Inst().PushDialogue(InfoDialogue(Lang('VLAN tag must be between 0 and 4094')))