Skip to content

Commit

Permalink
packer: fix incorrect parent association in mkdirp()
Browse files Browse the repository at this point in the history
A bug was triggered when the file system contained two directories with the same
basename, because all directories were incorrectly associated with the root
directory.

fixes #58
  • Loading branch information
stapelberg committed Jun 29, 2023
1 parent 522f5b0 commit 56839a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/packer/packer.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ func (ae *archiveExtraction) mkdirp(dir string) {
parent := ae.dirs["."]
for idx, part := range parts {
path := strings.Join(parts[:1+idx], "/")
if _, ok := ae.dirs[path]; ok {
if dir, ok := ae.dirs[path]; ok {
parent = dir
continue
}
subdir := &FileInfo{
Expand Down

0 comments on commit 56839a4

Please sign in to comment.