Fix for AVP-01-006 - inscure app config permissions
This commit is contained in:
parent
340bbd8727
commit
cdb1a4c288
2 changed files with 23 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include "amnezia_application.h"
|
#include "amnezia_application.h"
|
||||||
|
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
|
#include <QStandardPaths>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
|
|
||||||
|
@ -49,6 +50,24 @@
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
setQuitOnLastWindowClosed(false);
|
setQuitOnLastWindowClosed(false);
|
||||||
|
|
||||||
|
// Fix config file permissions
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
{
|
||||||
|
QSettings s(ORGANIZATION_NAME, APPLICATION_NAME);
|
||||||
|
s.setValue("permFixed", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString configLoc1 = QStandardPaths::standardLocations(QStandardPaths::ConfigLocation).first() + "/"
|
||||||
|
+ ORGANIZATION_NAME + "/" + APPLICATION_NAME + ".conf";
|
||||||
|
QFile::setPermissions(configLoc1, QFileDevice::ReadOwner | QFileDevice::WriteOwner);
|
||||||
|
|
||||||
|
QString configLoc2 = QStandardPaths::standardLocations(QStandardPaths::ConfigLocation).first() + "/"
|
||||||
|
+ ORGANIZATION_NAME + "/" + APPLICATION_NAME + "/" + APPLICATION_NAME + ".conf";
|
||||||
|
QFile::setPermissions(configLoc2, QFileDevice::ReadOwner | QFileDevice::WriteOwner);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
m_settings = std::shared_ptr<Settings>(new Settings);
|
m_settings = std::shared_ptr<Settings>(new Settings);
|
||||||
m_serverController = std::shared_ptr<ServerController>(new ServerController(m_settings, this));
|
m_serverController = std::shared_ptr<ServerController>(new ServerController(m_settings, this));
|
||||||
m_configurator = std::shared_ptr<VpnConfigurator>(new VpnConfigurator(m_settings, m_serverController, this));
|
m_configurator = std::shared_ptr<VpnConfigurator>(new VpnConfigurator(m_settings, m_serverController, this));
|
||||||
|
|
|
@ -162,7 +162,10 @@ QByteArray SecureQSettings::decryptText(const QByteArray& ba) const
|
||||||
|
|
||||||
bool SecureQSettings::encryptionRequired() const
|
bool SecureQSettings::encryptionRequired() const
|
||||||
{
|
{
|
||||||
// TODO: review on linux
|
#ifdef Q_OS_LINUX
|
||||||
|
// QtKeyChain failing on Linux
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue