Handle $disk['fsType'] possibly having "luks:" prefix which checking file system type.

Don't permit choosing encrypted file system type if there's no encryption keyfile present. (Don't know
if this is such as good idea or not, may end up changing this again.)
This commit is contained in:
Tom Mortensen
2017-09-04 11:48:54 -07:00
parent fa3ee1708c
commit 26e59bfb5c
3 changed files with 18 additions and 11 deletions
+1 -1
View File
@@ -201,7 +201,7 @@ foreach ($devices as $device) {
exec("smartctl -a $type ".escapeshellarg("/dev/$dev")." 2>/dev/null|todos >".escapeshellarg("/$diag/smart/$name-$date.txt"));
}
// create cache pool information
if (is_dir('/mnt/cache') && $disks['cache']['fsType']=='btrfs') {
if (is_dir('/mnt/cache') && strpos($disks['cache']['fsType'],'btrfs')) {
exec("/sbin/btrfs filesystem usage /mnt/cache 2>/dev/null|todos >".escapeshellarg("/$diag/system/btrfs-usage.txt"));
}
// create resulting zip file and remove temp folder
+1 -1
View File
@@ -236,7 +236,7 @@ foreach ($disks as $disk) {
if ($disk['numErrors']>0) $errors[] = "$text - $info (errors {$disk['numErrors']})";
// check file system of cache pool
$item = 'pool';
if ($name=='cache' && $disk['fsType']=='btrfs') {
if ($name=='cache' && strpos($disk['fsType'],'btrfs')) {
$attr = 'missing';
if (exec("/sbin/btrfs filesystem show {$disk['uuid']} 2>/dev/null|grep -c 'missing'")>0) {
if (empty($saved[$item][$attr])) {