Skip to content

Commit

Permalink
catched before the condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dduzgun-security committed Jun 13, 2024
1 parent a488c87 commit 46681ac
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions client/allocwatcher/alloc_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,14 +622,6 @@ func (p *remotePrevAlloc) streamAllocDir(ctx context.Context, resp io.ReadCloser
}
// If the header is for a symlink we create the symlink
if hdr.Typeflag == tar.TypeSymlink {
escapes, err := escapingfs.PathEscapesAllocDir(dest, "", hdr.Linkname)
if err != nil {
return fmt.Errorf("error evaluating path %q: %w", hdr.Linkname, err)
}
if escapes {
return fmt.Errorf("archive contains file that escapes alloc dir")
}

if err = os.Symlink(hdr.Linkname, filepath.Join(dest, hdr.Name)); err != nil {
return fmt.Errorf("error creating symlink: %w", err)
}
Expand Down

0 comments on commit 46681ac

Please sign in to comment.