Browse Source

vendor: update github.com/go-macaron/session (#3363)

pull/4330/head
Unknwon 8 years ago
parent
commit
aba8789542
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 4
      vendor/github.com/go-macaron/session/README.md
  2. 12
      vendor/github.com/go-macaron/session/file.go
  3. 6
      vendor/vendor.json

4
vendor/github.com/go-macaron/session/README.md generated vendored

@ -1,4 +1,4 @@
# session [![Build Status](https://travis-ci.org/go-macaron/session.svg?branch=master)](https://travis-ci.org/go-macaron/session) [![](http://gocover.io/_badge/github.com/go-macaron/session)](http://gocover.io/github.com/go-macaron/session)
# session [![Build Status](https://travis-ci.org/go-macaron/session.svg?branch=master)](https://travis-ci.org/go-macaron/session)
Middleware session provides session management for [Macaron](https://github.com/go-macaron/macaron). It can use many session providers, including memory, file, Redis, Memcache, PostgreSQL, MySQL, Couchbase, Ledis and Nodb.
@ -9,7 +9,7 @@ Middleware session provides session management for [Macaron](https://github.com/
## Getting Help
- [API Reference](https://gowalker.org/github.com/go-macaron/session)
- [Documentation](http://go-macaron.com/docs/middlewares/session)
- [Documentation](https://go-macaron.com/docs/middlewares/session)
## Credits

12
vendor/github.com/go-macaron/session/file.go generated vendored

@ -86,7 +86,7 @@ func (s *FileStore) Release() error {
return err
}
return ioutil.WriteFile(s.p.filepath(s.sid), data, os.ModePerm)
return ioutil.WriteFile(s.p.filepath(s.sid), data, 0600)
}
// Flush deletes all session data.
@ -121,7 +121,7 @@ func (p *FileProvider) filepath(sid string) string {
// Read returns raw session store by session ID.
func (p *FileProvider) Read(sid string) (_ RawStore, err error) {
filename := p.filepath(sid)
if err = os.MkdirAll(path.Dir(filename), os.ModePerm); err != nil {
if err = os.MkdirAll(path.Dir(filename), 0700); err != nil {
return nil, err
}
p.lock.RLock()
@ -129,7 +129,7 @@ func (p *FileProvider) Read(sid string) (_ RawStore, err error) {
var f *os.File
if com.IsFile(filename) {
f, err = os.OpenFile(filename, os.O_RDWR, os.ModePerm)
f, err = os.OpenFile(filename, os.O_RDONLY, 0600)
} else {
f, err = os.Create(filename)
}
@ -187,15 +187,15 @@ func (p *FileProvider) regenerate(oldsid, sid string) (err error) {
if err != nil {
return err
}
if err = os.MkdirAll(path.Dir(oldname), os.ModePerm); err != nil {
if err = os.MkdirAll(path.Dir(oldname), 0700); err != nil {
return err
}
if err = ioutil.WriteFile(oldname, data, os.ModePerm); err != nil {
if err = ioutil.WriteFile(oldname, data, 0600); err != nil {
return err
}
}
if err = os.MkdirAll(path.Dir(filename), os.ModePerm); err != nil {
if err = os.MkdirAll(path.Dir(filename), 0700); err != nil {
return err
}
if err = os.Rename(oldname, filename); err != nil {

6
vendor/vendor.json vendored

@ -105,10 +105,10 @@
"revisionTime": "2016-06-27T17:00:12Z"
},
{
"checksumSHA1": "bwYWc6t4Lapw4Xl3v4o2hzOZ5kw=",
"checksumSHA1": "gO0dj0NqsmBTkf4D0JzJDtOEx+U=",
"path": "github.com/go-macaron/session",
"revision": "66031fcb37a0fff002a1f028eb0b3a815c78306b",
"revisionTime": "2015-10-14T03:41:01Z"
"revision": "b8e286a0dba8f4999042d6b258daf51b31d08938",
"revisionTime": "2017-03-20T17:22:09Z"
},
{
"checksumSHA1": "jVW5CmzplA0UDjai0AFYJFVXAJk=",

Loading…
Cancel
Save