|
|
|
@ -20,6 +20,7 @@ import (
|
|
|
|
|
"archive/tar"
|
|
|
|
|
"bytes"
|
|
|
|
|
"compress/gzip"
|
|
|
|
|
"errors"
|
|
|
|
|
"fmt"
|
|
|
|
|
"io"
|
|
|
|
|
"net/http"
|
|
|
|
@ -28,8 +29,6 @@ import (
|
|
|
|
|
"regexp"
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
"github.com/pkg/errors"
|
|
|
|
|
|
|
|
|
|
"helm.sh/helm/v3/pkg/chart"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -151,7 +150,7 @@ func LoadArchiveFiles(in io.Reader) ([]*BufferedFile, error) {
|
|
|
|
|
n = path.Clean(n)
|
|
|
|
|
if n == "." {
|
|
|
|
|
// In this case, the original path was relative when it should have been absolute.
|
|
|
|
|
return nil, errors.Errorf("chart illegally contains content outside the base directory: %q", hd.Name)
|
|
|
|
|
return nil, fmt.Errorf("chart illegally contains content outside the base directory: %q", hd.Name)
|
|
|
|
|
}
|
|
|
|
|
if strings.HasPrefix(n, "..") {
|
|
|
|
|
return nil, errors.New("chart illegally references parent directory")
|
|
|
|
|