@@ -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 ,
@@ -399,7 +399,7 @@ impl ChownExecutor {
399399 Ok ( String :: new ( ) )
400400 }
401401
402- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
402+ #[ cfg( target_os = "linux" ) ]
403403 fn safe_dive_into < P : AsRef < Path > > ( & self , root : P ) -> i32 {
404404 let root = root. as_ref ( ) ;
405405
@@ -425,7 +425,7 @@ impl ChownExecutor {
425425 ret
426426 }
427427
428- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
428+ #[ cfg( target_os = "linux" ) ]
429429 fn safe_traverse_dir ( & self , dir_fd : & DirFd , dir_path : & Path , ret : & mut i32 ) {
430430 // Read directory entries
431431 let entries = match dir_fd. read_dir ( ) {
@@ -530,7 +530,7 @@ impl ChownExecutor {
530530 }
531531 }
532532
533- #[ cfg( not( all ( target_os = "linux" , feature = "safe-traversal" ) ) ) ]
533+ #[ cfg( not( target_os = "linux" ) ) ]
534534 #[ allow( clippy:: cognitive_complexity) ]
535535 fn dive_into < P : AsRef < Path > > ( & self , root : P ) -> i32 {
536536 let root = root. as_ref ( ) ;
@@ -667,7 +667,7 @@ impl ChownExecutor {
667667 }
668668
669669 /// Try to open directory with error reporting
670- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
670+ #[ cfg( target_os = "linux" ) ]
671671 fn try_open_dir ( & self , path : & Path ) -> Option < DirFd > {
672672 DirFd :: open ( path)
673673 . map_err ( |e| {
@@ -680,7 +680,7 @@ impl ChownExecutor {
680680
681681 /// Report ownership change with proper verbose output
682682 /// Returns 0 on success
683- #[ cfg( all ( target_os = "linux" , feature = "safe-traversal" ) ) ]
683+ #[ cfg( target_os = "linux" ) ]
684684 fn report_ownership_change_success (
685685 & self ,
686686 path : & Path ,
0 commit comments