diff --git a/README.md b/README.md index c8de5e7e..5f418330 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,17 @@ -# archiver [![archiver GoDoc](https://img.shields.io/badge/reference-godoc-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/mholt/archiver?tab=doc) [![Ubuntu-latest](https://github.com/mholt/archiver/actions/workflows/ubuntu-latest.yml/badge.svg)](https://github.com/mholt/archiver/actions/workflows/ubuntu-latest.yml) [![Macos-latest](https://github.com/mholt/archiver/actions/workflows/macos-latest.yml/badge.svg)](https://github.com/mholt/archiver/actions/workflows/macos-latest.yml) [![Windows-latest](https://github.com/mholt/archiver/actions/workflows/windows-latest.yml/badge.svg)](https://github.com/mholt/archiver/actions/workflows/windows-latest.yml) +# archiver [![archiver GoDoc](https://img.shields.io/badge/reference-godoc-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/mholt/archiver?tab=doc) [![Ubuntu-latest](https://github.com/iotanbo/archiver/actions/workflows/ubuntu-latest.yml/badge.svg)](https://github.com/iotanbo/archiver/actions/workflows/ubuntu-latest.yml) [![Macos-latest](https://github.com/iotanbo/archiver/actions/workflows/macos-latest.yml/badge.svg)](https://github.com/iotanbo/archiver/actions/workflows/macos-latest.yml) [![Windows-latest](https://github.com/iotanbo/archiver/actions/workflows/windows-latest.yml/badge.svg)](https://github.com/iotanbo/archiver/actions/workflows/windows-latest.yml) -Introducing **Archiver 3.1** - a cross-platform, multi-format archive utility and Go library. A powerful and flexible library meets an elegant CLI in this generic replacement for several platform-specific or format-specific archive utilities. +## Note +This is a fork of https://github.com/mholt/archiver with some issues fixed. +It is recommended to use the original package except if you need those urgent fixes. +To use this package: + +``` +go get github.com/iotanbo/archiver/v3@v3.5.1-iotanbo +import "github.com/iotanbo/archiver/v3" +``` +## About + +Introducing **Archiver 3** - a cross-platform, multi-format archive utility and Go library. A powerful and flexible library meets an elegant CLI in this generic replacement for several platform-specific or format-specific archive utilities. ## Features @@ -203,11 +214,11 @@ The archiver package allows you to easily create and open archives, walk their c To use as a dependency in your project: ```bash -go get github.com/mholt/archiver/v3 +go get github.com/iotanbo/archiver/v3@v3.5.1-iotanbo ``` ```go -import "github.com/mholt/archiver/v3" +import "github.com/iotanbo/archiver/v3" ``` [See the package's GoDoc](https://pkg.go.dev/github.com/mholt/archiver?tab=doc) for full API documentation. diff --git a/archiver.go b/archiver.go index 6fdadadc..63182589 100644 --- a/archiver.go +++ b/archiver.go @@ -361,10 +361,11 @@ func isSymlink(fi os.FileInfo) bool { // within returns true if sub is within or equal to parent. func within(parent, sub string) bool { - rel, err := filepath.Rel(parent, sub) + rel, err := filepath.Rel(parent, sub) //rel if err != nil { return false } + //return true return !strings.Contains(rel, "..") } diff --git a/cmd/arc/main.go b/cmd/arc/main.go index fd28ac5f..e77b226e 100644 --- a/cmd/arc/main.go +++ b/cmd/arc/main.go @@ -10,8 +10,8 @@ import ( "path/filepath" "strings" + "github.com/iotanbo/archiver/v3" "github.com/klauspost/compress/zip" - "github.com/mholt/archiver/v3" "github.com/nwaples/rardecode" ) diff --git a/error_test.go b/error_test.go index d47ed85f..7af80952 100644 --- a/error_test.go +++ b/error_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/mholt/archiver/v3" + "github.com/iotanbo/archiver/v3" ) func TestIllegalPathErrorString(t *testing.T) { diff --git a/go.mod b/go.mod index 689d0e86..3f500e43 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/mholt/archiver/v3 +module github.com/iotanbo/archiver/v3 go 1.13 diff --git a/tar_test.go b/tar_test.go index 7a9d3541..2f913987 100644 --- a/tar_test.go +++ b/tar_test.go @@ -6,7 +6,7 @@ import ( "path" "testing" - "github.com/mholt/archiver/v3" + "github.com/iotanbo/archiver/v3" ) func requireRegularFile(t *testing.T, path string) os.FileInfo {