mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-22 23:46:13 -05:00
feat(hip): manage reports and script execution
This commit is contained in:
54 files changed
+3122
-967
No files matched your search
@@ -1,7 +1,9 @@
|
||||
pub(crate) fn trusted_csd_uid() -> anyhow::Result<Option<u32>> {
|
||||
let uid = gpapi::process::users::get_non_root_user()?.uid();
|
||||
if uid == 0 {
|
||||
anyhow::bail!("The HIP script user must not be root");
|
||||
pub(crate) fn desktop_uid() -> Option<u32> {
|
||||
match gpapi::process::users::get_non_root_user() {
|
||||
Ok(user) => Some(user.uid()),
|
||||
Err(err) => {
|
||||
log::warn!("No verified desktop user is available for custom HIP scripts: {err}");
|
||||
None
|
||||
}
|
||||
}
|
||||
Ok(Some(uid))
|
||||
}
|
||||
Reference in new issue
Block a user