Skip to content

Commit

Permalink
Add chmod up directory tree for world read/execute on directories
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstuart committed Feb 15, 2017
1 parent 9bba947 commit 2b02ea6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions core/pkg/ingress/annotations/auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path"
"regexp"

"github.com/pkg/errors"
Expand Down Expand Up @@ -59,8 +60,17 @@ type auth struct {

// NewParser creates a new authentication annotation parser
func NewParser(authDirectory string, sr resolver.Secret) parser.IngressAnnotation {
// TODO: check permissions required
os.MkdirAll(authDirectory, 0655)
os.MkdirAll(authDirectory, 0755)

currPath := authDirectory
for currPath != "/" {
currPath = path.Dir(currPath)
err := os.Chmod(currPath, 0755)
if err != nil {
break
}
}

return auth{sr, authDirectory}
}

Expand Down

0 comments on commit 2b02ea6

Please sign in to comment.