Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uinput device permissions #1631

Closed
totaam opened this issue Sep 2, 2017 · 5 comments
Closed

uinput device permissions #1631

totaam opened this issue Sep 2, 2017 · 5 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Sep 2, 2017

Issue migrated from trac ticket # 1631

component: server | priority: major | resolution: fixed

2017-09-02 11:40:45: antoine created the issue


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
@totaam
Copy link
Collaborator Author

totaam commented Sep 2, 2017

2017-09-02 11:41:03: antoine uploaded file uinput-upgrades.patch (15.8 KiB)

work in progress patch

@totaam
Copy link
Collaborator Author

totaam commented Sep 2, 2017

2017-09-02 18:36:30: antoine changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Sep 2, 2017

2017-09-02 18:36:30: antoine set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Sep 2, 2017

2017-09-02 18:36:30: antoine edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Sep 2, 2017

2017-09-02 18:36:30: antoine commented


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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant