File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,7 @@ mod tests {
236236 path:: { Path , PathBuf } ,
237237 } ;
238238
239+ use capctl:: { CapSet , CapState } ;
239240 use log:: debug;
240241 use nix:: sys:: stat:: { fchmodat, Mode } ;
241242 use rar_common:: {
@@ -394,7 +395,14 @@ mod tests {
394395 #[ test]
395396 fn test_read_only_immutable ( ) {
396397 register ( ) ;
397- let filename = "test_ro.sh" ;
398+ // remove root privileges
399+ let current = CapState :: get_current ( ) ;
400+ let mut current = current. unwrap ( ) ;
401+ current. effective = CapSet :: empty ( ) ;
402+ current. permitted = CapSet :: empty ( ) ;
403+ current. inheritable = CapSet :: empty ( ) ;
404+ current. set_current ( ) . unwrap ( ) ;
405+ let filename = "/tmp/test_ro.sh" ;
398406 let _cleanup = defer ( || {
399407 let filename = PathBuf :: from ( filename)
400408 . canonicalize ( )
You can’t perform that action at this time.
0 commit comments