From d339e33f927624e4fff9a6a4be55568bb5758c00 Mon Sep 17 00:00:00 2001 From: fuleyi Date: Fri, 22 Nov 2024 10:14:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=BC=8F=E6=B4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于environ 由sender 控制,因此可以通过 sender 的 env 向 daemon 注入提 权逻辑。 只需要 sender 的 DISPLAY 环境变量。 Log: 修复安全漏洞 pms: TASK-101537 --- system/display/displaycfg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/display/displaycfg.go b/system/display/displaycfg.go index cda69a775..c4524ea8a 100644 --- a/system/display/displaycfg.go +++ b/system/display/displaycfg.go @@ -260,7 +260,7 @@ func (d *Display) doDetectSupportWayland(sender dbus.Sender) (bool, error) { } else { cmd = exec.Command("glxinfo") } - environ = append(environ, "LC_ALL=C") + environ = append(os.Environ(), environ.Get("DISPLAY"), "LC_ALL=C") cmd.Env = environ outPipe, err := cmd.StdoutPipe() if err != nil {