Skip to content

Commit

Permalink
[Update]setresuid setresgid functions not required
Browse files Browse the repository at this point in the history
These functions are not being used :)
  • Loading branch information
Shinyzenith committed May 11, 2022
1 parent 1b4a79a commit 29a0a02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
5 changes: 2 additions & 3 deletions src/daemon.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use crate::config::Value;
use clap::{arg, Command};
use evdev::{AttributeSet, Device, InputEventKind, Key};
use nix::{
sys::stat::{umask, Mode},
unistd::{Group, Uid},
};
use signal_hook::consts::signal::*;
use signal_hook_tokio::Signals;
use std::{
collections::{HashMap, HashSet},
Expand All @@ -22,10 +24,7 @@ use tokio::time::Duration;
use tokio::time::{sleep, Instant};
use tokio_stream::{StreamExt, StreamMap};

use signal_hook::consts::signal::*;

mod config;
use crate::config::Value;
mod perms;
mod uinput;

Expand Down
28 changes: 0 additions & 28 deletions src/perms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,3 @@ fn set_euid(uid: u32) {
}
}
}

fn set_resuid(ruid: u32, euid: u32, suid: u32) {
let ruid = Uid::from_raw(ruid);
let euid = Uid::from_raw(euid);
let suid = Uid::from_raw(suid);

match nix::unistd::setresuid(ruid, euid, suid) {
Ok(_) => log::debug!("Setting RESUID..."),
Err(e) => {
log::error!("Failed to set RESUID: {:#?}", e);
exit(1);
}
}
}

fn set_resgid(rgid: u32, egid: u32, sgid: u32) {
let rgid = Uid::from_raw(rgid);
let egid = Uid::from_raw(egid);
let sgid = Uid::from_raw(sgid);

match nix::unistd::setresuid(rgid, egid, sgid) {
Ok(_) => log::debug!("Setting RESUID..."),
Err(e) => {
log::error!("Failed to set RESGID: {:#?}", e);
exit(1);
}
}
}

0 comments on commit 29a0a02

Please sign in to comment.