diff --git a/part.cpp b/part.cpp --- a/part.cpp +++ b/part.cpp @@ -2757,6 +2757,18 @@ if ( url().isLocalFile() ) setFileToWatch( localFilePath() ); + //Set correct permission taking into account the umask value +#ifndef Q_OS_WIN + const QString saveFilePath = saveUrl.toLocalFile(); + if ( QFile::exists( saveFilePath ) ) + { + const mode_t mask = umask( 0 ); + umask( mask ); + const mode_t fileMode = 0666 & ~mask; + chmod( saveFilePath.toUtf8().constData(), fileMode ); + } +#endif + return true; }