Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nemo-qml-plugin-systemsettings
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
martyone
nemo-qml-plugin-systemsettings
Commits
f8769e8d
Commit
f8769e8d
authored
Oct 16, 2017
by
Andrew Branson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[storage] Check filesystem type against /proc/filesystems when deciding canMount. Fixes JB#39217
parent
bd87c1bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
src/partitionmanager.cpp
src/partitionmanager.cpp
+14
-1
No files found.
src/partitionmanager.cpp
View file @
f8769e8d
...
...
@@ -315,6 +315,19 @@ void PartitionManagerPrivate::refresh(const Partitions &partitions, Partitions &
blkid_cache
cache
=
nullptr
;
// Query filesystems supported by this device
// Note this will only find filesystems supported either directly by the
// kernel, or by modules already loaded.
QStringList
supportedFs
;
QFile
filesystems
(
QStringLiteral
(
"/proc/filesystems"
));
if
(
filesystems
.
open
(
QIODevice
::
ReadOnly
))
{
QString
line
=
filesystems
.
readLine
();
while
(
line
.
length
()
>
0
)
{
supportedFs
<<
line
.
trimmed
().
split
(
'\t'
).
last
();
line
=
filesystems
.
readLine
();
}
}
for
(
auto
partition
:
partitions
)
{
if
(
partition
->
status
==
Partition
::
Mounted
)
{
struct
statvfs64
stat
;
...
...
@@ -355,7 +368,7 @@ void PartitionManagerPrivate::refresh(const Partitions &partitions, Partitions &
if
(
char
*
const
type
=
blkid_get_tag_value
(
cache
,
"TYPE"
,
partition
->
devicePath
.
toUtf8
().
constData
()))
{
partition
->
filesystemType
=
QString
::
fromUtf8
(
type
);
partition
->
canMount
=
!
partition
->
filesystemType
.
isEmpty
();
partition
->
canMount
=
!
partition
->
filesystemType
.
isEmpty
()
&&
supportedFs
.
contains
(
partition
->
filesystemType
)
;
::
free
(
type
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment