Skip to content

Commit

Permalink
Fix issue mholt#222 in package github.com/iotanbo/archiver/v3
Browse files Browse the repository at this point in the history
  • Loading branch information
iotanbo committed Nov 27, 2021
1 parent a802ddf commit 1cdba9e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
19 changes: 15 additions & 4 deletions 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) <a href="https://dev.azure.com/mholt-dev/Archiver/_build"><img src="https://img.shields.io/azure-devops/build/mholt-dev/1e14e7f7-f929-4fec-a1db-fa5a3c0d4ca9/2/master.svg?label=cross-platform%20tests&style=flat-square"></a> [![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

Expand Down Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion archiver.go
Expand Up @@ -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, "..")
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/arc/main.go
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion error_test.go
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"testing"

"github.com/mholt/archiver/v3"
"github.com/iotanbo/archiver/v3"
)

func TestIllegalPathErrorString(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,4 +1,4 @@
module github.com/mholt/archiver/v3
module github.com/iotanbo/archiver/v3

go 1.13

Expand Down
2 changes: 1 addition & 1 deletion tar_test.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 1cdba9e

Please sign in to comment.