Use umask 0077 across the process in order to have the created files readable only by the acme-dns user (#102)
This commit is contained in:
parent
ec013c0f25
commit
0fc5a8e848
3
main.go
3
main.go
@ -7,6 +7,7 @@ import (
|
|||||||
stdlog "log"
|
stdlog "log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/julienschmidt/httprouter"
|
"github.com/julienschmidt/httprouter"
|
||||||
"github.com/rs/cors"
|
"github.com/rs/cors"
|
||||||
@ -15,6 +16,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
// Created files are not world writable
|
||||||
|
syscall.Umask(0077)
|
||||||
// Read global config
|
// Read global config
|
||||||
var err error
|
var err error
|
||||||
if fileIsAccessible("/etc/acme-dns/config.cfg") {
|
if fileIsAccessible("/etc/acme-dns/config.cfg") {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user