From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Mon, 01 May 2006 19:09:19 +0000 Subject: Re: Accessing usb devices with USBDEVFS Message-Id: <20060501190919.GC8038@vrfy.org> List-Id: References: <44525468.5030106@ist-traffic.com> In-Reply-To: <44525468.5030106@ist-traffic.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Mon, May 01, 2006 at 03:00:17PM -0400, Danny Budik wrote: > > >>So is there a way then to read from the /dev/bus/usb? Like I > >>mentioned > >>in the parent post, I am just using fopen, and the functions > >>provided in > >>usbdevice_fs.h and usb.h to read data from the usb device. The > >>device is > >>a proprietary sensor that my company makes. Is there a > >>manual/documentation about how to do this the more "modern" way? > > > >No, that's still the correct way. If you use libusb, none of your > >code > >changes at all. If you are using "raw" usbfs, then just open a > >different file. > > > >Hope this helps, > > > >greg k-h > > > So that brings me to my next question. I guess I didn't know that > libusb existed and wrote my own interface functions. Is it because of > this that whenever I access the USB device, I must be root? Obviously > that's a security issue. In other words, can I read/write to my USB > device as a user using libusb? That has nothing to do with the way you access the device it's not different for libusb or a simple open(). The usual way is to change the owner/group of the device node or add an user ACL to the node when it appears and grant access that way to normal users. There are several solutions out there like pam_console, resmgr, or just putting the users in a special group. Kay ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel