Skip to content

Commit

Permalink
Add RPC for checking if TCC approval is needed
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Oct 29, 2024
1 parent f0d3b9c commit 0b277b7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mullvad-daemon/src/management_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,18 @@ impl ManagementService for ManagementServiceImpl {
}))
}

#[cfg(target_os = "macos")]
async fn need_full_disk_permissions(&self, _: Request<()>) -> ServiceResult<bool> {
log::debug!("need_full_disk_permissions");
let has_access = talpid_core::split_tunnel::has_full_disk_access().await;
Ok(Response::new(!has_access))
}

#[cfg(not(target_os = "macos"))]
async fn need_full_disk_permissions(&self, _: Request<()>) -> ServiceResult<bool> {
Ok(Response::new(false))
}

#[cfg(windows)]
async fn check_volumes(&self, _: Request<()>) -> ServiceResult<()> {
log::debug!("check_volumes");
Expand Down
3 changes: 3 additions & 0 deletions mullvad-management-interface/proto/management_interface.proto
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ service ManagementService {
rpc InitPlayPurchase(google.protobuf.Empty) returns (PlayPurchasePaymentToken) {}
rpc VerifyPlayPurchase(PlayPurchase) returns (google.protobuf.Empty) {}

// Check whether the app needs TCC approval for split tunneling (macOS)
rpc NeedFullDiskPermissions(google.protobuf.Empty) returns (google.protobuf.BoolValue) {}

// Notify the split tunnel monitor that a volume was mounted or dismounted
// (Windows).
rpc CheckVolumes(google.protobuf.Empty) returns (google.protobuf.Empty) {}
Expand Down

0 comments on commit 0b277b7

Please sign in to comment.