summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-03-09 21:44:34 +0100
committerChristian Poessinger <christian@poessinger.com>2021-03-09 21:48:00 +0100
commitb25835146ade459a39e10e674c9b3a6fdd11bd04 (patch)
tree6af676615aae0db6bfae3d8a0a5716038a347c29
parent74ca56b72f6bd8b794dd4503cf682db6c9ba0635 (diff)
downloadvyos-1x-b25835146ade459a39e10e674c9b3a6fdd11bd04.tar.gz
vyos-1x-b25835146ade459a39e10e674c9b3a6fdd11bd04.zip
console-server: T3382: proper check for existence of /dev/serial/by-bus
The completion helper was directly called on the /dev/serial/by-bus directory, but it was not verified if the directory exists at all. (cherry picked from commit e06e5b914cd0b51848d9b836467f49b99cfe40cc)
-rw-r--r--interface-definitions/service_console-server.xml.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/interface-definitions/service_console-server.xml.in b/interface-definitions/service_console-server.xml.in
index 59a9fe237..5905afe58 100644
--- a/interface-definitions/service_console-server.xml.in
+++ b/interface-definitions/service_console-server.xml.in
@@ -13,7 +13,7 @@
<help>System serial interface name (ttyS or ttyUSB)</help>
<completionHelp>
<script>ls -1 /dev | grep ttyS</script>
- <script>ls -1 /dev/serial/by-bus</script>
+ <script>if [ -d /dev/serial/by-bus ]; then ls -1 /dev/serial/by-bus; fi</script>
</completionHelp>
<valueHelp>
<format>ttySxxx</format>
@@ -36,7 +36,7 @@
<list>300 1200 2400 4800 9600 19200 38400 57600 115200</list>
</completionHelp>
<constraint>
- <regex>(300|1200|2400|4800|9600|19200|38400|57600|115200)</regex>
+ <regex>^(300|1200|2400|4800|9600|19200|38400|57600|115200)$</regex>
</constraint>
</properties>
</leafNode>
@@ -47,7 +47,7 @@
<list>7 8</list>
</completionHelp>
<constraint>
- <regex>(7|8)</regex>
+ <validator name="numeric" argument="--range 7-8"/>
</constraint>
</properties>
<defaultValue>8</defaultValue>
@@ -59,7 +59,7 @@
<list>1 2</list>
</completionHelp>
<constraint>
- <regex>(1|2)</regex>
+ <validator name="numeric" argument="--range 1-2"/>
</constraint>
</properties>
<defaultValue>1</defaultValue>
@@ -71,7 +71,7 @@
<list>even odd none</list>
</completionHelp>
<constraint>
- <regex>(even|odd|none)</regex>
+ <regex>^(even|odd|none)$</regex>
</constraint>
</properties>
<defaultValue>none</defaultValue>