IpcServerProcess permit list

This commit is contained in:
pokamest 2022-08-10 22:15:00 +03:00
parent 9236be7fbd
commit 3bff653bbb
12 changed files with 84 additions and 46 deletions

View file

@ -4,10 +4,32 @@
#include <QObject>
#include <QString>
#include "../client/utils.h"
#define IPC_SERVICE_URL "local:AmneziaVpnIpcInterface"
namespace amnezia {
enum PermittedProcess {
OpenVPN,
Wireguard,
CertUtil
};
inline QString permittedProcessPath(PermittedProcess pid)
{
if (pid == PermittedProcess::OpenVPN) {
return Utils::openVpnExecPath();
}
if (pid == PermittedProcess::Wireguard) {
return Utils::wireguardExecPath();
}
else if (pid == PermittedProcess::CertUtil) {
return Utils::certUtilPath();
}
}
inline QString getIpcServiceUrl() {
#ifdef Q_OS_WIN
return IPC_SERVICE_URL;