summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-07-16 21:35:51 +0545
committerRenato Botelho <renato@netgate.com>2015-07-16 16:03:02 -0300
commit693c13cb74fedd1e3b57927b755099f112f0b986 (patch)
treef64682ef3a66d4b3d639a266bbcce33c485dcf52
parent3eed76d729a8c5bbd45637157fd0170df67ec739 (diff)
downloadpfsense-693c13cb74fedd1e3b57927b755099f112f0b986.zip
pfsense-693c13cb74fedd1e3b57927b755099f112f0b986.tar.gz
Restrict serial ports glob to cua followed by alpha
Improve this a little more to match only alpha after /dev/cua (/dev/cuau for example)
-rw-r--r--usr/local/www/interfaces_ppps_edit.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php
index 860b4a3..2ab9997 100644
--- a/usr/local/www/interfaces_ppps_edit.php
+++ b/usr/local/www/interfaces_ppps_edit.php
@@ -449,11 +449,11 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE"
mwexec("/bin/mkdir -p /var/spool/lock");
// $serialports = pfSense_get_modem_devices();
// Match files in /dev starting with "cua" then:
- // ? = any single character e.g. like "cuau"
+ // [a-zA-Z] = any single alpha character e.g. like "cuau"
// [0-9] = a digit from 0 to 9
// stuff in {} = the various possible digit and dot combinations to allow an optional 2nd digit, dot, followed by 1 or 2 optional digits
- // This supports up to 100 devices (0 to 99), e.g. cuau0 cuau1 ... cuau10 cuau11 ... cuau99 and also possibilities like cuau1.1 cuau1.11 cuau11.1 cuau11.11
- $serialports = glob("/dev/cua?[0-9]{,.[0-9],.[0-9][0-9],[0-9],[0-9].[0-9],[0-9].[0-9][0-9]}", GLOB_BRACE);
+ // This supports up to 100 device numbers (0 to 99), e.g. cuau0 cuau1 ... cuau10 cuau11 ... cuau99 and also possibilities like cuau1.1 cuau1.11 cuau11.1 cuau11.11
+ $serialports = glob("/dev/cua[a-zA-Z][0-9]{,.[0-9],.[0-9][0-9],[0-9],[0-9].[0-9],[0-9].[0-9][0-9]}", GLOB_BRACE);
$serport_count = 0;
foreach ($serialports as $port) {
$serport_count++;
OpenPOWER on IntegriCloud