xpra icon
Bug tracker and wiki

Opened 3 weeks ago

Closed 3 weeks ago

#1631 closed enhancement (fixed)

uinput device permissions

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 2.2
Component: server Version: trunk
Keywords: Cc:

Description (last modified by Antoine Martin)

Follow up from #1611.

We want to be able to continue to use uinput when upgrading a server.

The patch attached almost kinda works, with some problems:

  • requires "xprop" to find the device uuid... ugly
  • the part of the patch that uses the device name to match the device cannot be used, as udev doesn't understand regex in the ATTRS match section... so we'll need to use something else (the device part of the USBID?)
  • we chmod the device to 0666 initially so that the existing X11 server can add the new device, that's dangerous - we need to chmod / chown it to the user the server belongs to

Attachments (1)

uinput-upgrades.patch (15.8 KB) - added by Antoine Martin 3 weeks ago.
work in progress patch

Download all attachments as: .zip

Change History (2)

Changed 3 weeks ago by Antoine Martin

Attachment: uinput-upgrades.patch added

work in progress patch

comment:1 Changed 3 weeks ago by Antoine Martin

Description: modified (diff)
Resolution: fixed
Status: newclosed

Done in r16777:

  • we hijack the "version" attribute of the uinput device to pass the uid to our custom udev program which tells udev which "OWNER" value to use for the new device. That way, the permissions are correct as soon as the device is created.
  • we also append a random string to the device name to ensure that the same user can run multiple sessions: each device will only be used by the server that knows its full name. We save the name as a root X11 property so we can re-create a new device when doing a server upgrade (or with --use-display).
Note: See TracTickets for help on using tickets.