From 74a904d04cca967c3a3b8b88f775fecdf07b6514 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 10 Dec 2018 00:26:12 +0000 Subject: [PATCH] Don't os.Chmod if we suspect the socket belongs to an abstract namespace --- src/yggdrasil/admin.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/yggdrasil/admin.go b/src/yggdrasil/admin.go index 720c30f8..2c3dc345 100644 --- a/src/yggdrasil/admin.go +++ b/src/yggdrasil/admin.go @@ -348,8 +348,12 @@ func (a *admin) listen() { } a.listener, err = net.Listen("unix", a.listenaddr[7:]) if err == nil { - if err := os.Chmod(a.listenaddr[7:], 0660); err != nil { - a.core.log.Println("WARNING:", a.listenaddr[:7], "may have unsafe permissions!") + switch a.listenaddr[7:8] { + 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":