File tree 1 file changed +3
-0
lines changed
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 7
7
"io/fs"
8
8
"os"
9
9
"path/filepath"
10
+ "strings"
10
11
)
11
12
12
13
func ExtractTarStream (r io.Reader , targetPath string ) error {
@@ -39,6 +40,7 @@ func ExtractTarStream(r io.Reader, targetPath string) error {
39
40
return fmt .Errorf ("ExtractTarStream: Mkdir() failed: %w" , err )
40
41
}
41
42
case tar .TypeReg :
43
+ _ = os .Remove (p ) // we allow overwriting, which easily happens on case insensitive filesystems
42
44
outFile , err := os .Create (p )
43
45
if err != nil {
44
46
return fmt .Errorf ("ExtractTarStream: Create() failed: %w" , err )
@@ -57,6 +59,7 @@ func ExtractTarStream(r io.Reader, targetPath string) error {
57
59
return err
58
60
}
59
61
case tar .TypeSymlink :
62
+ _ = os .Remove (p ) // we allow overwriting, which easily happens on case insensitive filesystems
60
63
if err := os .Symlink (header .Linkname , p ); err != nil {
61
64
return fmt .Errorf ("ExtractTarStream: Symlink() failed: %w" , err )
62
65
}
You can’t perform that action at this time.
0 commit comments