@@ -206,14 +206,8 @@ func (ta TarArchive) Decompress(destination string) error {
206
206
})
207
207
208
208
for _ , h := range symlinkHeaders {
209
- evalPath := linknameFullPath (h .path , h .linkname )
210
- // Don't use constucted link if the link is absolute
211
- if filepath .IsAbs (h .linkname ) {
212
- evalPath = h .linkname
213
- }
214
-
215
209
// Check to see if the file that will be linked to is valid for symlinking
216
- _ , err := filepath .EvalSymlinks (evalPath )
210
+ _ , err := filepath .EvalSymlinks (linknameFullPath ( h . path , h . linkname ) )
217
211
if err != nil {
218
212
return fmt .Errorf ("failed to evaluate symlink %s: %w" , h .path , err )
219
213
}
@@ -481,14 +475,8 @@ func (z ZipArchive) Decompress(destination string) error {
481
475
})
482
476
483
477
for _ , h := range symlinkHeaders {
484
- evalPath := linknameFullPath (h .path , h .linkname )
485
- // Don't use constucted link if the link is absolute
486
- if filepath .IsAbs (h .linkname ) {
487
- evalPath = h .linkname
488
- }
489
-
490
478
// Check to see if the file that will be linked to is valid for symlinking
491
- _ , err := filepath .EvalSymlinks (evalPath )
479
+ _ , err := filepath .EvalSymlinks (linknameFullPath ( h . path , h . linkname ) )
492
480
if err != nil {
493
481
return fmt .Errorf ("failed to evaluate symlink %s: %w" , h .path , err )
494
482
}
0 commit comments