-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Sandbox: Fix regression that caused Sandbox::canAccess
to fail
#12457
Conversation
This fixes a regression introduced in 5111af7 and the corresponding issues (mixxxdj#11552 and mixxxdj#12137). To prevent this from happening again, 8c6154e marks `openSecurityToken` as `[[nodiscard]]`.
Doesn't the compiler optimize this unused variable away? |
I think not. We also use RAII and there the unused variable is not optimized away either. But in any case we should probably mark the token with |
I think we have no issue with the variable being unused. It is a QSharedPointer which has a scope until the end of the function. |
Co-authored-by: Daniel Schürmann <[email protected]>
a74a637
to
a9f55c9
Compare
Sandbox::canAccess
to always failSandbox::canAccess
to fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. 2.4 is coming into sight!
Fixes #12137 (and #11552)
This fixes a regression with macOS sandboxing introduced in #3761 that caused
Sandbox::canAccess
to always fail and to wrongly present this dialog on every launch:The issue was that the token is not assigned to a variable and thus immediately deinitialized (and invalidated):
See #3761 (comment) for details. To avoid regressing on this in the future, I have added a
[[nodiscard]]
to theopenSecurityToken
methods, which will generate a warning if used like this again.