@@ -898,11 +898,11 @@ impl Attributes {
898898 mode : Preserve :: Yes { required : true } ,
899899 timestamps : Preserve :: Yes { required : true } ,
900900 context : {
901- #[ cfg( feature = "feat_selinux" ) ]
901+ #[ cfg( selinux ) ]
902902 {
903903 Preserve :: Yes { required : false }
904904 }
905- #[ cfg( not( feature = "feat_selinux" ) ) ]
905+ #[ cfg( not( selinux ) ) ]
906906 {
907907 Preserve :: No { explicit : false }
908908 }
@@ -1141,7 +1141,7 @@ impl Options {
11411141 }
11421142 }
11431143
1144- #[ cfg( not( feature = " selinux" ) ) ]
1144+ #[ cfg( not( selinux) ) ]
11451145 if let Preserve :: Yes { required } = attributes. context {
11461146 let selinux_disabled_error = CpError :: Error ( translate ! ( "cp-error-selinux-not-enabled" ) ) ;
11471147 if required {
@@ -1692,7 +1692,7 @@ fn handle_preserve<F: Fn() -> CopyResult<()>>(p: Preserve, f: F) -> CopyResult<(
16921692 Ok ( ( ) )
16931693}
16941694
1695- #[ cfg( all ( feature = " selinux" , target_os = "linux" ) ) ]
1695+ #[ cfg( selinux) ]
16961696pub ( crate ) fn set_selinux_context ( path : & Path , context : Option < & String > ) -> CopyResult < ( ) > {
16971697 if !uucore:: selinux:: is_selinux_enabled ( ) {
16981698 return Ok ( ( ) ) ;
@@ -1846,7 +1846,7 @@ pub(crate) fn copy_attributes(
18461846 Ok ( ( ) )
18471847 } ) ?;
18481848
1849- #[ cfg( all ( feature = " selinux" , any ( target_os = "linux" , target_os = "android" ) ) ) ]
1849+ #[ cfg( selinux) ]
18501850 handle_preserve ( attributes. context , || -> CopyResult < ( ) > {
18511851 // Get the source context and apply it to the destination
18521852 if let Ok ( context) = selinux:: SecurityContext :: of_path ( source, false , false ) {
@@ -2634,7 +2634,7 @@ fn copy_file(
26342634 fs:: File :: create ( dest) . map ( |f| f. set_len ( 0 ) ) . ok ( ) ;
26352635 } ) ?;
26362636
2637- #[ cfg( all ( feature = " selinux" , target_os = "linux" ) ) ]
2637+ #[ cfg( selinux) ]
26382638 if options. set_selinux_context {
26392639 set_selinux_context ( dest, options. context . as_ref ( ) ) ?;
26402640 }
0 commit comments