Permalink
Browse files

Explicitly remove file permissions for settings and DB

  • Loading branch information...
1 parent 67ed381 commit 5632c35d6759f5e13a7dfe78e4ee6403ff6a8e3e @thorvald thorvald committed May 27, 2011
Showing with 16 additions and 0 deletions.
  1. +5 −0 src/mumble/Database.cpp
  2. +11 −0 src/mumble/Settings.cpp
View
@@ -94,6 +94,11 @@ Database::Database() {
qWarning("Database: Database is read-only");
}
+ {
+ QFile f(db.databaseName());
+ f.setPermissions(f.permissions() & ~(QFile::ReadGroup | QFile::WriteGroup | QFile::ExeGroup | QFile::ReadOther | QFile::WriteOther | QFile::ExeOther));
+ }
+
QSqlQuery query;
query.exec(QLatin1String("CREATE TABLE IF NOT EXISTS `servers` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT, `hostname` TEXT, `port` INTEGER DEFAULT " MUMTEXT(DEFAULT_MUMBLE_PORT) ", `username` TEXT, `password` TEXT)"));
View
@@ -716,6 +716,17 @@ void OverlaySettings::save() {
void OverlaySettings::save(QSettings* settings_ptr) {
OverlaySettings def;
+ settings_ptr->setValue(QLatin1String("version"), QLatin1String(MUMTEXT(MUMBLE_VERSION_STRING)));
+ settings_ptr->sync();
+
+#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
+ if (settings_ptr->format() == QSettings::IniFormat)
+#endif
+ {
+ QFile f(settings_ptr->fileName());
+ f.setPermissions(f.permissions() & ~(QFile::ReadGroup | QFile::WriteGroup | QFile::ExeGroup | QFile::ReadOther | QFile::WriteOther | QFile::ExeOther));
+ }
+
SAVELOAD(bEnable, "enable");
SAVELOAD(osShow, "show");

0 comments on commit 5632c35

Please sign in to comment.