Add chmod up directory tree for world read/execute on directories

This commit is contained in:
Andrew Stuart 2017-02-15 12:29:27 -07:00
parent 9bba947325
commit 2b02ea6530
No known key found for this signature in database
GPG key ID: D409317C5B5ACD4D

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}
} }