mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 06:26:14 -05:00
feat(openconnect): log HIP reporting mode on connection
This commit is contained in:
1 file changed
+16
@@ -139,6 +139,22 @@ impl Vpn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn connect(&self, on_connected: impl FnOnce(VpnSessionInfo) + 'static + Send + Sync) -> i32 {
|
pub fn connect(&self, on_connected: impl FnOnce(VpnSessionInfo) + 'static + Send + Sync) -> i32 {
|
||||||
|
match &self.hip_source {
|
||||||
|
HipSource::Disabled => info!("HIP reporting: disabled"),
|
||||||
|
HipSource::Generator(_) => info!("HIP reporting: enabled, source=callback"),
|
||||||
|
HipSource::Script(script) => {
|
||||||
|
#[cfg(unix)]
|
||||||
|
{
|
||||||
|
let uid = script.user.unwrap_or_else(|| unsafe { libc::geteuid() });
|
||||||
|
info!("HIP reporting: enabled, source=script, uid={uid}");
|
||||||
|
}
|
||||||
|
#[cfg(not(unix))]
|
||||||
|
match script.user {
|
||||||
|
Some(uid) => info!("HIP reporting: enabled, source=script, uid={uid}"),
|
||||||
|
None => info!("HIP reporting: enabled, source=script, user=process-user"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
self.callback.write().unwrap().replace(Box::new(on_connected));
|
self.callback.write().unwrap().replace(Box::new(on_connected));
|
||||||
let mut options = self.build_connect_options();
|
let mut options = self.build_connect_options();
|
||||||
let environment = match &self.hip_source {
|
let environment = match &self.hip_source {
|
||||||
|
|||||||
Reference in new issue
Block a user