On 2025/01/02 19:44, Kirill A. Korinsky wrote: > On Thu, 02 Jan 2025 19:11:05 +0100, > Klemens Nanni <k...@openbsd.org> wrote: > > > > 31.12.2024 23:11, Kirill A. Korinsky пишет: > > > Robert, > > > > > > I'd like to adjust one patch on all chrome-based browsers in ports tree. > > > > > > A few days ago I had commited a fix [1] in uvideo.c which allows user to > > > select in Firefox between connected webcams. > > > > > > Thus, the same can be done in Chrome-based browsers, but it needs small > > > adjustment in the patch. > > > > > > I had used the same limit of number of possible devices with libwebrtc > > > [2], > > > and updated unveil files to allow /dev/video0 and /dev/video1 which is > > > created by default.ta > > > > Makes sense to unveil all default devices, but trying to open 64 of them > > like > > libWebRTC? I guess we'd be fine with probing just the first two, matching > > unveil. > > > > No objection, I can see how matching similar code might make sense, but that > > limit sounds absurdly high. > > > > On my usual setup I have three devices and use /dev/video0 and /dev/video2, > and the only way to increase such hard limit, is recompile the chrome which > requires a lot of space (almost 40Gb) and a lot of times (depends of CPU, > migth be a days or two). > > I may put here 8 or 16 or anything, but I prefer to match some behaviour and > webrtc looks as good as it can be.
Common situation: laptop has a visible light camera, an infrared camera, and an camera plugged into a USB port. Whatever the maximum in the loop, I suggest unveiling at least 4, to allow the above and one extra, without other tweaks. > Keep in mind that this code is running only when user visits a page which > looking for devices. It's very rare, and shouldn't create any issue. I don't think it's _too_ unreasonable for the code to check higher than the default unveil to allow unusual cases without a recompile, although this is probably going to trigger warnings in /etc/daily if accounting is enabled (the "lastcomm | grep") so perhaps it does make sense to use a smaller number (8 seems alright to me) and align the loop and unveil.