diff options
author | Sébastien Beyou <seb35@seb35.fr> | 2021-06-29 05:57:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 05:57:27 +0300 |
commit | 0c61a7500caae5a427eef8dc38c785b5d56155a2 (patch) | |
tree | 2accba8e6a4d2489554591aac950661bc30a5f3f | |
parent | c3337d24762ec3adc1977a4820b47b1d12ceb0f0 (diff) |
Stronger condition to check NFS (#17695)
Exclude unrecognized filesystems like btrfs subvolumes.
NFS filesystems are identified as 'nfs' or 'nfs4'.
Issue: #12217
-rw-r--r-- | core/Filesystem.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/Filesystem.php b/core/Filesystem.php index 43035781f8..449dea0edf 100644 --- a/core/Filesystem.php +++ b/core/Filesystem.php @@ -152,6 +152,7 @@ class Filesystem // check if filesystem is NFS if ($returnCode == 0 && count($output) > 1 + && preg_match('/\bnfs\d?\b/', implode("\n", $output)) ) { return true; } @@ -161,9 +162,11 @@ class Filesystem $output = @shell_exec($command); if ($output) { $commandFailed = (false !== strpos($output, "no file systems processed")); - $output = explode("\n", trim($output)); + $output = trim($output); + $outputArray = explode("\n", $output); if (!$commandFailed - && count($output) > 1) { + && count($outputArray) > 1 + && preg_match('/\bnfs\d?\b/', $output)) { // check if filesystem is NFS return true; } |