Pass full environment to Xpra client

master
xSmurf 9 years ago
parent 58a045784d
commit f86611af82

@ -102,6 +102,8 @@ func initialize() *daemonState {
d.log.Fatalf("Failed to create sockets directory: %v", err)
}
os.Clearenv()
go d.processSignals(sigs)
return d
@ -246,8 +248,9 @@ func (d *daemonState) handleLaunch(msg *LaunchMsg, m *ipc.Message) error {
}
} else {
d.Debug("Would launch %s", p.Name)
msg.Env = d.sanitizeEnvironment(p, msg.Env)
_, err = d.launch(p, msg, m.Ucred.Uid, m.Ucred.Gid, d.log)
rawEnv := msg.Env
msg.Env = d.sanitizeEnvironment(p, rawEnv)
_, err = d.launch(p, msg, rawEnv, m.Ucred.Uid, m.Ucred.Gid, d.log)
if err != nil {
d.Warning("Launch of %s failed: %v", p.Name, err)
return m.Respond(&ErrorMsg{err.Error()})

@ -42,6 +42,7 @@ type Sandbox struct {
ready sync.WaitGroup
network *network.SandboxNetwork
mountedFiles []string
rawEnv []string
}
func createSocketPath(base string) (string, error) {
@ -71,11 +72,13 @@ func createInitCommand(initPath string, cloneNet bool) *exec.Cmd {
//Chroot: chroot,
Cloneflags: cloneFlags,
}
cmd.Env = []string{}
return cmd
}
func (d *daemonState) launch(p *oz.Profile, msg *LaunchMsg, uid, gid uint32, log *logging.Logger) (*Sandbox, error) {
func (d *daemonState) launch(p *oz.Profile, msg *LaunchMsg, rawEnv []string, uid, gid uint32, log *logging.Logger) (*Sandbox, error) {
/*
u, err := user.LookupId(fmt.Sprintf("%d", uid))
@ -166,6 +169,7 @@ func (d *daemonState) launch(p *oz.Profile, msg *LaunchMsg, uid, gid uint32, log
addr: socketPath,
stderr: pp,
network: stn,
rawEnv: rawEnv,
}
if p.Networking.Nettype == network.TYPE_BRIDGE {
@ -406,6 +410,8 @@ func (sbox *Sandbox) startXpraClient() {
sbox.profile.Name,
sbox.daemon.log)
sbox.xpra.Process.Env = append(sbox.rawEnv, sbox.xpra.Process.Env...)
if sbox.daemon.config.LogXpra {
sbox.setupXpraLogging()
}

Loading…
Cancel
Save