[sane-devel] USB kernel scanner driver

Henning Meier-Geinitz henning at meier-geinitz.de
Wed Oct 23 18:30:26 BST 2002


Hi,

On Wed, Oct 23, 2002 at 05:47:18PM +0100, Major A wrote:
> How does libusb handle permissions on linux then?

See man sane-usb :-)

> /proc/bus/usb can only be accessed by root.

On a one-user system: just mount it with read/write permissions for
everyone. On multiuser systems, use hot-plug utilities to set up
permissions.

> With the USB scanner module, one had a way of setting permissions via
> the device file.

But only for all or no scanner. If you have a machine with more then
one scanner, you can't grant permissions for only a specific scanner
(because you never know, which one will be /dev/usb/scanner0).

> How would one restrict access so that although a user can scan, they
> can't fiddle with the USB hard drive or CD-ROM or automatic
> nuclear-weapon detonator?

Use a chmod in a hot-plug script that starts when that specific
vendor/product id is plugged in.

> > If there are no objections, the plan will be to change the backends to
> > be able to use both libusb and the kernel scanner module.
> 
> Isn't that done transparently by the sanei_usb interface?

Basically, yes. But if you just use a hardcoded

sanei_usb_open ("/dev/usb/scanner", &fd)

sanei_usb will just open that file.

If you use sanei_usb_find_devices or sanei_usb_attach_matching_devices
and call sanei_usb_open with the "file name" you got from those
functions, then it will also work with libusb.

Basically, backends that rely on having a device file name like
/dev/usb/scanner0
in their config files need to be changed.

> BTW, VueScan uses the USB scanner module.

Ok.

Bye,
  Henning



More information about the sane-devel mailing list