Discussion:
[Libusb-devel] libusb 0.1.12 without root rights
Manuel Sahm
2008-07-03 10:25:44 UTC
Permalink
Hello,

I try to run the test project "testlibusb", but it fails.

Without root rights:
--------------------------------

Dev #0: 0000 - 0000
Dev #0: 0E0F - 0002
Dev #0: 0AB1 - 0001
Dev #0: 0000 - 0000

With root rights:
---------------------------------

Dev #1: Linux 2.6.18.2-34-default ehci_hcd - EHCI Host Controller
Dev #1: Linux 2.6.18.2-34-default uhci_hcd - UHCI Host Controller
Dev #2: FEIG ELECTRONIC GmbH - OBID RFID-Reader
Dev #3: 0E0F - VMware Virtual USB hub



it seems that no usb_get_string function works without root rights ?
[Error code = -1]

Could anybody help me - thank you very much
Tim Roberts
2008-07-03 16:01:27 UTC
Permalink
Post by Manuel Sahm
I try to run the test project "testlibusb", but it fails.
--------------------------------
Dev #0: 0000 - 0000
Dev #0: 0E0F - 0002
Dev #0: 0AB1 - 0001
Dev #0: 0000 - 0000
---------------------------------
Dev #1: Linux 2.6.18.2-34-default ehci_hcd - EHCI Host Controller
Dev #1: Linux 2.6.18.2-34-default uhci_hcd - UHCI Host Controller
Dev #2: FEIG ELECTRONIC GmbH - OBID RFID-Reader
Dev #3: 0E0F - VMware Virtual USB hub
it seems that no usb_get_string function works without root rights ?
[Error code = -1]
True. Were you expecting something different?
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
Peter Stuge
2008-07-03 17:01:48 UTC
Permalink
Post by Manuel Sahm
it seems that no usb_get_string function works without root rights ?
It may, if your user has write permission on the relevant device
files, created in /dev/bus/usb on most modern systems.
Post by Manuel Sahm
Could anybody help me - thank you very much
Probably - what would you ultimately like to achieve using libusb?

Also, have you already considered the new libusb-1.0 API? :)


//Peter
Manuel Sahm
2008-07-04 06:22:16 UTC
Permalink
Hello,

how could I archieve, that all users have write permissions in the
/dev/bus/usb ?

I want to realize communication from a host to a device via synchronous
bulk transfers.
It works perfect with root rights, but not with user rights.

Thank you for your help

Best regards
Manuel Sahm
Post by Peter Stuge
Post by Manuel Sahm
it seems that no usb_get_string function works without root rights ?
It may, if your user has write permission on the relevant device
files, created in /dev/bus/usb on most modern systems.
Post by Manuel Sahm
Could anybody help me - thank you very much
Probably - what would you ultimately like to achieve using libusb?
Also, have you already considered the new libusb-1.0 API? :)
//Peter
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Libusb-devel mailing list
https://lists.sourceforge.net/lists/listinfo/libusb-devel
--
Freundliche Grüße / Best regards

Manuel Sahm

Research & Development

FEIG ELECTRONIC GmbH
Lange Straße 4
35781 Weilburg
Germany

Tel.: +49 (0)6471-3109.492
Fax.: +49 (0)6471-3109.99
email: ***@feig.de
internet: http://www.feig.de

------------------------------------------------------------------------
Amtsgericht Limburg HRB 3178
Geschäftsführer: Dipl.-Ing. Wolfgang Feig
------------------------------------------------------------------------

------------------------------------------------------------------------
Diese Email (eingeschlossen die Anhaenge) unterliegt Urheberrecht, die
Informationen sind vertraulich und rechtswirksam privilegiert. Der
Gebrauch dieser Email oder der Anhaenge von einem anderen als den
Adressaten ist nicht gestattet und unrechtmaessig.

This email (including any attachments) is subject to copyright, the
information in it is confidential, and it is legally privileged. Use of
this email or of any information in it other than by the addressee is
unauthorised and unlawful.
------------------------------------------------------------------------
Peter Stuge
2008-07-04 14:53:53 UTC
Permalink
Post by Manuel Sahm
how could I archieve, that all users have write permissions in the
/dev/bus/usb ?
This is highly undesirable. It is recommended that you design your
system so that only one single user needs write permission to the
device files. Modern distributions use udev or HAL, this file
describes udev:

http://petertodd.org/mtn/revision/file/ca618f2ae350c33508a77616ab212cf81bd45038/usbhotplug.txt

But udev has developed since 2007 so it is wise to look also at
udev's own documentation. Google udev to find it's home.
Post by Manuel Sahm
I want to realize communication from a host to a device via
synchronous bulk transfers.
It works perfect with root rights, but not with user rights.
It will work fine with user rights, once udev has been configured
correctly for your system.


//Peter
Xiaofan Chen
2008-07-05 01:38:05 UTC
Permalink
Post by Peter Stuge
Post by Manuel Sahm
how could I archieve, that all users have write permissions in the
/dev/bus/usb ?
This is highly undesirable. It is recommended that you design your
system so that only one single user needs write permission to the
device files. Modern distributions use udev or HAL, this file
http://petertodd.org/mtn/revision/file/ca618f2ae350c33508a77616ab212cf81bd45038/usbhotplug.txt
An easier to remember link (with PICklab Project).
http://piklab.sf.net/files/libusb_udev_hotplug.txt
Some examples:
http://piklab.wiki.sourceforge.net/USB+Port+Problems

A more up to date document covering a bit of HAL.
http://www.gphoto.org/doc/manual/permissions-usb.html

PolicyKit:
http://hal.freedesktop.org/docs/PolicyKit/
PolicyKit Examples (for Fedora 9 and similar)
http://www.nabble.com/operation-not-permitted-td17699443.html

Xiaofan

Loading...