Fix: Make sure umask is used when creating new files

When a new file was created from the file menu, the permissions
on *nix was always 0600 regardless of the proess' current umask.
Fixed by letting CorePlugin::initialize() initialize the umask in
Utils::SaveFile. Since getting the system's umask is not thread
safe this can't be done directly in SaveFile::open.

Task-number: QTCREATORBUG-6513
Change-Id: I10d8b2f4ab85574ed3004b5e646664c2255196b9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Knut Petter Svendsen
2013-01-28 21:15:04 +01:00
committed by Orgad Shaneh
parent 7fcc52bf47
commit f556e8f5f2
3 changed files with 46 additions and 1 deletions

View File

@@ -49,10 +49,13 @@ public:
void setBackup(bool backup) { m_backup = backup; }
static void initializeUmask();
private:
const QString m_finalFileName;
bool m_finalized;
bool m_backup;
static QFile::Permissions m_umask;
};
} // namespace Utils