fixed permission on created devices

This commit is contained in:
2026-02-18 23:50:40 +01:00
parent 0202cb4a7f
commit 6172d9e2aa
5 changed files with 68 additions and 1 deletions
+9 -1
View File
@@ -132,7 +132,10 @@ func (um *UseManager) AttachDevice(clientID, busID string) error {
// Wait for response (with timeout via context)
select {
case granted := <-respChan:
case granted, ok := <-respChan:
if !ok || granted == nil {
return fmt.Errorf("device request denied")
}
return um.setupVHCI(clientID, busID, granted)
case <-um.client.ctx.Done():
return fmt.Errorf("client shutting down")
@@ -239,6 +242,11 @@ func (um *UseManager) setupVHCI(clientID, busID string, granted *protocol.Device
go um.tunnelReadLoop(tunnel)
log.Printf("[use] device %s attached on VHCI port %d", key, port)
// Fix permissions on newly created device nodes (e.g. /dev/video*)
// VHCI-created devices don't get normal udev permissions
go fixVHCIDevicePermissions(port)
return nil
}