-
Notifications
You must be signed in to change notification settings - Fork 16
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
Remove VPN metadata admin check #2127
Remove VPN metadata admin check #2127
Conversation
Query creation is having serious problems when combined with `takeRetainedValue`. Using `takeUnretainedValue` fixes this issue, but leaks the query instances. We don’t desperately need to know this value, so we’ll go without it and let the system extension API tell us when it doesn’t have admin privileges.
extension VPNMetadataCollector { | ||
|
||
private func getUser() throws -> CSIdentity? { | ||
let query = CSIdentityQueryCreateForCurrentUser(kCFAllocatorDefault).takeRetainedValue() |
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.
This function is being a real pain. Changing it to takeUnretainedValue
solves the problem, but leaks the query instances. Since we get error information about lack of privileges elsewhere, I think this one is a little redundant anyway, so let's just remove it and keep things simple.
Task/Issue URL: https://app.asana.com/0/1199230911884351/1206456172266325/f Tech Design URL: CC: Description: This PR removes the admin user check from the metadata collector. The query functions used to do these checks have issues when used from Swift, crashing after a few invocations unless you use takeUnretainedValue, which we don't want to do as that then leaks the query. We could do this call once and cache the result, but instead I think we should just rely on system extension APIs etc telling us when they fail due to lack of privileges (error cases do exist for this situation, so we'll still know when it happens).
This reverts commit 2255ac9.
# By Brian Hall (2) and others # Via GitHub * main: Bump BSK to 103.0.2 (#2126) Fix `site:` queries escaping with iOS 17 SDK (#640) (#2130) Add January 2024 brokers (part 2) (#2125) lastSentDate + web breakage report improvements (#2041) Remove VPN metadata admin check (#2127) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
* main: Restore VPN pixels in main browser (#2129) Bump BSK to 103.0.2 (#2126) Fix `site:` queries escaping with iOS 17 SDK (#640) (#2130) Add January 2024 brokers (part 2) (#2125) lastSentDate + web breakage report improvements (#2041) Remove VPN metadata admin check (#2127) Add Spokeo mirror sites (#2086) appcastManager: Retain release notes for all versions (#2123) Don't report CancellationError from BookmarksFaviconsFetcher (#2120) Sabrina/revert cards experiment (#2119) Bump version to 1.72.0 (113) Update embedded files Release Branch: VPN fixes (#2113) Adds info about whether the login items are actually running (#2122) Remove connection status awaiter. (#2121)
Query creation is having serious problems when combined with
takeRetainedValue
. UsingtakeUnretainedValue
fixes this issue, but leaks the query instances.We don’t desperately need to know this value, so we’ll go without it and let the system extension API tell us when it doesn’t have admin privileges.
Task/Issue URL: https://app.asana.com/0/1199230911884351/1206456172266325/f
Tech Design URL:
CC:
Description:
This PR removes the admin user check from the metadata collector.
The query functions used to do these checks have issues when used from Swift, crashing after a few invocations unless you use
takeUnretainedValue
, which we don't want to do as that then leaks the query.We could do this call once and cache the result, but instead I think we should just rely on system extension APIs etc telling us when they fail due to lack of privileges (error cases do exist for this situation, so we'll still know when it happens).
Steps to test this PR:
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation