From 2313bd6a3469a713385cb66d292bdbefb340cfb1 Mon Sep 17 00:00:00 2001 From: xSmurf Date: Mon, 29 Jun 2015 20:24:47 +0000 Subject: [PATCH] Pass proper creds to xpra.Stop() --- xpra/xpra.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xpra/xpra.go b/xpra/xpra.go index 022dd35..ecceb18 100644 --- a/xpra/xpra.go +++ b/xpra/xpra.go @@ -9,6 +9,7 @@ import ( "os/user" "path" "strconv" + "syscall" ) type Xpra struct { @@ -59,12 +60,15 @@ func getDefaultArgs(config *oz.XServerConf) []string { return args } -func (x *Xpra) Stop() ([]byte, error) { +func (x *Xpra) Stop(cred *syscall.Credential) ([]byte, error) { cmd := exec.Command("/usr/bin/xpra", "--socket-dir="+x.WorkDir, "stop", fmt.Sprintf(":%d", x.Display), ) + cmd.SysProcAttr = &syscall.SysProcAttr{ + Credential: cred, + } cmd.Env = []string{"TMPDIR=" + x.WorkDir} return cmd.Output() }