@@ -3262,7 +3262,8 @@ def make_disk(
3262
3262
3263
3263
def make_oci (context : Context , root_layer : Path , dst : Path ) -> None :
3264
3264
ca_store = dst / "blobs" / "sha256"
3265
- ca_store .mkdir (parents = True )
3265
+ with umask (~ 0o755 ):
3266
+ ca_store .mkdir (parents = True )
3266
3267
3267
3268
layer_diff_digest = hash_file (root_layer )
3268
3269
maybe_compress (
@@ -3307,7 +3308,8 @@ def make_oci(context: Context, root_layer: Path, dst: Path) -> None:
3307
3308
}
3308
3309
oci_config_blob = json .dumps (oci_config )
3309
3310
oci_config_digest = hashlib .sha256 (oci_config_blob .encode ()).hexdigest ()
3310
- (ca_store / oci_config_digest ).write_text (oci_config_blob )
3311
+ with umask (~ 0o644 ):
3312
+ (ca_store / oci_config_digest ).write_text (oci_config_blob )
3311
3313
3312
3314
layer_suffix = context .config .compress_output .oci_media_type_suffix ()
3313
3315
oci_manifest = {
@@ -3334,26 +3336,26 @@ def make_oci(context: Context, root_layer: Path, dst: Path) -> None:
3334
3336
}
3335
3337
oci_manifest_blob = json .dumps (oci_manifest )
3336
3338
oci_manifest_digest = hashlib .sha256 (oci_manifest_blob .encode ()).hexdigest ()
3337
- (ca_store / oci_manifest_digest ).write_text (oci_manifest_blob )
3339
+ with umask (~ 0o644 ):
3340
+ (ca_store / oci_manifest_digest ).write_text (oci_manifest_blob )
3338
3341
3339
- with (dst / "index.json" ).open ( "w" ) as f :
3340
- json .dump (
3341
- {
3342
- "schemaVersion" : 2 ,
3343
- "mediaType" : "application/vnd.oci.image.index.v1+json" ,
3344
- "manifests" : [
3345
- {
3346
- "mediaType" : "application/vnd.oci.image.manifest.v1+json" ,
3347
- "digest" : f"sha256:{ oci_manifest_digest } " ,
3348
- "size" : (ca_store / oci_manifest_digest ).stat ().st_size ,
3349
- }
3350
- ],
3351
- },
3352
- f ,
3342
+ (dst / "index.json" ).write_text (
3343
+ json .dumps (
3344
+ {
3345
+ "schemaVersion" : 2 ,
3346
+ "mediaType" : "application/vnd.oci.image.index.v1+json" ,
3347
+ "manifests" : [
3348
+ {
3349
+ "mediaType" : "application/vnd.oci.image.manifest.v1+json" ,
3350
+ "digest" : f"sha256:{ oci_manifest_digest } " ,
3351
+ "size" : (ca_store / oci_manifest_digest ).stat ().st_size ,
3352
+ }
3353
+ ],
3354
+ }
3355
+ )
3353
3356
)
3354
3357
3355
- with (dst / "oci-layout" ).open ("w" ) as f :
3356
- json .dump ({"imageLayoutVersion" : "1.0.0" }, f )
3358
+ (dst / "oci-layout" ).write_text (json .dumps ({"imageLayoutVersion" : "1.0.0" }))
3357
3359
3358
3360
3359
3361
def make_esp (context : Context , uki : Path ) -> list [Partition ]:
0 commit comments