fixed permission on created devices
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user