-
Notifications
You must be signed in to change notification settings - Fork 32
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
Conversation
/gcbrun |
…ories to inlclude. Content is always included. fixes google#62
6a8bb86
to
8baba0b
Compare
/gcbrun |
/gcbrun |
There was a problem hiding this 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{} |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?
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