2001-10-05 11:51:11

by Tim Waugh

[permalink] [raw]
Subject: User-level USB device drivers, and permissions

I have a question regarding user-level USB device drivers. The
project I'm thinking about is gphoto2. I'm posting it here because at
least part of the solution lies in usbdevfs I think.

The problem is this:

How can a user-level USB device driver do its job while running as a
non-root 'console' user, with minimal (preferrably no) intervention
from the sysadmin?

By 'console' user, I am talking about the users that pam_console will
recognise as being on the console.

The closest solution at the moment seems to be: mount /proc/bus/usb
group-writable and group-owned by 'usb', and add users that can use
USB devices to group 'usb'. This has the following problems:

- sysadmin needs to add any potential console users to the 'usb' group
first,
- those users are then in the usb group even when not at the console.

An idea in my head is to have a pam module that, for console users,
mounts -tusbdevfs none /somewhere/usb-bus/$LOGNAME with user ownership
on login and dismounts it on logout, but I don't know if that is
feasible.

Does anyone know if this problem has already been solved, or else can
they think of a solution?

Thanks,
Tim.
*/


Attachments:
(No filename) (1.12 kB)
(No filename) (232.00 B)
Download all attachments

2001-10-06 00:08:03

by Oliver Neukum

[permalink] [raw]
Subject: Re: User-level USB device drivers, and permissions

> An idea in my head is to have a pam module that, for console users,
> mounts -tusbdevfs none /somewhere/usb-bus/$LOGNAME with user ownership
> on login and dismounts it on logout, but I don't know if that is
> feasible.

This is way too coarse. This control needs to be there on a device level at
least.

> Does anyone know if this problem has already been solved, or else can
> they think of a solution?

The current conventional wisdom is to use chmod in the hotplug scripts and
logout scripts.
This has been discussed in connection with a SANE backend for Microtek 3600
scanners.

Regards
Oliver