-
Notifications
You must be signed in to change notification settings - Fork 251
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
chunked: handle creating root directory #2194
chunked: handle creating root directory #2194
Conversation
5c1461d
to
09f5dfc
Compare
09f5dfc
to
541b348
Compare
541b348
to
5882567
Compare
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.
Thanks! This is nice.
ddaf701
to
b3357df
Compare
af09f80
to
3383a19
Compare
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 didn't do any deep review but looks sane to me.
pkg/chunked/dump/dump.go
Outdated
func dumpNode(out io.Writer, added map[string]*internal.FileMetadata, links map[string]int, verityDigests map[string]string, entry *internal.FileMetadata) error { | ||
path := sanitizeName(entry.Name) | ||
path := internal.CleanAbsPath(entry.Name) |
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.
Right, composefs wants these to be absolute paths, so this makes sense.
(That said, it's kind of tempting to lift that and support relative paths too just on the principle that relative paths are IMO more "canonical" to use in use cases like tar)
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Giuseppe Scrivano <[email protected]>
the returned file object is used later, so fail immediately if it could not be opened. Signed-off-by: Giuseppe Scrivano <[email protected]>
3383a19
to
db90d12
Compare
Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
ihen the file name is the root directory, avoid using an empty string or the ".." name to open the file. The latter does not cause any security issues or unexpected behavior, it is logically incorrect and should be avoided. Closes: containers#2191 Signed-off-by: Giuseppe Scrivano <[email protected]>
replacing the usage of a private function. Signed-off-by: Giuseppe Scrivano <[email protected]>
db90d12
to
8fa5ca4
Compare
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
Thanks!
if the file name is the root directory, do not attempt to use the base component since it is the empty string.
Closes: #2191