add doc string for elevate_privlages
This commit is contained in:
parent
9bb5154ae8
commit
f528a215f5
1 changed files with 7 additions and 1 deletions
|
@ -40,6 +40,12 @@ pub fn read_file(dir: &str, file: &str) -> Option<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Ekevate tge oruvukages if the current process
|
||||||
|
/// #### Arguments
|
||||||
|
/// * `uid` - The uid to set the process to
|
||||||
|
/// * `gid` - The gid to set the process to
|
||||||
|
/// #### Returns
|
||||||
|
/// If the process failes to elevate, it returns false
|
||||||
pub fn elevate_privilages(uid: u32, gid: u32) -> bool {
|
pub fn elevate_privilages(uid: u32, gid: u32) -> bool {
|
||||||
if unistd::setuid(Uid::from(uid)).is_err() {
|
if unistd::setuid(Uid::from(uid)).is_err() {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue