go-macaron / session

Package session is a middleware that provides the session management of Macaron.
Apache License 2.0
26 stars 27 forks source link

Reduce permissions of file store #20

Closed aaronjwood closed 7 years ago

aaronjwood commented 7 years ago

Related to our recent discussion at https://github.com/gogits/gogs/issues/3363 can we change the default permissions to be much more restrictive? os.ModePerm is 0777 which is world writeable, world readable, and world executable. I wouldn't mind contributing a patch for this if you're open to this change.

Can we change this to 0600 for files (read/write for the owner only) and 0700 for directories (read/write/execute for the owner only)?

aaronjwood commented 7 years ago

Also, can we change things like this https://github.com/go-macaron/session/blob/master/file.go#L132 so that we're only using the privileges that are needed?

unknwon commented 7 years ago

0700 sounds good to me, please send a PR :D

unknwon commented 7 years ago

Closed by #21.