Skip to content

Commit

Permalink
Merge pull request #1931 from akihikodaki/main
Browse files Browse the repository at this point in the history
archive: always fix mode for root dir with ForceMask
  • Loading branch information
openshift-merge-bot[bot] authored Jun 3, 2024
2 parents 5fe400b + 96545b8 commit 5310107
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/archive/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,11 @@ loop:
}
}

if options.ForceMask != nil && rootHdr != nil {
value := fmt.Sprintf("%d:%d:0%o", rootHdr.Uid, rootHdr.Gid, rootHdr.Mode)
if options.ForceMask != nil {
value := "0:0:0755"
if rootHdr != nil {
value = fmt.Sprintf("%d:%d:0%o", rootHdr.Uid, rootHdr.Gid, rootHdr.Mode)
}
if err := system.Lsetxattr(dest, idtools.ContainersOverrideXattr, []byte(value), 0); err != nil {
return err
}
Expand Down

0 comments on commit 5310107

Please sign in to comment.