File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,15 @@ impl State {
313
313
tracing:: debug!( "Loaded SELinux policy: {csum}" ) ;
314
314
Ok ( Some ( r) )
315
315
}
316
+
317
+ #[ context( "Finalizing state" ) ]
318
+ pub ( crate ) fn consume ( self ) -> Result < ( ) > {
319
+ // If we had invoked `setenforce 0`, then let's re-enable it.
320
+ if let SELinuxFinalState :: Enabled ( Some ( guard) ) = self . selinux_state {
321
+ guard. consume ( ) ?;
322
+ }
323
+ Ok ( ( ) )
324
+ }
316
325
}
317
326
318
327
/// Path to initially deployed version information
@@ -1244,10 +1253,7 @@ pub(crate) async fn install_to_disk(mut opts: InstallToDiskOpts) -> Result<()> {
1244
1253
1245
1254
// At this point, all other threads should be gone.
1246
1255
if let Some ( state) = Arc :: into_inner ( state) {
1247
- // If we had invoked `setenforce 0`, then let's re-enable it.
1248
- if let SELinuxFinalState :: Enabled ( Some ( guard) ) = state. selinux_state {
1249
- guard. consume ( ) ?;
1250
- }
1256
+ state. consume ( ) ?;
1251
1257
} else {
1252
1258
// This shouldn't happen...but we will make it not fatal right now
1253
1259
tracing:: warn!( "Failed to consume state Arc" ) ;
You can’t perform that action at this time.
0 commit comments