fix xsrf
This commit is contained in:
parent
204aec8135
commit
824f46979b
6 changed files with 69 additions and 103 deletions
|
|
@ -35,31 +35,10 @@ var (
|
|||
)
|
||||
|
||||
func initServer(cfg *core.Config) (err error) {
|
||||
// remove initial pledge due to violation with go1.12
|
||||
// sysctl kern.somaxconn
|
||||
// if err = godrop.PledgePromises("stdio rpath wpath cpath inet fattr flock proc exec id unveil"); err != nil {
|
||||
// return
|
||||
// }
|
||||
//dropCfg := godrop.Config{
|
||||
// User: cfg.User,
|
||||
// Group: cfg.Group,
|
||||
// Foreground: cfg.Foreground,
|
||||
//}
|
||||
//err = godrop.Drop(dropCfg, func() (net.Listener, error) {
|
||||
// return net.Listen("tcp", cfg.ListenAddr)
|
||||
//})
|
||||
//if err != nil {
|
||||
// return
|
||||
//}
|
||||
//if err = os.Chdir(cfg.DataDir); err != nil {
|
||||
// return
|
||||
//}
|
||||
|
||||
if err = godrop.PledgePromises("stdio rpath wpath cpath inet fattr flock unveil"); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
//l, err := godrop.GetListener()
|
||||
l, err := net.Listen("tcp", cfg.ListenAddr)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue