IpcServerProcess permit list
This commit is contained in:
parent
9236be7fbd
commit
3bff653bbb
12 changed files with 84 additions and 46 deletions
|
|
@ -199,7 +199,7 @@ ErrorCode Ikev2Protocol::start()
|
|||
setLastError(ErrorCode::AmneziaServiceConnectionFailed);
|
||||
return ErrorCode::AmneziaServiceConnectionFailed;
|
||||
}
|
||||
certInstallProcess->setProgram("certutil");
|
||||
certInstallProcess->setProgram(PermittedProcess::CertUtil);
|
||||
QStringList arguments({"-f" , "-importpfx",
|
||||
"-p", m_config[config_key::password].toString(),
|
||||
certFile.fileName(), "NoExport"
|
||||
|
|
|
|||
|
|
@ -132,24 +132,13 @@ void OpenVpnProtocol::updateRouteGateway(QString line)
|
|||
qDebug() << "Set VPN route gateway" << m_routeGateway;
|
||||
}
|
||||
|
||||
QString OpenVpnProtocol::openVpnExecPath() const
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return Utils::executable("openvpn/openvpn", true);
|
||||
#elif defined Q_OS_LINUX
|
||||
return Utils::usrExecutable("openvpn");
|
||||
#else
|
||||
return Utils::executable("/openvpn", true);
|
||||
#endif
|
||||
}
|
||||
|
||||
ErrorCode OpenVpnProtocol::start()
|
||||
{
|
||||
#ifndef Q_OS_IOS
|
||||
//qDebug() << "Start OpenVPN connection";
|
||||
OpenVpnProtocol::stop();
|
||||
|
||||
if (!QFileInfo::exists(openVpnExecPath())) {
|
||||
if (!QFileInfo::exists(Utils::openVpnExecPath())) {
|
||||
setLastError(ErrorCode::OpenVpnExecutableMissing);
|
||||
return lastError();
|
||||
}
|
||||
|
|
@ -183,7 +172,7 @@ ErrorCode OpenVpnProtocol::start()
|
|||
setLastError(ErrorCode::AmneziaServiceConnectionFailed);
|
||||
return ErrorCode::AmneziaServiceConnectionFailed;
|
||||
}
|
||||
m_openVpnProcess->setProgram(openVpnExecPath());
|
||||
m_openVpnProcess->setProgram(PermittedProcess::OpenVPN);
|
||||
QStringList arguments({"--config" , configPath(),
|
||||
"--management", m_managementHost, QString::number(m_managementPort),
|
||||
"--management-client"/*, "--log", vpnLogFileNamePath */
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ protected slots:
|
|||
|
||||
private:
|
||||
QString configPath() const;
|
||||
QString openVpnExecPath() const;
|
||||
bool openVpnProcessIsRunning() const;
|
||||
bool sendTermSignal();
|
||||
void readOpenVpnConfiguration(const QJsonObject &configuration);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ void WireguardProtocol::stop()
|
|||
//qDebug() << "WireguardProtocol::stop() 1";
|
||||
|
||||
#ifndef Q_OS_IOS
|
||||
if (!QFileInfo::exists(wireguardExecPath())) {
|
||||
if (!QFileInfo::exists(Utils::wireguardExecPath())) {
|
||||
qCritical() << "Wireguard executable missing!";
|
||||
setLastError(ErrorCode::ExecutableMissing);
|
||||
return;
|
||||
|
|
@ -51,7 +51,7 @@ void WireguardProtocol::stop()
|
|||
return;
|
||||
}
|
||||
|
||||
m_wireguardStopProcess->setProgram(wireguardExecPath());
|
||||
m_wireguardStopProcess->setProgram(PermittedProcess::Wireguard);
|
||||
|
||||
|
||||
QStringList arguments({"--remove", configPath()});
|
||||
|
|
@ -117,17 +117,6 @@ void WireguardProtocol::updateRouteGateway(QString line)
|
|||
qDebug() << "Set VPN route gateway" << m_routeGateway;
|
||||
}
|
||||
|
||||
QString WireguardProtocol::wireguardExecPath() const
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return Utils::executable("wireguard/wireguard-service", true);
|
||||
#elif defined Q_OS_LINUX
|
||||
return Utils::usrExecutable("wg");
|
||||
#else
|
||||
return Utils::executable("/wireguard", true);
|
||||
#endif
|
||||
}
|
||||
|
||||
ErrorCode WireguardProtocol::start()
|
||||
{
|
||||
//qDebug() << "WireguardProtocol::start() 1";
|
||||
|
|
@ -141,7 +130,7 @@ ErrorCode WireguardProtocol::start()
|
|||
//qDebug() << "Start Wireguard connection";
|
||||
WireguardProtocol::stop();
|
||||
|
||||
if (!QFileInfo::exists(wireguardExecPath())) {
|
||||
if (!QFileInfo::exists(Utils::wireguardExecPath())) {
|
||||
setLastError(ErrorCode::ExecutableMissing);
|
||||
return lastError();
|
||||
}
|
||||
|
|
@ -168,7 +157,7 @@ ErrorCode WireguardProtocol::start()
|
|||
return ErrorCode::AmneziaServiceConnectionFailed;
|
||||
}
|
||||
|
||||
m_wireguardStartProcess->setProgram(wireguardExecPath());
|
||||
m_wireguardStartProcess->setProgram(PermittedProcess::Wireguard);
|
||||
|
||||
|
||||
QStringList arguments({"--add", configPath()});
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@ public:
|
|||
|
||||
private:
|
||||
QString configPath() const;
|
||||
QString wireguardExecPath() const;
|
||||
//bool openVpnProcessIsRunning() const;
|
||||
void readWireguardConfiguration(const QJsonObject &configuration);
|
||||
|
||||
void updateRouteGateway(QString line);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue