fix: chmod new layer to 0o644 when creating it

Signed-off-by: zwwhdls <zww@hdls.me>
This commit is contained in:
zwwhdls 2024-08-16 11:43:19 +08:00
parent d29cd4c2ed
commit bdc4308afb

View file

@ -51,6 +51,9 @@ func NewLayer(r io.Reader, mediatype string) (Layer, error) {
if err := os.Rename(temp.Name(), blob); err != nil { if err := os.Rename(temp.Name(), blob); err != nil {
return Layer{}, err return Layer{}, err
} }
if err := os.Chmod(blob, 0o644); err != nil {
return Layer{}, err
}
} }
return Layer{ return Layer{