Skip to content

Commit

Permalink
Don't expose account names when creating tar files with hard-coded ac…
Browse files Browse the repository at this point in the history
…count IDs

A prerequisite for fixing containers/image#1627 .

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
  • Loading branch information
mtrmac committed Nov 28, 2023
1 parent d731b42 commit 819ac44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/archive/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@ func (ta *tarAppender) addTarFile(path, name string) error {
if ta.ChownOpts != nil {
hdr.Uid = ta.ChownOpts.UID
hdr.Gid = ta.ChownOpts.GID
// Don’t expose the user names from the local system; they probably don’t match the ta.ChownOpts value anyway,
// and they unnecessarily give recipients of the tar file potentially private data.
hdr.Uname = ""
hdr.Gname = ""
}

maybeTruncateHeaderModTime(hdr)
Expand Down

0 comments on commit 819ac44

Please sign in to comment.