@@ -896,11 +896,11 @@ impl Attributes {
896896 mode : Preserve :: Yes { required : true } ,
897897 timestamps : Preserve :: Yes { required : true } ,
898898 context : {
899- #[ cfg( feature = "feat_selinux" ) ]
899+ #[ cfg( selinux ) ]
900900 {
901901 Preserve :: Yes { required : false }
902902 }
903- #[ cfg( not( feature = "feat_selinux" ) ) ]
903+ #[ cfg( not( selinux ) ) ]
904904 {
905905 Preserve :: No { explicit : false }
906906 }
@@ -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 ) {
@@ -2658,7 +2658,7 @@ fn copy_file(
26582658 fs:: File :: create ( dest) . map ( |f| f. set_len ( 0 ) ) . ok ( ) ;
26592659 } ) ?;
26602660
2661- #[ cfg( all ( feature = " selinux" , target_os = "linux" ) ) ]
2661+ #[ cfg( selinux) ]
26622662 if options. set_selinux_context {
26632663 set_selinux_context ( dest, options. context . as_ref ( ) ) ?;
26642664 }
0 commit comments