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

Implemented multiseat support #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

egormanga
Copy link

Abstract: tpm-fido can run multi-user, but any virtual device created by either instance would go to seat0 with no way to reassign it.


loginctl assign requires ID_FOR_SEAT property to be set on the device, which is missing for hidraw devices due to ID_PATH_TAG not being set for those:

# /usr/lib/udev/rules.d/71-seat.rules
TAG=="seat", ENV{ID_FOR_SEAT}=="", ENV{ID_PATH_TAG}!="", ENV{ID_FOR_SEAT}="$env{SUBSYSTEM}-$env{ID_PATH_TAG}"

In order to add ID_PATH_TAG, we needed some way to distinguish between users' uhid devices. I came up with the following construction numbered lower than the aforementioned rule:

# /etc/udev/rules.d/70-tpm-fido.rules
SUBSYSTEM=="hidraw", KERNELS=="0003:15D9:0A37.*", IMPORT{parent}="HID_NAME"
SUBSYSTEM=="hidraw", ENV{HID_NAME}=="tpm-fido", ENV{ID_PATH_TAG}=="", ENV{ID_PATH_TAG}="$env{HID_NAME}-$attr{country}"

Clearly, I am using the country parent attribute here, but where does it come from? See psanford/uhid#2 to find out ;)

Note: I chose to use UID for the value, which gets truncated to 8 bits, but that's diverse enough for most multiseat configuration out in the wild.

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

Successfully merging this pull request may close these issues.

1 participant