File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -92,17 +92,27 @@ impl Storage {
92
92
let sepolicy = if self . sysroot . booted_deployment ( ) . is_none ( ) {
93
93
// fallback to policy from container root
94
94
// this should only happen during cleanup of a broken install
95
+ tracing:: trace!( "falling back to container root's selinux policy" ) ;
95
96
let container_root = Dir :: open_ambient_dir ( "/" , cap_std:: ambient_authority ( ) ) ?;
96
97
& ostree:: SePolicy :: new_at ( container_root. as_raw_fd ( ) , gio:: Cancellable :: NONE ) ?
97
98
} else {
98
99
// load the sepolicy from the booted ostree deployment so the imgstorage can be
99
100
// properly labeled with /var/lib/container/storage labels
101
+ tracing:: trace!( "loading sepolicy from booted ostree deployment" ) ;
100
102
let dep = self . sysroot . booted_deployment ( ) . unwrap ( ) ;
101
103
let dep_fs = deployment_fd ( & self . sysroot , & dep) ?;
102
104
& ostree:: SePolicy :: new_at ( dep_fs. as_raw_fd ( ) , gio:: Cancellable :: NONE ) ?
103
105
} ;
104
106
105
- let imgstore = crate :: imgstorage:: Storage :: create ( & sysroot_dir, & self . run , Some ( sepolicy) ) ?;
107
+ let sepolicy = if sepolicy. csum ( ) . is_none ( ) {
108
+ None
109
+ } else {
110
+ Some ( sepolicy)
111
+ } ;
112
+
113
+ tracing:: trace!( "sepolicy in get_ensure_imgstore: {sepolicy:?}" ) ;
114
+
115
+ let imgstore = crate :: imgstorage:: Storage :: create ( & sysroot_dir, & self . run , sepolicy) ?;
106
116
Ok ( self . imgstore . get_or_init ( || imgstore) )
107
117
}
108
118
You can’t perform that action at this time.
0 commit comments