summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Holloway <nick.holloway@pyrites.org.uk>2016-02-14 14:04:35 +0000
committerNick Holloway <nick.holloway@pyrites.org.uk>2016-02-14 14:05:31 +0000
commite7733965b4047e9410c19ad938d6bb2bf7fe3b9b (patch)
tree4e733b9d368a44e20855c48377e57492ffc0ecd1
parentefebd867ec266120cc682e20bae15b38cae6c04a (diff)
downloadpfsense-e7733965b4047e9410c19ad938d6bb2bf7fe3b9b.zip
pfsense-e7733965b4047e9410c19ad938d6bb2bf7fe3b9b.tar.gz
Fix #5890 find disk slices as candidates for loading "config.xml" at boot
In commit 873c1701, the call to "/bin/ls /dev/{$disk}s*" was surrounded with "escapeshellarg" so the wildcard is not expanded. Use "glob" to find the slices for a disk instead.
-rwxr-xr-xetc/ecl.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/etc/ecl.php b/etc/ecl.php
index 9aa07d5..53e7637 100755
--- a/etc/ecl.php
+++ b/etc/ecl.php
@@ -50,13 +50,9 @@ function get_swap_disks() {
function get_disk_slices($disk) {
global $g, $debug;
- $slices_array = array();
- $slices = trim(exec("/bin/ls " . escapeshellarg("/dev/" . $disk . "s*") . " 2>/dev/null"));
+ $slices = glob("/dev/" . $disk . "s*");
$slices = str_replace("/dev/", "", $slices);
- if($slices == "ls: No match.")
- return;
- $slices_array = explode(" ", $slices);
- return $slices_array;
+ return $slices;
}
function get_disks() {
OpenPOWER on IntegriCloud