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

Allowlist for directories #70

Merged
merged 3 commits into from
Nov 25, 2021
Merged

Allowlist for directories #70

merged 3 commits into from
Nov 25, 2021

Conversation

jarondl
Copy link
Collaborator

@jarondl jarondl commented Nov 20, 2021

Users reported issues with installing rpms that have directories from the core filesystem (such as /etc/, /var/, etc). This change adds the option in tar2rpm and in the bazel rules, to only include certain directories. This talks about the directory itself, the content is always included.

Fixes #62

@jarondl
Copy link
Collaborator Author

jarondl commented Nov 20, 2021

/gcbrun

@jarondl
Copy link
Collaborator Author

jarondl commented Nov 20, 2021

/gcbrun

@jarondl
Copy link
Collaborator Author

jarondl commented Nov 23, 2021

/gcbrun

@jarondl jarondl merged commit d0ed9b1 into google:master Nov 25, 2021
Copy link
Collaborator

@alexaguilera93 alexaguilera93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just a couple of small comments

os.Exit(1)
}
if *useDirAllowlist {
al := map[string]bool{}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think declaring as
var al map[string]bool

would be better, to avoid possibly unnecessary allocation.

// Sometimes the tar has no uname and gname. RPM expects these to always exist.
owner := h.Uname
if owner == "" {
owner = "root"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could defaulting to root be an issue here if a user is unpacking as root?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to install the built rpm (without force)
2 participants