Skip to content

Commit

Permalink
Merge pull request #281 from andrewstuart/master
Browse files Browse the repository at this point in the history
Add chmod up directory tree for world read/execute on directories
  • Loading branch information
aledbf authored Feb 18, 2017
2 parents a9d6854 + 2b02ea6 commit 0523558
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 0523558

Please sign in to comment.