Multiple changes:
- deb: can use ppa as dependency - deb: cross and regular are using parallel nocheck builds - deb: ephemeral will not pull keyring if no root powers
This commit is contained in:
@@ -1 +1,2 @@
|
||||
pub mod gpg;
|
||||
pub mod root;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//! Root privilege checking utilities
|
||||
|
||||
use std::error::Error;
|
||||
|
||||
/// Check if the current process has root privileges
|
||||
///
|
||||
/// # Returns
|
||||
/// * `Ok(true)` - Running as root
|
||||
/// * `Ok(false)` - Not running as root
|
||||
/// * `Err` - Failed to check privileges
|
||||
pub fn is_root() -> Result<bool, Box<dyn Error>> {
|
||||
// Check if we're running as root by checking the effective user ID
|
||||
let uid = unsafe { libc::geteuid() };
|
||||
Ok(uid == 0)
|
||||
}
|
||||
Reference in New Issue
Block a user