diff options
author | Simon Rettberg | 2022-05-05 16:35:35 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-05-05 16:36:04 +0200 |
commit | fc778c5d3970cfcd10c2e6820427b664f403aedf (patch) | |
tree | 546c6fedefd4dd3886b62b766ce285cf102a3a94 /modules-available/statistics/inc | |
parent | [passthrough] Make menu item collapsed (diff) | |
download | slx-admin-fc778c5d3970cfcd10c2e6820427b664f403aedf.tar.gz slx-admin-fc778c5d3970cfcd10c2e6820427b664f403aedf.tar.xz slx-admin-fc778c5d3970cfcd10c2e6820427b664f403aedf.zip |
[statistics] Don't try to check MBR partition IDs for non-MBR drives
Fixes #3908
Diffstat (limited to 'modules-available/statistics/inc')
-rw-r--r-- | modules-available/statistics/inc/hardwareparser.inc.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/modules-available/statistics/inc/hardwareparser.inc.php b/modules-available/statistics/inc/hardwareparser.inc.php index 952abf91..16710a9f 100644 --- a/modules-available/statistics/inc/hardwareparser.inc.php +++ b/modules-available/statistics/inc/hardwareparser.inc.php @@ -515,11 +515,13 @@ class HardwareParser foreach (($dev['sfdisk']['partitiontable']['partitions'] ?? []) as $part) { if (!isset($part['size'])) continue; - $type = hexdec($part['type'] ?? '0'); - if ($type === 0x0 || $type === 0x5 || $type === 0xf || $type === 0x15 || $type === 0x1f - || $type === 0x85 || $type === 0xc5 || $type == 0xcf) { - // Extended partition, ignore - continue; + if ($table['partition_table'] === 'dos') { + $type = hexdec($part['type'] ?? '0'); + if ($type === 0x0 || $type === 0x5 || $type === 0xf || $type === 0x15 || $type === 0x1f + || $type === 0x85 || $type === 0xc5 || $type == 0xcf) { + // Extended partition, ignore + continue; + } } $used += $part['size'] * $fac; $id = 'part_' . $i . '_'; |