diff options
author | Nick Holloway <nick.holloway@pyrites.org.uk> | 2016-02-14 14:04:35 +0000 |
---|---|---|
committer | Nick Holloway <nick.holloway@pyrites.org.uk> | 2016-02-14 14:05:31 +0000 |
commit | e7733965b4047e9410c19ad938d6bb2bf7fe3b9b (patch) | |
tree | 4e733b9d368a44e20855c48377e57492ffc0ecd1 /etc | |
parent | efebd867ec266120cc682e20bae15b38cae6c04a (diff) | |
download | pfsense-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.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/ecl.php | 8 |
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() { |