mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 21:10:29 +00:00
Don't os.Chmod if we suspect the socket belongs to an abstract namespace
This commit is contained in:
parent
06c6dfc67f
commit
74a904d04c
@ -348,8 +348,12 @@ func (a *admin) listen() {
|
|||||||
}
|
}
|
||||||
a.listener, err = net.Listen("unix", a.listenaddr[7:])
|
a.listener, err = net.Listen("unix", a.listenaddr[7:])
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if err := os.Chmod(a.listenaddr[7:], 0660); err != nil {
|
switch a.listenaddr[7:8] {
|
||||||
a.core.log.Println("WARNING:", a.listenaddr[:7], "may have unsafe permissions!")
|
case "@": // maybe abstract namespace
|
||||||
|
default:
|
||||||
|
if err := os.Chmod(a.listenaddr[7:], 0660); err != nil {
|
||||||
|
a.core.log.Println("WARNING:", a.listenaddr[:7], "may have unsafe permissions!")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "tcp":
|
case "tcp":
|
||||||
|
Loading…
Reference in New Issue
Block a user