Merge pull request #281 from andrewstuart/master

Add chmod up directory tree for world read/execute on directories
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-02-18 09:33:08 -03:00 committed by GitHub
commit 05235588ff

View file

@ -20,6 +20,7 @@ import (
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"os" "os"
"path"
"regexp" "regexp"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -59,8 +60,17 @@ type auth struct {
// NewParser creates a new authentication annotation parser // NewParser creates a new authentication annotation parser
func NewParser(authDirectory string, sr resolver.Secret) parser.IngressAnnotation { func NewParser(authDirectory string, sr resolver.Secret) parser.IngressAnnotation {
// TODO: check permissions required os.MkdirAll(authDirectory, 0755)
os.MkdirAll(authDirectory, 0655)
currPath := authDirectory
for currPath != "/" {
currPath = path.Dir(currPath)
err := os.Chmod(currPath, 0755)
if err != nil {
break
}
}
return auth{sr, authDirectory} return auth{sr, authDirectory}
} }