Closed
Description
gitea/modules/setting/setting.go
Line 1039 in 7ce938b
func loadInternalToken(sec *ini.Section) string {
...
switch tempURI.Scheme {
case "file":
fp, err := os.OpenFile(tempURI.RequestURI(), os.O_RDWR, 0600)
if err != nil {
log.Fatal("Failed to open InternalTokenURI (%s): %v", uri, err)
}
...
Using O_RDWR
is not really useful here. I think that it should be possible to make it only O_RDONLY
.
I spotted this as I tried to make the file 0400
and gitea failed to start.
Thanks for considering.
Metadata
Metadata
Assignees
Labels
No labels