@@ -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 }
@@ -1143,7 +1143,7 @@ impl Options {
11431143 }
11441144 }
11451145
1146- #[ cfg( not( feature = " selinux" ) ) ]
1146+ #[ cfg( not( selinux) ) ]
11471147 if let Preserve :: Yes { required } = attributes. context {
11481148 let selinux_disabled_error = CpError :: Error ( translate ! ( "cp-error-selinux-not-enabled" ) ) ;
11491149 if required {
@@ -1694,7 +1694,7 @@ fn handle_preserve<F: Fn() -> CopyResult<()>>(p: Preserve, f: F) -> CopyResult<(
16941694 Ok ( ( ) )
16951695}
16961696
1697- #[ cfg( all ( feature = " selinux" , target_os = "linux" ) ) ]
1697+ #[ cfg( selinux) ]
16981698pub ( crate ) fn set_selinux_context ( path : & Path , context : Option < & String > ) -> CopyResult < ( ) > {
16991699 if !uucore:: selinux:: is_selinux_enabled ( ) {
17001700 return Ok ( ( ) ) ;
@@ -1848,7 +1848,7 @@ pub(crate) fn copy_attributes(
18481848 Ok ( ( ) )
18491849 } ) ?;
18501850
1851- #[ cfg( all ( feature = " selinux" , any ( target_os = "linux" , target_os = "android" ) ) ) ]
1851+ #[ cfg( selinux) ]
18521852 handle_preserve ( attributes. context , || -> CopyResult < ( ) > {
18531853 // Get the source context and apply it to the destination
18541854 if let Ok ( context) = selinux:: SecurityContext :: of_path ( source, false , false ) {
@@ -2639,7 +2639,7 @@ fn copy_file(
26392639 fs:: File :: create ( dest) . map ( |f| f. set_len ( 0 ) ) . ok ( ) ;
26402640 } ) ?;
26412641
2642- #[ cfg( all ( feature = " selinux" , target_os = "linux" ) ) ]
2642+ #[ cfg( selinux) ]
26432643 if options. set_selinux_context {
26442644 set_selinux_context ( dest, options. context . as_ref ( ) ) ?;
26452645 }
0 commit comments