summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-11-17 22:25:04 -0800
committerThiago Macieira <thiago.macieira@intel.com>2016-05-09 06:04:26 +0000
commitd9f6b6d1f836c25a8179ae7a6df18ee9cceebfb1 (patch)
tree77a2905f4ed8040e8eec89c3a352f167d2ecef60 /src
parentb168c6c8248662da31dbaaf2afb8e771a9ecdc85 (diff)
QStorageInfo: update the detection of pseudo filesystems
Allow tmpfs filesystems to be reported, as they're often usable by the user, mounted in /tmp and in /run (the fs for $XDG_RUNTIME_DIR). But disallow anything whose device is not a pathname. This catches most of everything else that wasn't specifically tested for before, like virtual fuse filesystems, like GVFS. Change-Id: I3e15a26e0e424169ac2bffff1417b7cee0f8ec97 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index bbcc29c50b..bf998993d8 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -160,12 +160,15 @@ static bool isPseudoFs(const QStorageIterator &it)
QByteArray type = it.fileSystemType();
if (type == "tmpfs")
- return true;
+ return false;
#if defined(Q_OS_LINUX)
if (type == "rootfs" || type == "rpc_pipefs")
return true;
#endif
+ if (!it.device().startsWith('/'))
+ return true;
+
return false;
}