Support HIP report (#309)

This commit is contained in:
Kevin Yue
2024-02-05 05:35:45 -05:00
committed by GitHub
parent 662e4d0b8a
commit db9249bd61
12 changed files with 334 additions and 2 deletions

View File

@@ -23,6 +23,11 @@ pub fn get_non_root_user() -> anyhow::Result<User> {
Ok(user)
}
pub fn get_current_user() -> anyhow::Result<User> {
let current_user = whoami::username();
get_user_by_name(&current_user)
}
fn get_real_user() -> anyhow::Result<User> {
// Read the UID from SUDO_UID or PKEXEC_UID environment variable if available.
let uid = match env::var("SUDO_UID") {