Restrict QLocalServer access

The default is world access which means even even unprivileged local
accounts can connect to it too.
This commit is contained in:
Chocobo1 2019-06-27 20:33:05 +08:00
parent 6119cb370f
commit 46ee193cd8
No known key found for this signature in database
GPG key ID: 210D9C873253A68C

View file

@ -101,6 +101,7 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
#endif
server = new QLocalServer(this);
server->setSocketOptions(QLocalServer::UserAccessOption);
QString lockName = QDir(QDir::tempPath()).absolutePath()
+ QLatin1Char('/') + socketName
+ QLatin1String("-lockfile");