On Tue, Apr 21, 2020 at 09:38:04AM -0600, Theo de Raadt wrote:
> Looks broken.
>
> Mihai Popescu <[email protected]> wrote:
>
> > Hi,
> >
> > It's clear OpenBSD is moving to sndioctl. I used it, but I got some
> > "strange" behaviour.
> > Watching youtube in chromium, tried this:
> >
> > $ sndioctl output.level=1
> > default: can't open control device
> >
> > After closing / restarting chromium, and starting youtube I can run same
> > command many times:
> >
> > $ sndioctl output.level=1
> > output.level=1
> > $ sndioctl output.level=0
> > output.level=0
> > $ sndioctl output.level=1
> > output.level=1
> >
> > Expected?
>
It looks like caused by unveil(2) usage in chrome. According to
unveil(2):
Directories are remembered at the time of a call to unveil().
This means that a directory that is removed and recreated after a
call to unveil() will appear to not exist.
so, unveil("~/.sndio") is called, if chrome is the first program to
use audio, the directory doesn't exist so it's not unveiled. Then,
chrome connects to sndiod, creates "~/.sndio" directory and tries to
save the cookie, which fails. Then, other programs (like sndioctl)
will be rejected by sndiod until chrome disconnects.
Adding the full cookie path wouldn't help as the directory doesn't
exist yet.
Hmm.