mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-21 07:16:17 -05:00
feat: add device anchor persistence and serialize vpn lifecycle
- Implement Unix device anchor discovery, root-owned persistence under /var/lib/gp, and credential delivery in gpapi and gpservice. - Introduce LifecycleHandle to serialize VPN connect/disconnect lifecycles and ensure cancellation cannot be superseded by late connect events.
This commit is contained in:
13 files changed
+866
-217
No files matched your search
@@ -90,9 +90,19 @@ impl SessionRegistry {
|
||||
return Err(SessionError::TooManyPending);
|
||||
}
|
||||
|
||||
let credential = Arc::new(
|
||||
SessionCredential::generate(self.service_instance_id, product_version).map_err(|_| SessionError::Unavailable)?,
|
||||
);
|
||||
let credential =
|
||||
SessionCredential::generate(self.service_instance_id, product_version).map_err(|_| SessionError::Unavailable)?;
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
||||
let credential = {
|
||||
let anchor = crate::device_anchor::resolve().map_err(|error| {
|
||||
log::warn!("GUI device anchor unavailable: {error:#}");
|
||||
SessionError::Unavailable
|
||||
})?;
|
||||
credential
|
||||
.with_device_anchor(anchor)
|
||||
.map_err(|_| SessionError::Unavailable)?
|
||||
};
|
||||
let credential = Arc::new(credential);
|
||||
sessions.insert(
|
||||
credential.session_id(),
|
||||
SessionRecord {
|
||||
|
||||
Reference in new issue
Block a user