diff options
author | Nick Holloway <nick.holloway@pyrites.org.uk> | 2016-02-14 17:54:38 +0000 |
---|---|---|
committer | Nick Holloway <nick.holloway@pyrites.org.uk> | 2016-02-14 17:54:38 +0000 |
commit | 921e237fdeecdf6a362b33afd1bbdd365aa350c6 (patch) | |
tree | 7b11e31d58853a16cb687e9a1ec5c8aad5913290 /src/etc/ecl.php | |
parent | 2efb39d092a971c6ea8d06b25c315be7d400c4a1 (diff) | |
download | pfsense-921e237fdeecdf6a362b33afd1bbdd365aa350c6.zip pfsense-921e237fdeecdf6a362b33afd1bbdd365aa350c6.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.
Diffstat (limited to 'src/etc/ecl.php')
-rwxr-xr-x | src/etc/ecl.php | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/etc/ecl.php b/src/etc/ecl.php index 15205f1..2e99d18 100755 --- a/src/etc/ecl.php +++ b/src/etc/ecl.php @@ -50,14 +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() { |