File tree Expand file tree Collapse file tree 2 files changed +2
-31
lines changed Expand file tree Collapse file tree 2 files changed +2
-31
lines changed Original file line number Diff line number Diff line change
1
+ use crate :: config:: Value ;
1
2
use clap:: { arg, Command } ;
2
3
use evdev:: { AttributeSet , Device , InputEventKind , Key } ;
3
4
use nix:: {
4
5
sys:: stat:: { umask, Mode } ,
5
6
unistd:: { Group , Uid } ,
6
7
} ;
8
+ use signal_hook:: consts:: signal:: * ;
7
9
use signal_hook_tokio:: Signals ;
8
10
use std:: {
9
11
collections:: { HashMap , HashSet } ,
@@ -22,10 +24,7 @@ use tokio::time::Duration;
22
24
use tokio:: time:: { sleep, Instant } ;
23
25
use tokio_stream:: { StreamExt , StreamMap } ;
24
26
25
- use signal_hook:: consts:: signal:: * ;
26
-
27
27
mod config;
28
- use crate :: config:: Value ;
29
28
mod perms;
30
29
mod uinput;
31
30
Original file line number Diff line number Diff line change @@ -72,31 +72,3 @@ fn set_euid(uid: u32) {
72
72
}
73
73
}
74
74
}
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
- }
You can’t perform that action at this time.
0 commit comments