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 {
9292 let sepolicy = if self . sysroot . booted_deployment ( ) . is_none ( ) {
9393 // fallback to policy from container root
9494 // this should only happen during cleanup of a broken install
95+ tracing:: trace!( "falling back to container root's selinux policy" ) ;
9596 let container_root = Dir :: open_ambient_dir ( "/" , cap_std:: ambient_authority ( ) ) ?;
9697 & ostree:: SePolicy :: new_at ( container_root. as_raw_fd ( ) , gio:: Cancellable :: NONE ) ?
9798 } else {
9899 // load the sepolicy from the booted ostree deployment so the imgstorage can be
99100 // properly labeled with /var/lib/container/storage labels
101+ tracing:: trace!( "loading sepolicy from booted ostree deployment" ) ;
100102 let dep = self . sysroot . booted_deployment ( ) . unwrap ( ) ;
101103 let dep_fs = deployment_fd ( & self . sysroot , & dep) ?;
102104 & ostree:: SePolicy :: new_at ( dep_fs. as_raw_fd ( ) , gio:: Cancellable :: NONE ) ?
103105 } ;
104106
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) ?;
106116 Ok ( self . imgstore . get_or_init ( || imgstore) )
107117 }
108118
You can’t perform that action at this time.
0 commit comments