Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure rpm files have owner #117

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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