diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2021-02-12 21:31:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-12 21:31:35 +0100 |
commit | 0bcca13ad9783493ff7afc9281b076db3e5bbfda (patch) | |
tree | 81eab5c186e4f9c82c395345486099bc40c532e1 /src/library | |
parent | 1d85b626d53e5a2611b4abb701379d41df4b903a (diff) | |
parent | cf94ad8f731a5698d2f8c80e22310fb1e7e457ab (diff) |
Merge pull request #3628 from Be-ing/external_library_sandboxing
use Sandbox::askForAccess for all external library features
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/banshee/bansheefeature.cpp | 2 | ||||
-rw-r--r-- | src/library/rhythmbox/rhythmboxfeature.cpp | 3 | ||||
-rw-r--r-- | src/library/serato/seratofeature.cpp | 4 | ||||
-rw-r--r-- | src/library/traktor/traktorfeature.cpp | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/src/library/banshee/bansheefeature.cpp b/src/library/banshee/bansheefeature.cpp index 182cee18f6..d7b565ec02 100644 --- a/src/library/banshee/bansheefeature.cpp +++ b/src/library/banshee/bansheefeature.cpp @@ -79,7 +79,7 @@ void BansheeFeature::activate() { qDebug() << m_databaseFile << "does not exist"; } - if (!m_connection.open(m_databaseFile)) { + if (!Sandbox::askForAccess(m_databaseFile) || !m_connection.open(m_databaseFile)) { QMessageBox::warning( nullptr, tr("Error loading Banshee database"), diff --git a/src/library/rhythmbox/rhythmboxfeature.cpp b/src/library/rhythmbox/rhythmboxfeature.cpp index 89e2990e44..d0b54b57b5 100644 --- a/src/library/rhythmbox/rhythmboxfeature.cpp +++ b/src/library/rhythmbox/rhythmboxfeature.cpp @@ -150,7 +150,8 @@ TreeItem* RhythmboxFeature::importMusicCollection() { } } - if (!db.open(QIODevice::ReadOnly | QIODevice::Text)) { + if (!Sandbox::askForAccess(QFileInfo(db).absoluteFilePath()) || + !db.open(QIODevice::ReadOnly | QIODevice::Text)) { return nullptr; } diff --git a/src/library/serato/seratofeature.cpp b/src/library/serato/seratofeature.cpp index be6c26d56d..9d38b551c0 100644 --- a/src/library/serato/seratofeature.cpp +++ b/src/library/serato/seratofeature.cpp @@ -353,7 +353,7 @@ QString parseCrate( } QFile crateFile(crateFilePath); - if (!crateFile.open(QIODevice::ReadOnly)) { + if (!Sandbox::askForAccess(crateFilePath) || !crateFile.open(QIODevice::ReadOnly)) { qWarning() << "Failed to open file " << crateFilePath << " for reading."; @@ -534,7 +534,7 @@ QString parseDatabase(mixxx::DbConnectionPoolPtr dbConnectionPool, TreeItem* dat ")"); QFile databaseFile(databaseFilePath); - if (!databaseFile.open(QIODevice::ReadOnly)) { + if (!Sandbox::askForAccess(databaseFilePath) || !databaseFile.open(QIODevice::ReadOnly)) { qWarning() << "Failed to open file " << databaseFilePath << " for reading."; diff --git a/src/library/traktor/traktorfeature.cpp b/src/library/traktor/traktorfeature.cpp index 9ab5e2afe7..5dda60f5cb 100644 --- a/src/library/traktor/traktorfeature.cpp +++ b/src/library/traktor/traktorfeature.cpp @@ -216,7 +216,7 @@ TreeItem* TraktorFeature::importLibrary(const QString& file) { //Parse Trakor XML file using SAX (for performance) QFile traktor_file(file); - if (!traktor_file.open(QIODevice::ReadOnly | QIODevice::Text)) { + if (!Sandbox::askForAccess(file) || !traktor_file.open(QIODevice::ReadOnly | QIODevice::Text)) { qDebug() << "Cannot open Traktor music collection"; return nullptr; } |