Skip to content

Commit 29a0a02

Browse files
committed
[Update]setresuid setresgid functions not required
These functions are not being used :)
1 parent 1b4a79a commit 29a0a02

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

src/daemon.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
use crate::config::Value;
12
use clap::{arg, Command};
23
use evdev::{AttributeSet, Device, InputEventKind, Key};
34
use nix::{
45
sys::stat::{umask, Mode},
56
unistd::{Group, Uid},
67
};
8+
use signal_hook::consts::signal::*;
79
use signal_hook_tokio::Signals;
810
use std::{
911
collections::{HashMap, HashSet},
@@ -22,10 +24,7 @@ use tokio::time::Duration;
2224
use tokio::time::{sleep, Instant};
2325
use tokio_stream::{StreamExt, StreamMap};
2426

25-
use signal_hook::consts::signal::*;
26-
2727
mod config;
28-
use crate::config::Value;
2928
mod perms;
3029
mod uinput;
3130

src/perms.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -72,31 +72,3 @@ fn set_euid(uid: u32) {
7272
}
7373
}
7474
}
75-
76-
fn set_resuid(ruid: u32, euid: u32, suid: u32) {
77-
let ruid = Uid::from_raw(ruid);
78-
let euid = Uid::from_raw(euid);
79-
let suid = Uid::from_raw(suid);
80-
81-
match nix::unistd::setresuid(ruid, euid, suid) {
82-
Ok(_) => log::debug!("Setting RESUID..."),
83-
Err(e) => {
84-
log::error!("Failed to set RESUID: {:#?}", e);
85-
exit(1);
86-
}
87-
}
88-
}
89-
90-
fn set_resgid(rgid: u32, egid: u32, sgid: u32) {
91-
let rgid = Uid::from_raw(rgid);
92-
let egid = Uid::from_raw(egid);
93-
let sgid = Uid::from_raw(sgid);
94-
95-
match nix::unistd::setresuid(rgid, egid, sgid) {
96-
Ok(_) => log::debug!("Setting RESUID..."),
97-
Err(e) => {
98-
log::error!("Failed to set RESGID: {:#?}", e);
99-
exit(1);
100-
}
101-
}
102-
}

0 commit comments

Comments
 (0)