app: integrate bwrap into environment setup

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-10-11 04:18:15 +09:00
parent 3ddfd76cdf
commit 662f2a9d2c
9 changed files with 181 additions and 40 deletions

View File

@@ -63,15 +63,17 @@ func (seal *appSeal) sharePulse() error {
// hard link pulse socket into target-executable share
psi := path.Join(seal.shareLocal, "pulse")
p := path.Join(seal.sys.runtime, "pulse", "native")
seal.sys.link(ps, psi)
seal.appendEnv(pulseServer, "unix:"+psi)
seal.sys.bind(psi, p, true)
seal.sys.setEnv(pulseServer, "unix:"+p)
// publish current user's pulse cookie for target user
if src, err := discoverPulseCookie(); err != nil {
return err
} else {
dst := path.Join(seal.share, "pulse-cookie")
seal.appendEnv(pulseCookie, dst)
seal.sys.setEnv(pulseCookie, dst)
seal.sys.copyFile(dst, src)
}