Merge pull request #6958 from nextcloud/bugfix/preventCrashOnEncryptShellIntegrationRequests

prevent event loop reentrance when handling ENCRYPT socket requests
This commit is contained in:
Matthieu Gallien 2024-08-07 12:17:00 +02:00 committed by GitHub
commit 5ed29db71d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -444,6 +444,13 @@ void SocketApi::slotReadSocket()
<< "with argument:" << argument;
socketApiJob->failure(QStringLiteral("command not found"));
}
} else if (command.startsWith("ENCRYPT")) {
if (indexOfMethod != -1) {
ASSERT(thread() == QThread::currentThread())
staticMetaObject.method(indexOfMethod)
.invoke(this, Qt::QueuedConnection, Q_ARG(QString, argument.toString()),
Q_ARG(SocketListener *, listener.data()));
}
} else {
if (indexOfMethod != -1) {
// to ensure that listener is still valid we need to call it with Qt::DirectConnection