diff options
author | Daniel Schürmann <daschuer@mixxx.org> | 2021-06-17 12:16:14 +0200 |
---|---|---|
committer | Daniel Schürmann <daschuer@mixxx.org> | 2021-06-17 14:08:46 +0200 |
commit | ab21ec0b3eacfef7b5be54b929eb01b856823b99 (patch) | |
tree | 0f13b87418086e4cacd2dccc0f2d62009bd3141f /src/sources | |
parent | 3e0bc877e307ba59aa8048d357d2abe07cefdb4f (diff) |
Check if file is writable before making a copy for writing
Diffstat (limited to 'src/sources')
-rw-r--r-- | src/sources/metadatasourcetaglib.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sources/metadatasourcetaglib.cpp b/src/sources/metadatasourcetaglib.cpp index 607e9881cf..b1660e6441 100644 --- a/src/sources/metadatasourcetaglib.cpp +++ b/src/sources/metadatasourcetaglib.cpp @@ -630,6 +630,14 @@ class SafelyWritableFile final { // See also: https://bugs.launchpad.net/mixxx/+bug/1815305 DEBUG_ASSERT(m_origFileName.isNull()); DEBUG_ASSERT(m_tempFileName.isNull()); + if (!QFileInfo(origFileName).isWritable()) { + kLogger.warning() + << "Failed to prepare file for writing:" + << origFileName + << "is not writable."; + // Abort constructor + return; + } if (useTemporaryFile) { QString tempFileName = origFileName + kSafelyWritableTempFileSuffix; QFile origFile(origFileName); |