Skip to content

Commit

Permalink
fix: ensure rpm files have owner (#117)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Jan 15, 2020
1 parent 30eb8de commit 60adb12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions acceptance/testdata/rpm.min.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ ARG package
COPY ${package} /tmp/foo.rpm
RUN rpm -ivh /tmp/foo.rpm
RUN rpm -e foo
RUN rpm -qvl /tmp/foo.rpm | grep -E "root\s+root"
4 changes: 4 additions & 0 deletions rpm/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ func addEmptyDirsRPM(info *nfpm.Info, rpm *rpmpack.RPM) {
Name: dir,
Mode: uint(040755),
MTime: uint32(time.Now().Unix()),
Owner: "root",
Group: "root",
},
)
}
Expand Down Expand Up @@ -265,6 +267,8 @@ func copyToRPM(rpm *rpmpack.RPM, src, dst string, config bool) error {
Body: data,
Mode: uint(info.Mode()),
MTime: uint32(info.ModTime().Unix()),
Owner: "root",
Group: "root",
}

if config {
Expand Down

0 comments on commit 60adb12

Please sign in to comment.