@@ -18,10 +18,10 @@ use libc::{gid_t, uid_t};
1818use options:: traverse;
1919use std:: ffi:: OsString ;
2020
21- #[ cfg( not( all ( target_os = "linux" , feature = "safe-traversal" ) ) ) ]
21+ #[ cfg( not( target_os = "linux" ) ) ]
2222use walkdir:: WalkDir ;
2323
24- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
24+ #[ cfg( target_os = "linux" ) ]
2525use crate :: features:: safe_traversal:: DirFd ;
2626
2727use std:: ffi:: CString ;
@@ -308,7 +308,7 @@ impl ChownExecutor {
308308
309309 let ret = if self . matched ( meta. uid ( ) , meta. gid ( ) ) {
310310 // Use safe syscalls for root directory to prevent TOCTOU attacks
311- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
311+ #[ cfg( target_os = "linux" ) ]
312312 let chown_result = if path. is_dir ( ) {
313313 // For directories, use safe traversal from the start
314314 match DirFd :: open ( path) {
@@ -331,7 +331,7 @@ impl ChownExecutor {
331331 )
332332 } ;
333333
334- #[ cfg( not( all ( target_os = "linux" , feature = "safe-traversal" ) ) ) ]
334+ #[ cfg( not( target_os = "linux" ) ) ]
335335 let chown_result = wrap_chown (
336336 path,
337337 & meta,
@@ -365,11 +365,11 @@ impl ChownExecutor {
365365 } ;
366366
367367 if self . recursive {
368- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
368+ #[ cfg( target_os = "linux" ) ]
369369 {
370370 ret | self . safe_dive_into ( & root)
371371 }
372- #[ cfg( not( all ( target_os = "linux" , feature = "safe-traversal" ) ) ) ]
372+ #[ cfg( not( target_os = "linux" ) ) ]
373373 {
374374 ret | self . dive_into ( & root)
375375 }
@@ -378,7 +378,7 @@ impl ChownExecutor {
378378 }
379379 }
380380
381- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
381+ #[ cfg( target_os = "linux" ) ]
382382 fn safe_chown_dir (
383383 & self ,
384384 dir_fd : & DirFd ,
@@ -432,7 +432,7 @@ impl ChownExecutor {
432432 Ok ( String :: new ( ) )
433433 }
434434
435- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
435+ #[ cfg( target_os = "linux" ) ]
436436 fn safe_dive_into < P : AsRef < Path > > ( & self , root : P ) -> i32 {
437437 let root = root. as_ref ( ) ;
438438
@@ -458,7 +458,7 @@ impl ChownExecutor {
458458 ret
459459 }
460460
461- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
461+ #[ cfg( target_os = "linux" ) ]
462462 fn safe_traverse_dir ( & self , dir_fd : & DirFd , dir_path : & Path , ret : & mut i32 ) {
463463 // Read directory entries
464464 let entries = match dir_fd. read_dir ( ) {
@@ -563,7 +563,7 @@ impl ChownExecutor {
563563 }
564564 }
565565
566- #[ cfg( not( all ( target_os = "linux" , feature = "safe-traversal" ) ) ) ]
566+ #[ cfg( not( target_os = "linux" ) ) ]
567567 #[ allow( clippy:: cognitive_complexity) ]
568568 fn dive_into < P : AsRef < Path > > ( & self , root : P ) -> i32 {
569569 let root = root. as_ref ( ) ;
@@ -700,7 +700,7 @@ impl ChownExecutor {
700700 }
701701
702702 /// Try to open directory with error reporting
703- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
703+ #[ cfg( target_os = "linux" ) ]
704704 fn try_open_dir ( & self , path : & Path ) -> Option < DirFd > {
705705 DirFd :: open ( path)
706706 . map_err ( |e| {
@@ -713,7 +713,7 @@ impl ChownExecutor {
713713
714714 /// Report ownership change with proper verbose output
715715 /// Returns 0 on success
716- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
716+ #[ cfg( target_os = "linux" ) ]
717717 fn report_ownership_change_success (
718718 & self ,
719719 path : & Path ,
0 commit comments