Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent event loop reentrance when handling ENCRYPT socket requests #6958

Merged

Conversation

mgallien
Copy link
Collaborator

when receiving a shell integration socket command for ENCRYPT, a generic interface and generic code paths was used

the assumption was that the listener socket would need (and remain) valid while hanlding teh request

some code paths need to display error messages to the user via a QMessageBox

the issue is that this will execute a Qt event loop that will handle the socket disconnection while the socket variable from the caller seems it will stay valid and alive

prevent that by not using a blocking method invocation such that life time mishandling about the socket listener is not possible

@mgallien mgallien requested review from camilasan and claucambra July 31, 2024 16:24
@mgallien
Copy link
Collaborator Author

/backport to stable-3.13

@mgallien
Copy link
Collaborator Author

/backport to stable-3.12

@mgallien mgallien enabled auto-merge August 7, 2024 08:13
when receiving a shell integration socket command for ENCRYPT, a generic
interface and generic code paths was used

the assumption was that the listener socket would need (and remain)
valid while hanlding teh request

some code paths need to display error messages to the user via a
QMessageBox

the issue is that this will execute a Qt event loop that will handle the
socket disconnection while the socket variable from the caller seems it
will stay valid and alive

prevent that by not using a blocking method invocation such that life
time mishandling about the socket listener is not possible

Signed-off-by: Matthieu Gallien <[email protected]>
@mgallien mgallien force-pushed the bugfix/preventCrashOnEncryptShellIntegrationRequests branch from 9d665ca to f2cfd2c Compare August 7, 2024 08:13
@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-6958-f2cfd2cc80fd5120a2789914630ee7e69f98335c-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

Copy link

sonarqubecloud bot commented Aug 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
D Maintainability Rating on New Code (required ≥ A)
12 New Code Smells (required ≤ 0)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@mgallien mgallien merged commit 5ed29db into master Aug 7, 2024
12 of 15 checks passed
@mgallien mgallien deleted the bugfix/preventCrashOnEncryptShellIntegrationRequests branch August 7, 2024 10:17
Copy link

backportbot bot commented Aug 7, 2024

The backport to stable-3.12 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable-3.12
git pull origin stable-3.12

# Create the new backport branch
git checkout -b backport/6958/stable-3.12

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick f2cfd2cc

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/6958/stable-3.12

Error: Failed to clone repository: Failed to checkout branches: error: Your local changes to the following files would be overwritten by checkout:
src/gui/macOS/ClientCommunicationProtocol.h
Please commit your changes or stash them before you switch branches.
Aborting


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants